IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

-204 when executing Dynamic SQL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Thu Oct 07, 2010 11:05 pm
Reply with quote

I am trying to create and Run a Dynamic SQL , i will be getting my table and column names only during run time , i have used PREPARE SQL to create the dynamic SQL.

But the problem is its assosistaing my TSO id to the table name instead of the Schema

example its searching for TSOXXX.TABLE NAME and failing in -204.


Please advice if there is any special compilation option to be specified for Dynamic SQLs .

Am using ChangeMan to compile and Promote the code , am new to CHangeman and dynamic Sql , awaiting help


Thanks in Advance
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Oct 08, 2010 2:39 am
Reply with quote

Vishu,

By default, its taking your TSO ID.

It can be changed by using,
1. SET CURRENT SQLID
or
1. Giving QUALIFIER in the bind statement.


Sushanth
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Fri Oct 08, 2010 10:17 am
Reply with quote

Sushanth ,

Thanks for the response , i am not aware of the SET CURRENT SQLID optin, i will give it a try and let you know.


For the second option , yes i am already specyfying the Qualifier in the Bind , but its still not picking up the table , if i use a static SQL its working fine , but when the query is dynamci it fails .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
No new posts executing XCTL command in COBOL witho... CICS 10
No new posts Receiving RC 5 when executing REXX pr... CLIST & REXX 3
Search our Forums:

Back to Top