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
 

 

Wanted to whether SQL query can be build in Sub program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
arunbai6

New User


Joined: 28 Oct 2014
Posts: 1
Location: USA

PostPosted: Fri Oct 31, 2014 5:43 am    Post subject: Wanted to whether SQL query can be build in Sub program
Reply with quote

Hi All,

Is there any way i can build the sql query in a subprogram by passing parms from the main program. also execute the query in the sub pgm and return the value back to the main pgm. for Direct query like

SELECT COL1, COL2, COL3
FROM TAB_X
WHERE COL1 = :hvar
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Sun Nov 02, 2014 7:04 pm    Post subject:
Reply with quote

Hello and welcome to the Forum.

Exactly which part of the query is to be dynamically built ?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1696
Location: NY,USA

PostPosted: Mon Nov 03, 2014 9:00 am    Post subject:
Reply with quote

Create a table which contains 2 columns viz 1. Unquie integer number and other column corresponds to the SQL query. So now pass the parm to this sub program and query against this new table and gives these parms values against the first column and get the corresponding SQL and string it form a dynamic query.
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 IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am


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