Modify Schema Name in OCI9

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ar_shriks
Participant
Posts: 11
Joined: Sun Feb 03, 2002 9:42 am
Location: United Arab Emirates

Modify Schema Name in OCI9

Post by ar_shriks »

I have a job with Query Type : "Fully Generated SQL Query" reading from an Oracle database. The SQL query looks like :

SELECT FIELD1, FIELD2
FROM USER1.TABLE_NAME;

Note that the the schema name is USER1.

Now, when I have to run the job from production database the schema name changes to USER2 and the query should look like:

SELECT FIELD1, FIELD2
FROM USER2.TABLE_NAME;

Is it possible to modify the job to read from USER2.TABLE_NAME without changing the Query Type to "User Defined SQL Query"?

Thanks & Regards
Shrikanth
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Hi,


Create parameter for database schema... Like

SELECT FIELD1, FIELD2 FROM #SchemaName#.TABLE_NAME;


Thanks,
Anupam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That is, include a job parameter reference as the schema name in the Table Name field. Make sure there is a job parameter of that name.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ar_shriks
Participant
Posts: 11
Joined: Sun Feb 03, 2002 9:42 am
Location: United Arab Emirates

Post by ar_shriks »

Thanks. But when you create the query by clicking on the 'Build' command button and selecting the table name, the displayed table name in the 'Selected tables' list is read only and in the format schemaname.table_name. Is it possible to list the table name without the schema name so that my SELECT command will look like :

SELECT FIELD1, FIELD2 FROM TABLE_NAME;
instead of
SELECT FIELD1, FIELD2 FROM schema_name.TABLE_NAME;

I am aware that I can copy the generated SQL Query and modify it by changing the Query Type to "User Defined Query". I am just probing the option of leaving the query as a "Fully generated SQL Query", but take care of schema name changes when running the job in production environment.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yuck... Fully Generated. You don't need to switch to User Defined, but to the other generation option, whatever it is called in your version (the name changed): 'Column Generated' or the ever so long 'Generate SELECT list clause from column list; enter other clauses'. You'll be fine there using the parameter as noted.

Me, I personally wouldn't touch Fully Generated (now known as 'Use SQL Builder Tool') with 39 and a half foot pole. :P
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply