Sqlplus cmd not returning control back to Routine
Posted: Thu Jun 25, 2015 8:48 am
Hi, calling sql query from a routine using sqlplus. routine run never ending.
Code:
Statement = "SELECT count(*) FROM TableName;"
Command = "sqlplus -S ": pSrcDBUser : "/" : pSrcDBPwd : pConString : char(10) : "SELECT count(*) FROM TableName;" : char(10) : "Exit" : char(10)
Call DSExecute ('NT', Command, OsOutput, OsStatus)
Above command will look before calling dsexecute as:
sqlplus -S UserName/Pwd@ConString
SELECT count(*) FROM TableName;
Exit
when I ran this directly from command prompt it is working fine and resulting record count. But when i call through DSExecute it is never ending the execution. I tried below as well but no luck. Please help.
Command = "sqlplus -S ": pSrcDBUser : "/" : pSrcDBPwd : pConString : char(10) : "SELECT count(*) FROM TableName;" : char(10) : "Exit" : char(10) : "Exit" : char(10)
Thanks in advance
Code:
Statement = "SELECT count(*) FROM TableName;"
Command = "sqlplus -S ": pSrcDBUser : "/" : pSrcDBPwd : pConString : char(10) : "SELECT count(*) FROM TableName;" : char(10) : "Exit" : char(10)
Call DSExecute ('NT', Command, OsOutput, OsStatus)
Above command will look before calling dsexecute as:
sqlplus -S UserName/Pwd@ConString
SELECT count(*) FROM TableName;
Exit
when I ran this directly from command prompt it is working fine and resulting record count. But when i call through DSExecute it is never ending the execution. I tried below as well but no luck. Please help.
Command = "sqlplus -S ": pSrcDBUser : "/" : pSrcDBPwd : pConString : char(10) : "SELECT count(*) FROM TableName;" : char(10) : "Exit" : char(10) : "Exit" : char(10)
Thanks in advance