If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > How can i find out the name of referenced tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-18-05, 05:01
ipohl ipohl is offline
Registered User
 
Join Date: Feb 2005
Posts: 4
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?
Reply With Quote
  #2 (permalink)  
Old 02-18-05, 05:51
ipohl ipohl is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On