Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

calling sql statement in emcli using python script

3163453Jan 27 2017 — edited Jan 31 2017

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.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 28 2017
Added on Jan 27 2017
3 comments
1,157 views