This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Any sample working code or tutorial for dynamic sql in db2 procedures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Any sample working code or tutorial for dynamic sql in db2 procedures " Watch "Any sample working code or tutorial for dynamic sql in db2 procedures " New topic
Author

Any sample working code or tutorial for dynamic sql in db2 procedures

Biju moozhikkara
Greenhorn

Joined: Oct 21, 2005
Posts: 20
Hello,
Can any body provide me with Any sample working code or tutorial for dynamic sql in db2 procedures.

i need to change certain part of sql statment, like order by field dynamcally.

Regards
Biju M
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32636
    
216

Biju,
A quick google search found this example. Are you looking for something more specific?


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Biju moozhikkara
Greenhorn

Joined: Oct 21, 2005
Posts: 20
Hello Jeanne ,
Thanks for the link.But i was looking for dynamic sql embedded in db2 stored procedure. hope that is very much possible.

Regards
Biju M
Sagar Dafle
Greenhorn

Joined: Nov 06, 2012
Posts: 18
This is the SIMPLEST SP that i executed ..

CREATE PROCEDURE SP_SAMPLE()
DYNAMIC RESULT SETS 1
BEGIN
DECLARE c CURSOR WITH RETURN FOR
SELECT * FROM sagar123.emp;
OPEN c;
END
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Any sample working code or tutorial for dynamic sql in db2 procedures
 
It's not a secret anymore!