View previous topic :: View next topic |
Author |
Message |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Tue Apr 28, 2009 10:38 am Post subject: Static SQL in PL1 |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Apr 28, 2009 10:42 am Post subject: |
|
|
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 |
|
 |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Tue Apr 28, 2009 11:29 am Post subject: |
|
|
Yes, in this case it is a constant. Thanks. |
|
Back to top |
|
 |
|
|