我正在尝试使用Python直接连接到Essbase。我可以导入Essbase,但出现错误
File "<ipython-input-14-a27e56c0bf67>", line 702, in <module>
esss = Essbase.Essbase()
TypeError: 'module' object is not callable
代码
import Essbase
import subprocess
if __name__ == '__main__':
fomat_meta = """
alter session set dml_output alias off
alter session set dml_output numerical_display fixed_decimal
alter session set dml_output precision 2
set column_width 50;
"""
MDX_SQL = """
SELECT NON EMPTY {Uda([Org Unit], "PA")} ON ROWS
,
{[Nov]} ON COLUMNS
from CUBE
where ([Measure].[33333],[Product].[CHQ])
"""
sql = [
MDX_SQL
]
esss = Essbase.Essbase()
eh = esss.connect("USERID", "PASSWORD", "123.123.123.123")
print(MDX_SQL)
esss.bMdxQuery = True
#for sqls in sql:
esss.execute(MDX_SQL)
xxx = esss.rows()
print("Disconnecting...")
esss.disconnect()
我尝试调用Essbase和Essbase.Essbase 然后我得到下面。我认为模块确实存在。
Essbase将返回: 来自'C:\ Python3 \ Lib \ Essbase.py'的模块'Essbase'
Essbase.Essbase将返回: 来自'C:\ Python3 \ Lib \ Essbase.py'的模块'Essbase'