Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fetching my tables is not working the right way

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.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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

View solution in original post

3 Replies
Not applicable
Author

scripting.bmp

here is the image, of the reload

swuehl
MVP
MVP

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

Anonymous
Not applicable
Author

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