Page 1 of 1

Calling Oracle Package using Oracle Connector

Posted: Mon Oct 29, 2012 4:42 pm
by dganeshm
I am trying to call Oracle Package using Oracle Connector using the PL/SQL Block ,

exec ACMS.util_acms.truncate_table('ACMS.ACRU_MNTNC_WRK') but I am getting an error :

Error code: 6,550, Error message: ORA-06550: line 1, column 12:
PLS-00103: Encountered the symbol "ACMS" when expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "ACMS" to continue.. (CC_OraStatement::executePlSql, file CC_OraStatement.cpp, line 3,710)

When I execute "call ACMS.util_acms.truncate_table('ACMS.ACRU_MNTNC_WRK')" from after or before SQL Statement section it works , I am not sure why it does not work for exec. That is how I use it from toad and that does not give any issues.. Please advise.

Posted: Mon Oct 29, 2012 5:28 pm
by lstsaur
EXECUTE is a SQL*Plus command. So what you have to do is to invoke and get to the SQL*Plus prompt first. Put all these statements in a shell script and execute it from DS.

Posted: Mon Oct 29, 2012 10:21 pm
by chulett
Stick with 'call'. As noted, save the anonymous block for something that speaks sqlplus.

Posted: Thu Nov 01, 2012 4:20 pm
by dganeshm
I am using 'call' , this gives the correct results.

Posted: Thu Nov 01, 2012 5:58 pm
by lstsaur
Of course CALL command is going to work. Just trying to show you how to use the EXECUTE command to execute your packaged stored procedure from the DS environment.

Posted: Thu Nov 01, 2012 11:54 pm
by dganeshm
Thanks lstsaur, point duly noted.