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
 

 

Which of the following statements correctly describe?

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

New User


Joined: 16 Sep 2005
Posts: 6

PostPosted: Mon Sep 19, 2005 10:14 pm    Post subject: Which of the following statements correctly describe?
Reply with quote

EXEC SQL INSERT INTO T1 (C1, C2, C3, C4, C5) VALUES
(:HV1, :HV2, :HV3, :HV4, :HV5) END-EXEC.

Which of the following statements correctly describe what happens when the above statement is executed in PGM1?

A. The statement will succeed if each of the columns is defined as NOT NULL
WITH DEFAULT.

B. If an SQLCODE -803 is encountered, an update statement can be issued to modify the non-key columns of T1.

C. PGM1 will automatically be rolled back if the values for HV1 and HV2
already exist.

D. The statement will fail because only 5 of the 6 columns are specified.

E. The statement will return an SQLCODE -104.
Back to top
View user's profile Send private message

ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Thu Sep 22, 2005 8:28 pm    Post subject: Re: Which of the following statements correctly describe?
Reply with quote

i think it could be option B.
Back to top
View user's profile Send private message
reshma

New User


Joined: 10 Sep 2005
Posts: 9
Location: software engineer

PostPosted: Fri Sep 23, 2005 10:39 am    Post subject: Re: Which of the following statements correctly describe?
Reply with quote

i think option A is correct.option with -104 code is irrelevant.
Back to top
View user's profile Send private message
sandeep4u

New User


Joined: 12 Aug 2005
Posts: 32

PostPosted: Fri Sep 23, 2005 11:09 am    Post subject: Re: Which of the following statements correctly describe?
Reply with quote

Hi,

answer is option A.........
Back to top
View user's profile Send private message
ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Fri Sep 23, 2005 4:08 pm    Post subject: Re: Which of the following statements correctly describe?
Reply with quote

It is not necessary to have all the columns defined with "NOT NULL WITH DEFAULT" option. just "NOT NULL" is enough to execute as all the 5 columns are specified in VALUE clause.
If there are any other columns other than the 5 mentioned then only you need "WITH DEFAULT" option.
that is why i have chosen the answer B.

Please let me know if i am wrong...
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Fri Sep 23, 2005 8:57 pm    Post subject:
Reply with quote

Hi CIS777!

For a moment forget about OPTION A.

Option B says " If an SQLCODE -803 is encountered, an update statement can be issued to modify the non-key columns of T1. "

-803 error occurs if any duplicate row is found. we should issue a update statement to modify KEY-COLUMNS (Not Non-Key columns) of T1 table. So this option is ruled out.

Option C says "PGM1 will automatically be rolled back if the values for HV1 and HV2 already exist. "

We dont know what are the key columns and we are not sure how the program is handling SQL abends for the given query. So we can't judge by this statement. So this is ruled out.

Option D says "The statement will fail because only 5 of the 6 columns are specified. "

we are not sure for this statement too as they didn't mention the number of columns here. Who knows the 6th column may allow nulls too. So this option is also ruled out.

Option E says "The statement will return an SQLCODE -104"

The given SQL statement is fine. So this too ruled outttttttt


Now the left over is option A. There is no harm if we code not null with Default. So guys, Option A is correct. icon_biggrin.gif

HTH,
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 Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts Extracting Information from DD Statem... Charles Wolters All Other Mainframe Topics 7 Wed Apr 13, 2016 10:21 pm
No new posts Parsing JCL SET var=value statements prino CLIST & REXX 0 Sat Dec 26, 2015 4:41 am
No new posts DFSORT control statements in any order ? ronald masters DFSORT/ICETOOL 2 Tue Dec 15, 2015 11:22 pm
No new posts Any example of XML GENERATE nested st... marianambot COBOL Programming 6 Tue Sep 22, 2015 7:48 pm


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