View previous topic :: View next topic
|
Author |
Message |
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Hi All,
I have a query to update a row in a table.
UPDATE EMPL_TBL EMP
SET EMP.PERMENANT_IND = 'Y'
WHERE EMP.EMP_ID = :EMP-EMP-ID
AND EMP.EMP_NAME = :EMP-NAME
AND EMP.CITY = :EMP-CITY
Now I have to update permanent flag for an employee with id as 1 and name 'peter ' and city as null,
Could any one let me know will it be possible to do this using null indicator var with EMP-CITY variable while embedding this query in COBOL.
Thanks,
Prajesh |
|
Back to top |
|
|
anamikak
New User
Joined: 10 May 2006 Posts: 64 Location: Singapore
|
|
|
|
It should be possible to do this using null indicators; before update statement Move -1 to the appropriate null indicator and then when you issue the SQL update use EMPCITY= :EMP-CITY:null-ind-varaiable. Try this out, it should be fine.
The other method ofcourse without using the null varaiable is to issue sql update with EMPCITY=NULL. |
|
Back to top |
|
|
HARIBHARAT
New User
Joined: 05 Jul 2006 Posts: 65 Location: pune
|
|
|
|
Db2 we have null indicator , which field u want to set null, that field field u pass the value -1 . Then update query.
Regards
suresh |
|
Back to top |
|
|
|