sql from file in DB2/UDB API
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 60
- Joined: Sun Nov 21, 2004 2:24 am
sql from file in DB2/UDB API
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
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
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What, getting data out of a DB2 table using OCI stage?? I'd like to see that!
I need to do some research before providing a more serious response to the original question.
![Twisted Evil :twisted:](./images/smilies/icon_twisted.gif)
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 60
- Joined: Sun Nov 21, 2004 2:24 am
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.
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.
ray.wurlod wrote:What, getting data out of a DB2 table using OCI stage?? I'd like to see that!![]()
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
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
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 60
- Joined: Sun Nov 21, 2004 2:24 am
-
- Participant
- Posts: 6
- Joined: Mon May 17, 2004 10:23 am
Re: sql from file in DB2/UDB API
This is real old, but I thought I would post a solution in case it helps someone else
The correct syntax is:legendkiller wrote: 3) given path name as Z:\Sandeep\Query.txt
Code: Select all
{FILE}=Z:\Sandeep\Query.txt