parameter in sql file

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
kayarsenal
Participant
Posts: 17
Joined: Mon Jan 16, 2006 2:11 pm
Contact:

parameter in sql file

Post by kayarsenal »

Hi,

Using the user-defined sql in Teradata API, and the oprtion
{FILE} (file path) instead of typing the SQL script directly into the user-defined sql tab in Teradata, would it be possible to parameterize the table path in sql script itself?

For example, I want to execute {FILE} /root/aaa.sql

In the aaa.sql script I have this:

Code: Select all

USING NUMBER(INTEGER),PLAYERNAME(CHAR(255))
INSERT INTO Clubs.Arsenal(Number, Playername) 
VALUES (:Number, :Playername);

INSERT INTO #p_clubs#.Arsenal(Number, Playername) 
VALUES (:Number, :Playername);
Clubs is been parameterized a #p_clubs# for example. I tried executing such statement, but it says path not found which means that it doesnt pick the path from the parameter.

Pls advise.

Rgds,
Kay
ARSENAL GUNNERS GOONER
shepli
Participant
Posts: 79
Joined: Fri Dec 17, 2004 9:56 am

Post by shepli »

Please try '#p_clubs#'. It should work for you.

shepli
shepli
Participant
Posts: 79
Joined: Fri Dec 17, 2004 9:56 am

Post by shepli »

Please try '#p_clubs#'. It should work for you.

shepli
r.julia
Participant
Posts: 23
Joined: Tue Jan 24, 2006 8:04 am

followup

Post by r.julia »

The approach doesnt work unfortunately :(
Anyway thanks
Datastage is pretty interesting
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? Wait... if you get a 'path not found' error then it can't even find your script - so questions about 'clubs' inside it are moot at this point. What exactly are you putting in the User-Defined SQL tab when you select the 'File' update action?

I don't recall that option needing any kind of extra keyword in the sql tab, unless the Teradata stage is different in that regard. If you literally put "{FILE} /root/aaa.sql" there try just "/root/aaa.sql".
-craig

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