Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have this five tables, where i want to insert in the QV so i can make my tables by them.
THE SCRIPT CODE:
OLEDB CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=PRIN;Data Source=AMRCCSLR835X0A\SQLEXPRESS;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=AMRCCSLR835X0A;Use Encryption for Data=False;Tag with column collation when possible=False];
SQL SELECT *
FROM PRIN.dbo."Presentaciones_Dolares";
SQL SELECT *
FROM PRIN.dbo."Presentaciones_Dosis";
SQL SELECT *
FROM PRIN.dbo."Presentaciones_Unidades";
SQL SELECT *
FROM PRIN.dbo."PROD_LAB_TIPO";
SQL SELECT *
FROM PRIN.dbo."Productos_Dolares";
SQL SELECT *
FROM PRIN.dbo."Productos_Unidades";
And when I hit Reload here is what happens:
If you can see, almost all the tables are being inserted into just one.
Help please.
QV auto-concatenate tables when these tables have the exact same field names.
You can prevent QV from doing this by using NOCONCATENATE LOAD prefix.
SELECT * FROM TableA;
NOCONCATENATE
SELECT * FROM TableB;
But if you load two tables non-concatenated with more than one common field name, QV will probably create a huge syn table.
So you should consider using
QUALIFY *;
SELECT * FROM TableA;
SELECT * FROM TableB;
Or rename your fields using AS
here is the image, of the reload
QV auto-concatenate tables when these tables have the exact same field names.
You can prevent QV from doing this by using NOCONCATENATE LOAD prefix.
SELECT * FROM TableA;
NOCONCATENATE
SELECT * FROM TableB;
But if you load two tables non-concatenated with more than one common field name, QV will probably create a huge syn table.
So you should consider using
QUALIFY *;
SELECT * FROM TableA;
SELECT * FROM TableB;
Or rename your fields using AS
In general, it is not a good idea to use SELECT* FROM.
First, you're probably loading some fields you don't need,
Second, if something changes in database (new fields, removed fields) - the script will work but you may get an unexpected result.
Third, it is harder to troubleshoot - see your own example.
Forth, it is harder to maintain.
...
Regards,
Michael