Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us