HI,
Can we code DB2 queries using rexx? How can we do that? Can you please provide an example and or share some links to learn them.
DB2 queries using rexx.
Moderator: mickeydusaor
- Akatsukami
- Global Moderator
- Posts: 122
- Joined: Tue Oct 20, 2015 3:20 am
- Location: Bloomington, IL
- Contact:
Re: DB2 queries using rexx.
Certainly.Om Shah wrote:HI,Can we code DB2 queries using rexx?
By establishing a DB2 environment via RXSUBCOM (most shops use the IBM-supplied DSNREXX command processor; mine, however, uses Open Software's RXTASQL). Then, you can use embedded or dynamic SQL as with any other language.How can we do that?
See here.Can you please provide an example and or share some links to learn them.
"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli
Re: DB2 queries using rexx.
Please do your reserch BEFORE posting. Many examples and references over the Internet and, as Akatsukami has pointed out, in the DB2 manuals themselves - which you, obviously, did not consult.
Regards
Nic
Nic
Re: DB2 queries using rexx.
Thanks Akatsukami. I have searched more and got this sample program which was very useful to me:
This link http://publib.boulder.ibm.com/cgi-bin/b ... 0209162045 had been very useful too.
Code: Select all
"SUBCOM DSNREXX"
IF RC=0 THEN
SAY 'DSNREXX IS AVAILABLE'
ELSE
DO
SAY 'DSNREXX IS NOT AVAILABLE'
SAY 'SUBCOM RC :' RC
END
IF RC THEN
DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
SAY 'ADDING DSNREXX....................'
PULL X
END
SQLSTMT = "SELECT COUNT(*) FROM DB0*****.****** "
ADDRESS DSNREXX
"CONNECT DB2E"
"EXECSQL DECLARE C1 CURSOR FOR S1"
"EXECSQL PREPARE S1 INTO :OUTSQLDA FROM :SQLSTMT"
"EXECSQL OPEN C1"
"EXECSQL FETCH C1 USING DESCRIPTOR :OUTSQLDA"
DO I = 1 TO OUTSQLDA.SQLD
LINE = OUTSQLDA.I.SQLDATA
END
SAY LINE
"EXECSQL EXECUTE S1 USING DESCRIPTOR :OUTSQLDA"
Re: DB2 queries using rexx.
This pdf was also very useful:
You do not have the required permissions to view the files attached to this post.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute