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

Sql error -204 from dynamic sql of sub program


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

New User


Joined: 07 Oct 2008
Posts: 23
Location: Chennai

PostPosted: Thu Dec 09, 2010 2:16 pm
Reply with quote

Hi,

Am getting -204 with sqlstate 42704 from a prepare statemnt of a dynamic query from a subprogram that is called by a stored procedure.

The same subprogram has normal query(non dynamic) using other tables before this dynamic query and that has went successfull.

The error states that <myuserid.tablename> is an undefined object. Instead of myuserid, qualifier of the table should have be used by the program.

This subprogram is in production for a long time. And i have to pass correct qualifer to this query.

I have created a package with the owner as correct qualifier and tried, this doesnt solve the problem. I was wondering how the first query passed without any error.

Could anyone please help me in resolving this issue.

Thanks.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Dec 09, 2010 4:41 pm
Reply with quote

use DYNAMICRULES(BIND) instead of DYNAMICRULE(RUN)


Quote:
The BIND or REBIND option DYNAMICRULES determines what values apply at run time for the following dynamic SQL attributes:
•The authorization ID that is used to check authorization
•The qualifier that is used for unqualified objects
...


publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.apsg/db2z_dynamicrulesbindoption.htm
Back to top
View user's profile Send private message
erhema

New User


Joined: 07 Oct 2008
Posts: 23
Location: Chennai

PostPosted: Thu Dec 09, 2010 4:56 pm
Reply with quote

Thanks, i used dynamicrules(bind) option for my package creation. Still am getting the same error(-204).
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Dec 09, 2010 5:34 pm
Reply with quote

erhema wrote:
Thanks, i used dynamicrules(bind) option for my package creation. Still am getting the same error(-204).

package of subprogram or package of main program ? I would try both.

also try using set current sqlid in subprogram
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 API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top