| View previous topic :: View next topic |
| Author |
Message |
somu123 Beginner

Joined: 20 Sep 2005 Posts: 4 Topics: 1
|
Posted: Fri Oct 07, 2005 8:23 am Post subject: Interview Questions |
|
|
Hi,
In a recent interview some questions were asked which i could not answer.These are the q's.
1.Can we declare a cursor in DB2 in data division section instead of procedure division and what will be the programming structure for it
2.If I have some employees in a DB2 table and I put a query as follows and what will be the result
select * from emp where one=one
select * from emp where 1=1
3.what are the different ways of passing parms to programs.One I knew is thru the PARM parameter in the job and using the linkage section in the program.But they were expecting something else which I dont know.
4.In DB2,I have a DCLGEN,then I remove that declaration stmt from the program and can i use a copy book instead of a DCLGEN.???
Any idea on these ? Thanks for the responses. _________________ Thanks,
somu123 |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12388 Topics: 75 Location: San Jose
|
Posted: Fri Oct 07, 2005 9:02 am Post subject: |
|
|
somu123,
| Quote: |
1.Can we declare a cursor in DB2 in data division section instead of procedure division and what will be the programming structure for it
|
You can define the cursor wherever you want. Just make sure that you defined the any of host variables fields used in the cursor declaration. Also make sure the Table declaration is included/copied before the cursor declaration.
| Quote: |
2.If I have some employees in a DB2 table and I put a query as follows and what will be the result
select * from emp where one=one
select * from emp where 1=1
|
First query will fail with column not found(-206) as "one" is not a part of the table.
second query will run fine.
| Quote: |
3.what are the different ways of passing parms to programs.One I knew is thru the PARM parameter in the job and using the linkage section in the program.But they were expecting something else which I dont know.
|
search the application program forum and JCL forum for "parm" and you will find many topics which discuss this.
| Quote: |
4.In DB2,I have a DCLGEN,then I remove that declaration stmt from the program and can i use a copy book instead of a DCLGEN.???
|
Yes you can.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
somu123 Beginner

Joined: 20 Sep 2005 Posts: 4 Topics: 1
|
Posted: Fri Oct 07, 2005 9:25 am Post subject: |
|
|
Thanks Kolusu. _________________ Thanks,
somu123 |
|
| Back to top |
|
 |
|
|
|