View previous topic :: View next topic
|
Author |
Message |
suganthyprabha
New User
Joined: 28 Jul 2005 Posts: 58
|
|
|
|
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 |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
sathish_rathinam
New User
Joined: 22 Aug 2005 Posts: 59 Location: india
|
|
|
|
hi khamarutheen,
while inserting we should checkout for -803 sql error..which is called unique index violation....
regards,
sathish |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
suganthyprabha
New User
Joined: 28 Jul 2005 Posts: 58
|
|
|
|
Hi friends,
Thanks for ur answers.
Thanks and Regards,
Suganthy. |
|
Back to top |
|
|
|