Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 Null handling in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: DB2 Null handling in COBOL
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    Post subject:
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    Post subject: Re: DB2 Null handling in COBOL
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to display offset thru cobol prog... tvinodkumar7 CICS 2 Sun Apr 22, 2018 8:42 pm
No new posts Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts Handling result sets in the calling N... Rusikesh DB2 7 Fri Apr 13, 2018 12:25 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us