Database name included in SQL in ODBC stage

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
rdsarbo
Participant
Posts: 2
Joined: Wed Apr 06, 2005 3:07 pm
Contact:

Database name included in SQL in ODBC stage

Post by rdsarbo »

I imported the table definition for a SQL Server table. I use this table in an ODBC stage. When I look at the SQL, the columns are fully qualified and the SQL looks like this:
select "dbname.dbo.column1","dbname.dbo.column2" from
"dbname.dbo.table_name"

My database names are different in my dev, test, and prod environments. This looks like it will cause problems when I migrate.

What is my best approach to getting the SQL Server database name out of the SQL.

Thanx,

Rod
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

You can edit the Table Definition after it is imported.

John
rdsarbo
Participant
Posts: 2
Joined: Wed Apr 06, 2005 3:07 pm
Contact:

Post by rdsarbo »

Yes, I realize I can edit it but that's an additional step I'd like to avoid.
diamondabhi
Premium Member
Premium Member
Posts: 108
Joined: Sat Feb 05, 2005 6:52 pm
Location: US

Post by diamondabhi »

hi rdsarbo,
i had the same problem for which i used user defined environment variables as parameters and this works good .

thanks,
abhi.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Use plugins (such as OCI or OLE/DB) to avoid this problem.
cnguyen
Premium Member
Premium Member
Posts: 31
Joined: Fri May 14, 2004 9:27 am

Post by cnguyen »

diamondabhi wrote:hi rdsarbo,
i had the same problem for which i used user defined environment variables as parameters and this works good .

thanks,
abhi.
Anhi - Can you elaborate on the variables and what you did? We are facing the same problem. When importing table defs via ODBC, the entries are fully qualified and editing the entries takes too long.

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I used to have this problem. I used to delete the derivation column in the columns tab, of the DRS stage/ODBC stage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Two things can help here:

1) Don't use the 'fully qualified' option when you import the metadata, if available.

2) Don't use the 'Load' option to bring the metadata into the stage.

I realize #1 isn't possible with ODBC but some stages do offer that option. However, you should find that while 'Load' will bring in everything into the Derivation columns in a stage, dragging the metadata from the Repository Browser onto the connecting Link will not. That is the simplest way to solve this problem and keep your generated sql from being 'fully qualified'. Or go back to removing it from every column post load. :wink:
-craig

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