MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Static SQL in PL1

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Apr 28, 2009 10:38 am    Post subject: Static SQL in PL1 Reply with quote

I use host variables in PL1 program for Static SQL:
Code:

  Update table
   set COL1 = :VAL1, STATUS = :STATUS
   WHERE COL3 = VAL3

Someone told me it doesn't matter if the value is a contant (e.g. STATUS is always 'S'):
Code:

  Update table
   set COL1 = :VAL1, STATUS = 'S'
   WHERE COL3 = VAL3

Is it true?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Apr 28, 2009 10:42 am    Post subject: Reply with quote

danm,

Did you assume that you always need host variables? You can have constants. The flexibility of using the host variables is to pass dynamic values. If you think the value does not change then use hard coded values.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Apr 28, 2009 11:29 am    Post subject: Reply with quote

Yes, in this case it is a constant. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group