IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 Null handling in COBOL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 02, 2006 11:07 am
Reply with quote

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
View user's profile Send private message
anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Wed Aug 02, 2006 11:37 am
Reply with quote

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
View user's profile Send private message
HARIBHARAT

New User


Joined: 05 Jul 2006
Posts: 65
Location: pune

PostPosted: Wed Aug 02, 2006 1:12 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top