Escape Character in ExecSH Routine Activity Sequence Job

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
umlaut
Participant
Posts: 3
Joined: Wed Jul 12, 2006 7:27 am
Location: Leicester

Escape Character in ExecSH Routine Activity Sequence Job

Post by umlaut »

I am trying to run the following unix command in a Routine Activity of a Seqence

'echo "EXEC DBMS_STATS.gather_table_stats(' : DEST_US : ',' : DEST_TBL : ')" | sqlplus ' : DEST_US : '/' : DEST_PW : '@' :DEST_DB

DEST_TBL, DEST_US, DEST_PW and DEST_DB are job parameters.

the single quotes are required for the Pl/Sql function DBMS_STATS but I cannot find an escape character. Required arguments are:

DBMS_STATS.gather_table_stats('Database User','Database Table')

As a result I get something like the following (I've put the parameter names back in instead of the actual database names):

*** Output from command was: ***

SQL> BEGIN DBMS_STATS.gather_table_stats(DEST_US,DEST_TBL); END;

*
ERROR at line 1:
ORA-06550: line 1, column 37:
PLS-00201: identifier 'DEST_US' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Any ideas?


[Rock Over London, Rock On Chicago. Business Gas: Energy For Excellence]
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Try something along the lines of
'echo "EXEC DBMS_STATS.gather_table_stats\(' : DEST_US : ',' : DEST_TBL : '\)" | sqlplus
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Arnd makes the point that, since parentheses are meaningful to the shell, they need to be escaped, hence "\(" and "\)".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply