|
View previous topic :: View next topic
|
| Author |
Message |
bhagyac
New User

Joined: 17 Apr 2008 Posts: 44 Location: bangalore
|
|
|
|
Hi All,
I want to execute an SQL using REXX and to write the result in a dataset. Please help.
Thank you. |
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
| For what database? |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
| OK! get started and if You face problems someone will be glad to give suggestions |
|
| Back to top |
|
 |
ofer71
Global Moderator

Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Have you tried the fine manual first?
O. |
|
| Back to top |
|
 |
bhagyac
New User

Joined: 17 Apr 2008 Posts: 44 Location: bangalore
|
|
|
|
| Want to Know the Rexx command to execute a DB2 query. |
|
| Back to top |
|
 |
ofer71
Global Moderator

Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
That was easy one: ADDRESS DSNREXX EXECSQL...
O. |
|
| Back to top |
|
 |
bhagyac
New User

Joined: 17 Apr 2008 Posts: 44 Location: bangalore
|
|
|
|
I tried using the below code..
| Code: |
/* REXX */
SQLSTMT1 = 'SELECT * FROM DBQL.EMPTAB WHERE EMPNO = '1234''
ADDRESS DSNREXX EXECSQL SQLSTMT1
|
and got the error as
3 *-* ADDRESS DSNREXX EXECSQL SQLSTMT1
+++ RC(-3) +++
|
|
| Back to top |
|
 |
ofer71
Global Moderator

Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
and now would be a great time to take a look at the fine manual...
O. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
| Back to top |
|
 |
|
|