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
 

 

Is it possible to code a direct sql update query in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
jonnavarapu786

New User


Joined: 28 Mar 2007
Posts: 2
Location: noida

PostPosted: Mon May 07, 2007 2:29 pm    Post subject: Is it possible to code a direct sql update query in COBOL
Reply with quote

First one.

Suppose, my embeded sql is fetching two rows.(Iam not using cursors).
I will get -811 sql error, my question is what value will come to host variables.
ex: SELECT ename INTO : HV_ename FROM emp WHERE sal = 5000;

Second one,

suppose, in a update/insert SQL query for vachar field, I given/moved length = 10, text = 20 chars. what will happen while updating/inserting.
is only 10 chars of the text is updated/inserted or 20 chars of the text.
plz clarify ........

Third one.

Is it possible to code a direct sql update query in COBOL- DB2 pgm.
ex: update emp_table set sal = 6000 where sal = 5000;

Eagarly waiting for ur valuble correct answers......
Back to top
View user's profile Send private message

UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Mon May 07, 2007 2:45 pm    Post subject:
Reply with quote

Hi jonnavarapu786 !

First :
Nothing is inserted into your host-variables, they aren't changed

Second:
10 bytes, correct me if i'm wrong

Third:
Yes

Regards, UmeySan
Back to top
View user's profile Send private message
pyar
Warnings : 1

New User


Joined: 15 May 2006
Posts: 4

PostPosted: Thu May 10, 2007 3:26 pm    Post subject: Re: Is it possible to code a direct sql update query in COBO
Reply with quote

Hi,

1st row values will be there with host variables,
while retriving the 2nd row only you will get -811

Correct me if i am worng

Thanks,
Pyari
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Thu May 10, 2007 4:26 pm    Post subject:
Reply with quote

Hi,

1st

When your query results in more than 1 row then the program abends with -811 without any values in Host variable.

If you have given as ignore -811 condition then you will get the first row.

2nd

As far as i know it will update the 20 chars (updating 10 char with ur input and rest with spaces).

3rd

Question is confusion for me.

Do you intend with using any host variables, if so you can.

Cheers
Ashwin
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
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
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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