IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 Interview Questions:


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suganthyprabha

New User


Joined: 28 Jul 2005
Posts: 58

PostPosted: Fri Dec 16, 2005 11:43 am
Reply with quote

Hi friends,

1. What all are the 2 ways to find out the Primary key Column in DB2?

2. While fetching the Records we are coding like

IF Sqlcode is not = +100

Exec sql Fecth C1 into :Rec End-exec.

Likewise While Inserting what is the Sqlcode will u check which is mandatory.

Thanks and Regards,
Suganthy.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Fri Dec 16, 2005 12:00 pm
Reply with quote

Hi suganthy,

Quote:
1. What all are the 2 ways to find out the Primary key Column in DB2?

Once the table is described then v can find out the primary key column,,
ie., viewing sysibm.systable like that...

Quote:

While Inserting what is the Sqlcode will u check which is mandatory


As v will b using more records to fetch using curson v r in need to use the sqlcode.. but i dont think such a statement is mandatory in inserting...
Back to top
View user's profile Send private message
sathish_rathinam

New User


Joined: 22 Aug 2005
Posts: 59
Location: india

PostPosted: Fri Dec 16, 2005 2:49 pm
Reply with quote

hi khamarutheen,

while inserting we should checkout for -803 sql error..which is called unique index violation....

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

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Fri Dec 16, 2005 3:15 pm
Reply with quote

Hi sathish,
Fine.. thank u for directing me... but many thing like -817,-803 occurs once the insert is done only b4 insert there is nothing to get checked.. i think so... any way thanks for ur solution
Back to top
View user's profile Send private message
suganthyprabha

New User


Joined: 28 Jul 2005
Posts: 58

PostPosted: Tue Dec 20, 2005 12:03 pm
Reply with quote

Hi friends,

Thanks for ur answers.

Thanks and Regards,
Suganthy.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Comp interview questions Mainframe Interview Questions 5
No new posts Interview Questions on Cobol DB2 program Mainframe Interview Questions 5
No new posts The Last Two Question For You To Ask ... Mainframe Interview Questions 0
No new posts Mainframe Interview Questions CICS,CO... Mainframe Interview Questions 6
No new posts Viewing executing process in NDM .. q... IBM Tools 0
Search our Forums:

Back to Top