sql from file in DB2/UDB API

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
legendkiller
Participant
Posts: 60
Joined: Sun Nov 21, 2004 2:24 am

sql from file in DB2/UDB API

Post by legendkiller »

hi All
I am new to server environment. I am using DB2/UDB API and trying to see data of table by sql query present in file. For that I have did following things

1) Set Outputpage - General tab to Load SQL from file at run time
2) Set Outputpage - SQL query to Load SQL from file at run time
3) given path name as Z:\Sandeep\Query.txt

The query in above file look like
select 'Name' as "sandeep" from SYSIBM.SYSDUMMY1

then when I tried to view data It has given me error.
Is anything extra needs to be done
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Any particular error?
-craig

"You can never have too many knives" -- Logan Nine Fingers
asitagrawal
Premium Member
Premium Member
Posts: 273
Joined: Wed Oct 18, 2006 12:20 pm
Location: Porto

Post by asitagrawal »

Hi Killer,

As far as I know and have tried, in server edition,
we cannot use the functionality of "load SQL from file".

:(
Share to Learn, and Learn to Share.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Works fine from the OCI stages from what I recall. Not something I do very often (hardly ever) but have done it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What, getting data out of a DB2 table using OCI stage?? I'd like to see that! :twisted:

I need to do some research before providing a more serious response to the original question.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
legendkiller
Participant
Posts: 60
Joined: Sun Nov 21, 2004 2:24 am

Post by legendkiller »

I am getting following error....

test_Sql_from_file..DB2_Read_Source_Row_Count: [IBM][CLI Driver][DB2/NT] SQL0007N The character "\" following "E:" is not valid. SQLSTATE=42601

SQLExecDirect: Error executing statement 'E:\Dump\Sandeep\Query.txt
'. See following DB2 message for details.
test_Sql_from_file..DB2_Read_Source_Row_Count.DSLink1: DSP.Open GCI $DSP.Open error -100.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ray.wurlod wrote:What, getting data out of a DB2 table using OCI stage?? I'd like to see that! :twisted:
:roll: Puh-leeze. Just mentioning that it does work in the OCI stage, therefor there is a reasonable expectation that it should work as well in the DB2 stage.

Of course, maybe it just be broke there. It looks like it is not resolving the pathname but instead trying to run it as the sql statement. Probably should contact your Support provider, see if it is a known issue or bug or if something else is going on.
-craig

"You can never have too many knives" -- Logan Nine Fingers
legendkiller
Participant
Posts: 60
Joined: Sun Nov 21, 2004 2:24 am

Post by legendkiller »

Anybody having any update on that
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Have you... contacted your Support provider?
-craig

"You can never have too many knives" -- Logan Nine Fingers
BrianAtWork
Participant
Posts: 6
Joined: Mon May 17, 2004 10:23 am

Re: sql from file in DB2/UDB API

Post by BrianAtWork »

This is real old, but I thought I would post a solution in case it helps someone else
legendkiller wrote: 3) given path name as Z:\Sandeep\Query.txt
The correct syntax is:

Code: Select all

{FILE}=Z:\Sandeep\Query.txt
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

True... in the intervening years we've figured that out but haven't gone back and tried to back-fill things. Thanks for that. :wink:
-craig

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