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: 1278
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: 1278
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm


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