Finding constraint

Finding constraint

Post by Brett Sheera » Mon, 18 Mar 2002 20:49:48



Hi, I get the following error and I cannot find in the constraint in my
database:
"Key value for constraint (informix.u182_293). I cannot find this reference
anywhere in my database. I ran dbschema and did "a search through the
resulting file but was unsuccessful.

Any suggestions would be gratefully received.

Regards Brett sheeran

 
 
 

Finding constraint

Post by <rk_use.. » Mon, 18 Mar 2002 22:30:37



Quote:> Hi, I get the following error and I cannot find in the constraint in my
> database:
> "Key value for constraint (informix.u182_293). I cannot find this
reference
> anywhere in my database. I ran dbschema and did "a search through the
> resulting file but was unsuccessful.

that 182 in the constraint name refers to the table whose tabid is 182.

select tabname
from systables
where tabid = 182

The 'u' refers to unique constraint.

will tell you the table name.

now run dbschema -d databasename -t tablename(the table mentioned above)
The unique constraint of this table is the offending constraint.

HTH.

 
 
 

Finding constraint

Post by Jochen Bosman » Tue, 19 Mar 2002 22:58:35




Quote:> Hi, I get the following error and I cannot find in the constraint in my
> database:
> "Key value for constraint (informix.u182_293). I cannot find this
reference
> anywhere in my database. I ran dbschema and did "a search through the
> resulting file but was unsuccessful.

> Any suggestions would be gratefully received.

> Regards Brett sheeran

Hi,

i use the folllowing statement to locate the table and column. Hope it
helps.

---- SCHNIPP ------
select x0.tabname, x2.colname
from systables x0, sysconstraints x1, syscolumns x2, sysindexes x3
where x0.tabid = x1.tabid and x0.tabid = x2.tabid
and x1.idxname = x3.idxname and (part1 = colno or part2 = colno or part3 =
colno)
and constrname = '<insert your constraint name here>';
---- SCHNAPP ------

Greetings

Jochen Bosmann

 
 
 

1. Finding constraints programmatically

I am constructing several sql sp's to automate the reconfiguration of
several tables in a database. I can automate most of the structures and
properties of the files, but I don't know how to iterate through the
constraints that may exist on each table. I know it is possible to do this
using the system tables. Does anyone know how?

Gary

2. VB6 Database mystery

3. finding constraint problems

4. Rollback segment

5. Finding constraints in existing database

6. twz1jdbcForMysql 1.0.4 available

7. How to find constraints of a table using SQL

8. Finding constraints in existing database

9. SQL to Find Referencial Integrity Constraints

10. How to find primary key constraint name?

11. Could not find CHECK constraint??

12. Find names of all constraints on column