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
 
Missing fields in Cursor Query?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
maverick05

New User


Joined: 14 Apr 2005
Posts: 54
Location: Earth

PostPosted: Thu Jun 07, 2007 1:05 pm    Post subject: Missing fields in Cursor Query?
Reply with quote

Hi,

I have a field x as the last field in my copybook.Can i declare the cursor including this field and can i miss this field x in the fetch query?

After fetching iam inserting the fetched row (after some formatting) into the database.Remember all the fields are populated and inserted to database except field X.

I didn't get any error when compiled my Db2-cobol program.But i feel there is a chance that junk value might be updated in datatbase although we didn't touch this field.

Please provide your suggestions
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 07, 2007 6:24 pm    Post subject:
Reply with quote

Hello,

Maybe it is just terminology, but i do not understand how you can insert a row you just fetched icon_confused.gif If you fetched it, it was previously inserted and cannot be re-inserted.

If you clarify your request, we may be able to offer suggestions.
Back to top
View user's profile Send private message
maverick05

New User


Joined: 14 Apr 2005
Posts: 54
Location: Earth

PostPosted: Thu Jun 07, 2007 6:46 pm    Post subject: Re: Missing fields in Cursor Query?
Reply with quote

After formatting of the fetched row,i am inserting it.I had mentioned this already in the brackets
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 07, 2007 7:15 pm    Post subject:
Reply with quote

Hello,

The way you have worded your process is misleading (at least). Yes, i saw what you put in brackets.

To repeat, if a row has been fetched it cannot be inserted. It is already in the table.

If you believe you can insert an existing row, please explain how this might happen. If you mean something else, please clarify.

Keep in mind that you clearly know what you mean, but it is not clear to others who read your info.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Fri Jun 08, 2007 12:45 pm    Post subject:
Reply with quote

You can always use column names while inserting values into the table why do you need to insert the value for field x. I hope you know the syntax which goes something like INSERT COLUMN NAME/S VALUES(...) INTO TABLE NAME
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 query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 0 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 3 Tue Nov 07, 2017 8:34 pm
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts Query on XMITIP abdulrafi All Other Mainframe Topics 1 Wed Oct 25, 2017 6:54 pm

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