Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sql error -204 from dynamic sql of sub program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Sql error -204 from dynamic sql of sub program
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: 1280
Location: Belgium

PostPosted: Thu Dec 09, 2010 4:41 pm    Post subject:
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
...


http://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    Post subject: Reply to: Sql error -204 from dynamic sql of sub program
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: 1280
Location: Belgium

PostPosted: Thu Dec 09, 2010 5:34 pm    Post subject: Re: Reply to: Sql error -204 from dynamic sql of sub program
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us