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
 

 

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 Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am


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