Page 1 of 1

sql from file in DB2/UDB API

Posted: Wed Jun 06, 2007 5:13 am
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

Posted: Wed Jun 06, 2007 6:12 am
by chulett
Any particular error?

Posted: Wed Jun 06, 2007 7:44 am
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".

:(

Posted: Wed Jun 06, 2007 8:28 am
by chulett
Works fine from the OCI stages from what I recall. Not something I do very often (hardly ever) but have done it.

Posted: Wed Jun 06, 2007 8:43 pm
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.

Posted: Thu Jun 07, 2007 3:12 am
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.

Posted: Thu Jun 07, 2007 7:04 am
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.

Posted: Thu Jun 14, 2007 7:10 am
by legendkiller
Anybody having any update on that

Posted: Thu Jun 14, 2007 7:12 am
by chulett
Have you... contacted your Support provider?

Re: sql from file in DB2/UDB API

Posted: Tue Aug 03, 2010 10:15 am
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

Posted: Tue Aug 03, 2010 10:27 am
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: