Home » Open Source » Programming Interfaces » Calling sql statement in emcli using Python script (Windows , Oracle EM12c )
Calling sql statement in emcli using Python script [message #659688] Fri, 27 January 2017 07:15
sanei05
Messages: 104
Registered: September 2008
Senior Member
Hi,
I am writing a code to fetch few details of the jobs using python script using emcli in interactive mode.

When i give the following code outside emcli, it works perfectly

D:\OMS_HOME>emcli list -sql="select sysdate-1 from dual"
SYSDATE-1 

2017-01-26 06:07:34.0
Rows:1


But when I go with interactive mode, I see the session are getting disconnected.

Can anyone help to get the results out of it using interactive mode in emcli.
FYI , I am not able to use cx_oracle as I am using emcli @script1.py to execute the script


emcli>list (sql="select sysdate-1 from dual")
Error: Session expired. Run emcli login to establish a session.


emcli>list (sql='select sysdate-1 from dual')
Error: Session expired. Run emcli login to establish a session.

emcli>f_sql="select sysdate-1 from dual"
emcli>list (sql=f_sql)
Error: Session expired. Run emcli login to establish a session.
Previous Topic: can't load php_oci8_12c.dll
Next Topic: 12c not connect with php see error Call to undefined function oci_connect()
Goto Forum:
  


Current Time: Thu Mar 28 11:52:13 CDT 2024