Save SQL commands in a CL?

145 pts.
Tags:
AS400 iseries
SQL commands
How can I save SQL Commands in a CL?
ASKED: February 7, 2014  10:25 PM
UPDATED: February 11, 2014  2:21 PM

Answer Wiki

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

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
  • CharlieBrowne

    If you put your SQL statements in a source member, then you can use RUNSQLSTM to execute the SQL command.

    I create a QSQLSRC file and put the SQL commands in members in that file. You can put multiple SQL commands in a single member if you add a semi-colon ;  at the end of the statement before the next statement.

    Here is a sample source member:

    UPDATE F$ACTCCOUT A SET MNGRID =                             
      (SELECT B.U$EMP# FROM U$DOMDIR B                           
    WHERE A.M$FIRST = B.U$FIRST AND A.M$LAST = B.U$LAST);        
                                                                 
    UPDATE F$ACTCCOUT A SET M$EMAIL =                            
      (SELECT B.U$EMAIL FROM U$DOMDIR B                          
     WHERE A.MNGRID = B.U$EMP#);                                 


    39,815 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