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
 

 

Interview questions in SQL

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

New User


Joined: 13 Jun 2005
Posts: 24

PostPosted: Thu Nov 17, 2005 1:31 am    Post subject: Interview questions in SQL
Reply with quote

HI,
1.I'M DECLARING A CURSOR AND OPENED IT IN A MAIN PGM.THEN I'M CALLING THE SUB PGM AND PERFORMING SELECT OPERATION.IS IT POSSIBLE.
2.I HAVE A EMBEDDED SQL PGM......IN THAT A MAINPGM IS CALLING 3 SUBPROGRAMS.EVERYTHINGZ FINE WITH THIS PROGRAM.NOW I'M MODIFYING 3RD PROGRAM.SO,INSTEAD OF BINDING PLAN AGAIN IT'LL B ENOUGH IF I BIND THE PARTICULAR PACKAGE.MY QUES IS HOW TO KNOW THAT PARTICULAR PACKAGE......
3.WHATZ THE ROLE OF COLLECTION ID IN EMBEDDED SQL PGM.

GUYZ ....DO LET ME KNOW THE ANSWER IF ANYONE OF KNOW....THANX IN ADVANCE FOR THE REPLIES......
Back to top
View user's profile Send private message

khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Wed Nov 23, 2005 10:40 am    Post subject: SQL
Reply with quote

Hi frnd,

1. Yes it is possible if u have declared the cursor in the sub program.

2. I can't understand ur question.. u can bind an individual plan in a package so ur query is vise versa. i don't know. a package can nerver b executed directly.

3. since the Package contains a location identifier, collection ID and a package Id. the collection id represents a logical grouping of package. so with the help of this it ties the package to the program to which it applies.
Back to top
View user's profile Send private message
reshma

New User


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

PostPosted: Wed Nov 23, 2005 10:55 am    Post subject: Re: Interview questions in SQL
Reply with quote

hi khamarutheen,

if u have declared WITHHOLD option with the cursor declaration ,there is no need to declare the cursor onceagain in the subprogram ,the cursor will remain opened when u return the nexttime after we perform tht select operation in the subprogram.

regards,
reshma
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Wed Nov 23, 2005 11:04 am    Post subject: Interview Questions
Reply with quote

Hi frnd,
Thank u reshma.
WITH HOLD Prevents the cursor from being closed as a consequence of a commit operation.
When WITH HOLD is specified, a commit operation commits all the changes in
the current unit of work, but releases only locks that are not required to
maintain the cursor.

EG:

EXEC SQL DECLARE C3 CURSOR WITH HOLD FOR
SELECT * FROM DSN8710.EMP
FOR UPDATE OF WORKDEPT, PHONENO, JOB, EDLEVEL, SALARY;

One more
If the stored procedure returns result sets, the cursors that are associated
with the result sets must have been defined as WITH HOLD to be usable
after the commit.
Back to top
View user's profile Send private message
shammiullah

New User


Joined: 13 Jun 2005
Posts: 24

PostPosted: Wed Nov 23, 2005 11:44 pm    Post subject: Re: Interview questions in SQL
Reply with quote

thank u khamartheen and reshma......i've got one more ques....

let me take an embedded sql pgm...i've precompiled it today.if i bind it tommorrow will it give any mismatch abend or it'll work fine...plz gimme the reason along with ur answer......
thanx
Back to top
View user's profile Send private message
k_vikram07

New User


Joined: 23 Nov 2005
Posts: 35

PostPosted: Thu Nov 24, 2005 12:14 am    Post subject:
Reply with quote

The bind and execution work well. No problems.

The reason:

When we precompile, it creates the timestamps in the dbrm and the modified code. And binding doesn't have anything to do with these timestamps. When we execute, the timestamp on dbrm and the timestamp from objmodule should match. Otherwise it is inconsistent code and so it gives the sql error.



Thanks
Vik.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Thu Nov 24, 2005 9:51 am    Post subject: interview question
Reply with quote

hi frnd,
As per k_vikram07 there will not be any error up to my knowledge. U may think b/w the timestamp. so as per vikram
Quote:

binding doesn't have anything to do with these timestamps


so dont worry..
Back to top
View user's profile Send private message
shammiullah

New User


Joined: 13 Jun 2005
Posts: 24

PostPosted: Thu Nov 24, 2005 10:27 pm    Post subject: Re: Interview questions in SQL
Reply with quote

thnk u very much for ur prompt reply..........
Back to top
View user's profile Send private message
shammiullah

New User


Joined: 13 Jun 2005
Posts: 24

PostPosted: Thu Nov 24, 2005 10:52 pm    Post subject:
Reply with quote

hi,
1. how to give db2 table as input file in jcl and what is the need of this?

2. what r the utilities used to take backup of db2 table,and replacing that backed up data in to a table and load a vsam file to db2 table.....
3.while taking backup of db2 table is it like back up shuld b taken only in to a flat file......


warm regards,
shammi....
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Mon Nov 28, 2005 11:35 am    Post subject: DB2 queries
Reply with quote

Hi frnd,

Quote:
1. how to give db2 table as input file in jcl and what is the need of this?

so here whether u r refering content or just the table name?? if u r refering content means then u can go for some prog logic to read the content of the table and write it into the file. So the need should be said by u only.. what's ur req? why u r going for this? should be said by u only.

Quote:
2. what r the utilities used to take backup of db2 table,and replacing that backed up data in to a table and load a vsam file to db2 table....

IMAGCOPY: To run the COPY, MERGECOPY, and QUIESCE utilities
against table spaces of the specified databases, and to run the MODIFY utility.

LOAD: To use the LOAD utility to load tables.

RECOVERDB: To use the RECOVER and REPORT utilities to recover
table spaces and indexes.

REORG: To use the REORG utility to reorganize table spaces and indexes.

REPAIR: To use the REPAIR and DIAGNOSE utilities.

Quote:
3.while taking backup of db2 table is it like back up shuld b taken only in to a flat file......

I don't think there it should be taken only into a flat file. v can take a backup into any device also...
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 Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts SAS Programming - Basic Questions Techelm All Other Mainframe Topics 3 Fri Mar 18, 2016 10:53 pm
No new posts Where can i find Interview questions ... Elixir Mainframe Interview Questions 4 Sat Feb 20, 2016 12:38 am


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