karlovac
24th October 2002, 07:56
How to find out which tables (table fields) are referencing on field we want to change?
(How to find "son" in referential integrity?)
Thanks
PS
Is tool refint6.1 for that purpose or SQL query or ...?
NPRao
24th October 2002, 08:01
Check @-
Print References To Parent session (ttaad4229m000)
karlovac
24th October 2002, 09:16
It works fine for key fields of table.
I want the same thing for some other fields:
For example (source of my question was):
data from field tdpur041.citg which for shure goes to purchase statistic,
but, this is not a problem.
Question is: does this data go somewhere else?
d:)
NPRao
24th October 2002, 09:53
This might be quite intensive search mechanism and you have to come up with a vrc search algorithm for finding the correct version of the program script and then querying the tools table - ttadv234 - Maintain Table Fields by Program Script/Function/Report and then you have to search for each entry of the field name.
I hope this information will help you out.
Good Luck!
ssbaan
24th October 2002, 16:35
tdpur041.citg is defined as Item group and refers back to table tcmcs023 (Item Groups). Is it not the Item group table field .citg that is really the one that you to find where else it is used? I think you need to find the 'parent' first before you stat you search.
If you are on a Unix box, you could write a script to seach the
the table data dictionaries ( /baan/dict/dd40c2cecp/*) for the
string "tcmcs023.citg") listing the table you are searching for each HIT found (see example below). (dd40c2cecp is our package combination)
dtdpur061
:REFR:tcmcs023.citg
The script itself could look something like this:
>OUTFILE
SEARCH="tcmcs023.citg"
for file in `ls /baan/dict/dd40c2cecp/*`
do
cat ${file} |grep "${SEARCH}" > /dev/null
if [ $? = 0 ] ; then
echo ${file}
cat ${file} |grep "$SEARCH}"
fi
done >> OUTFILE
cat (or vi) the file OUTFILE to see results
NOTE*** this would find all the table field references for referential integrity, but not neccessarily where the filed is all used. Run a where used for the field name for tht information
Hope this helps!
karlovac
24th October 2002, 16:54
Thanks for replay
I learned a lot from it.
But, it want be nessesery to find out where tcmcs023.citg is used,
cause I don't want (jet) to delete old item group definitions.
All I want is to change it in tdpur041.citg field, but I will use your ideas for finding all you said from tdpur041 point of view...
Regards