Created on Sept. 3, 2021, 2:15 a.m. - by Ravi, Pasupuleti
I try to insert duplicate values got -803 sql error.even i inserted duplicates values we dont get -803 How?i.e we need continue
First, you should understand when we get -803
If you are trying to insert or update a row with primary key value which is already present in the table, Then you will get -803.
You are asking why you don't get -803. It is because you are primary key value is not unique that's why you don't get -803.
So if you want to get -803. Insert a row with primary key value which is already present in the table. If you don't have any primarily key field. Then set the primary key column on the table.
To find out all the indexes built on the DB2 table TAB1 we can use the DB2 system table SYSIBM.SYSINDEXES. The SYSINDEXES database has one row for every index present in DB2. We can find indexes built on a particular table using the below SQL query.
SELECT NAME, UNIQUERULE, CLUSTERING FROM SYSIBM.SYSINDEXES WHERE TBNAME=’TAB1’
The column UNIQUERULE in the SELECT statement returns ‘P’ for primary index and ‘U’ for alternate index. The CLUSTERING column will be returned as ‘YES’ for clustered index and ‘NO’ for non-clustered index.
Hope I answered to your question.thanks