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

Checking the Updated value in a table


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

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Fri Dec 04, 2009 12:53 pm
Reply with quote

Hi,
i have a requirement to update a particular valuein a tbale.

First i have retrieved the values from the table

Code:

      SELECT  A_1,B_1,B_2,B_3
         
        INTO
             :A-1,:B-1 :NULL,:B-2 :NULL1,:B-3 :NULL2
 
    FROM TABLE A
    WHERE A= :A
               B = :B


where the b_1 b_2 b_3 are null defined

base on the condition

Code:


   IF NULL <0 and
       NULL1 < 0 and
        NULL2 < 0
      MOVE CURRENT DATE  TO   hold-var
   ELSE
      CONTINUE
   END-IF.
       



earlier the value picked up from the A_1 has default date 0001-01-01

now i have to update the value

Code:

    UPDATE TABLE A
          SET A_1 = :HOLD-VAR
             
          WHERE B_1 = :B-1
       
     


NOW im evaluating the hosst variable
A-1
it still has the value 0001-01-01 while i have updated just before this

can u help me out like the host variable does hold the value of previous fetch or the updated value because here after updation of A_1 im not fetching the value from the table.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Fri Dec 04, 2009 1:17 pm
Reply with quote

It obviously holds the value from previous fetch (or any other value if it is modified in the program).
Cobol and DB2 are two different things and only a query can connect them both.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts count contained values of several col... DB2 5
No new posts To join 2 tables and to join 3rd tabl... DB2 8
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts Extract ISPF table column headings CLIST & REXX 2
No new posts Unload and Load ISPF Table TSO/ISPF 4
Search our Forums:


Back to Top