Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
Having a few issues with the below script.
Basically, I am trying to remove all records where readpriv = 1
The fields load fine and they all link together properly.
However, when I do the resident loads and the where statement only the readpriv field is removed and not the whole record.
Hope you can help.
Thanks, Imtiyaz
People:
SQL SELECT *
FROM ManchesterStudents2.dbo.People;
AMGR_Client:
SQL SELECT "Client_Id",
"Contact_Number",
Name,
ReadPriv
FROM ManchesterStudents2.dbo."AMGR_Client";
People1:
LOAD First_Name,
Last_Name,
Contact_Number,
Client_Id
Resident People;
AMGR_Client1:
LOAD Client_Id,
Contact_Number,
ReadPriv
Resident AMGR_Client
WHERE ReadPriv='0';
DROP Table AMGR_Client;
DROP Table People;
Are you using some other load statements (or statements like QUALIFY ) before that snippet in your script?
I would have assumed that
- AMGR_Client1 table is auto-concatenated to table AMGR_Client because fields are the same.
--> no table AMGR_Client1 exists
- you drop table AMGR_Client, so losing all Client table data.
To avoid autoconcatenation of your tables, use the NOCONCATENATE LOAD prefix.
NOCONCATENATE LOAD Client_Id,
Contact_Number,
ReadPriv
Resident AMGR_Client
WHERE ReadPriv = '0';
You should be able to add the where clause also to the SQL Select statement, so no need to use resident loads.