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

Missing fields in Cursor Query?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Thu Jun 07, 2007 6:24 pm
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
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

Moderator Emeritus


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

PostPosted: Thu Jun 07, 2007 7:15 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top