Save SQL commands in a CL?

145 pts.
Tags:
AS400 iseries
SQL commands
How can I save SQL Commands in a CL?

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.

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.
  • 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#);                                 


    51,140 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.

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

Following

Share this item with your network: