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,
Exists() really is a script level restriction, nothing else.
But your requirement is a bit weird. You say that Primary_ID contains FK_ID, but next you want to load all rows where Primary_ID <> FK_ID... Isn't that a bit contradictory?
Actually It is what the way the day has to be structured.
The Primary may contain FK id but we want only the one's which are not in FK.
Regards,
any suggestion on how to go about it.
basically the table should contain Primary and FK both fields but Primary should not have FK values.
May be
..... Where Not Exists(Primary,FK);
Regards,
Antonio
May be like:
So in your case it would be like:
Load * <> Where Not Exists( FK_ID,Primary_ID); //Corrected the order
this is not loading any data for me.
the record count is 0.
You don't need 2nd LOAD Resident
Try
LOAD * from Table Where Not Exists(Primary,PK);
I just loaded it once
Regards,
That actually depends. If you don't use second load, the values in first field that appears later in second field would be loaded and I assume OP doesn't want that.