Iseries CL cmd RUNSQLSTM

0 pts.
Tags:
AS/400
DataCenter
Anyone know of a way to pass variables to an SQL statement that is executed via the RUNSQLSTM cmd from within an CL program?
ASKED: April 20, 2005  10:35 AM
UPDATED: May 18, 2011  7:04 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I have make a tool that solve the problem of variables in RUNSQLSTM. You can find it at http://jplamontre.free.fr/AS400/EXECSQL.htm

usage sample :
1) put in a source member the sql

delete from &target/custom where company = ‘&cmp’
runsql titre

2) execute it

execsql … ((target TheLib) (cmp 6))

The tool is in text format (1 cmd, 1 clp, 1 rpgle). If you have difficulties to copy the code to the as, look at the samples at http://jplamontre.free.fr/AS400/TrucAstuceAs400.htm#Copie%20de%20code (sorry, comments are only in french, but command samples are in AS400)

Send me back comments on using my web pages, I never need to use my tolls from my web pa

===========================================================

You can’t pass parameters to RUNSQLSTM. Period.

If you need parameters passed into an SQL statement, use STRQMQRY instead of RUNSQLSTM.

Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • JPLamontre
    I have make a tool that solve the problem of variables in RUNSQLSTM. You can find it at http://jplamontre.free.fr/AS400/EXECSQL.htm usage sample : 1) put in a source member the sql delete from &target/custom where company = '&cmp' runsql titre 2) execute it execsql ... ((target TheLib) (cmp 6)) The tool is in text format (1 cmd, 1 clp, 1 rpgle). If you have difficulties to copy the code to the as, look at the samples at http://jplamontre.free.fr/AS400/TrucAstuceAs400.htm#Copie%20de%20code (sorry, comments are only in french, but command samples are in AS400) Send me back comments on using my web pages, I never need to use my tolls from my web pa
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following