Calling Oracle Package using Oracle Connector

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dganeshm
Premium Member
Premium Member
Posts: 91
Joined: Tue Aug 11, 2009 3:26 pm

Calling Oracle Package using Oracle Connector

Post 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.
Regards,
Ganesh
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Stick with 'call'. As noted, save the anonymous block for something that speaks sqlplus.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dganeshm
Premium Member
Premium Member
Posts: 91
Joined: Tue Aug 11, 2009 3:26 pm

Post by dganeshm »

I am using 'call' , this gives the correct results.
Regards,
Ganesh
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post 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.
dganeshm
Premium Member
Premium Member
Posts: 91
Joined: Tue Aug 11, 2009 3:26 pm

Post by dganeshm »

Thanks lstsaur, point duly noted.
Regards,
Ganesh
Post Reply