Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prepare Execute is not doing anything but no error message

Status
Not open for further replies.

Db2curiosity

Programmer
Apr 14, 2005
15
US
Hi,
We are encountering a strange situation which using PREPARE and then EXECUTE for a dynamic INSERT statement.

The Stored proc is not returning any error but the insert is not happening. We tried running the INSERT statement outside and its doing fine ..

do you have any idea why the thing is behaving in this wierd way ?

Thanks
 
Is the file under commitment control ?
What is the platform the program is running in ?
 
The Program is running on UNIX.

Which file you are asking about ? Please clarify a little so that i can amswer.

Here we are building a sql string ( basically INSERT statement ) dynamically within a CURSOR loop ,storing that within a local variable say v_sql_string within the loop itself...

and then doing the following with the Loop only:-

PREPARE PRP from v_sql_string;
EXECUTE PRP;
GET DIAGNOSTICS i = ROW_COUNT;
etc..etc...

But either the above PREPARE and/or EXECUTE is not working
since the INSERT is not actually inserting and Rowcount is 0

But while i take 1 insert statement and try to do the Insert from outside like QUEST / DB2 consol its doing the insert pefectly and ROWCOUNT is 15
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top