Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Posts
    4

    Unanswered: How can i find out the name of referenced tables

    Hello,

    When i want to delete a Record whose Primarykey is referenced i got a cryptic message like:

    delete from t_kennzeichenart where nkennzeichenartkey = 56
    ^
    Error: Key value for constraint (informix.u140_176) is still being referenced.

    with the first 3 numeric signs (140) i can look in the table SYSTABLES that the name of the table is t_kennzeichenart but how do i find out what the other table is???

    with the following statement:

    select * from sysreferences where PTABID="140";

    i can see that there is only one result which means there is only one table referenced to. but there is still no sign of the name or key or whatever which shows me something from the other table...

    Could someone please explain me how i can do this?

  2. #2
    Join Date
    Feb 2005
    Posts
    4

    I found out something like this

    When i do the following statement:

    select TABNAME from SYSTABLES where TABID IN
    (select TABID from sysconstraints where CONSTRID IN
    (select CONSTRID from sysreferences where PTABID IN
    (select TABID from sysconstraints where CONSTRNAME= "u115_82" )
    )
    );

    i get the tables but im not sure if this is right.
    What does for example the "u115_82" means where and when is it created?
    Is there another possibility how to find out which of the referenced tables did the mistake?
    Because in the statement above i just can see all tables which are referenced to the searched table.
    But im just searching for the tables that actually contains the datarecord(s) which leads to the error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •