Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a table with two ID columns Primary_ID and FK_ID.
The Primary_ID contains the FK_ID also ,so while loading the scipt I want the PrimaryID which are not the FK_ID .
How can I do it at a script level while loading the data.
Is there anything like not exist for script level restriction.
Regards,
Yes You are right, 'That actually depends'.
If all values of PK are in Primary, then 2nd LOAD gets 0 Rows.
Hi Rahul,
Tresesco is right, You can use that script to load the Primary key which are not FK_ID.
Regards,
Muthu
Hi Tres.
Just a remark. Isn't it the other way around? The OP says "The Primary may contain FK id but we want only the one's which are not in FK.".
Shouldn't the second LOAD rather be something like this?
t2:
NOCONCATENATE
LOAD * RESIDENT t1 WHERE Not Exists(FKID, PK);
Yes you are right. I have to read more carefully.
Corrected the order.
Hi rahul,
Something like:
Temp:
Load FK_ID as NoPrimaryLikeThisID From SourceTable;
Load * From SourceTable Where NotExists(NoPrimaryLikeThisID, Primary_ID);
Drop table Temp;
Cheers
Andrew