Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
johnan
Creator III
Creator III

SQL INSERT

Hi,

I want to use "Insert into" tables from QV. Does QV9 have this or is there any macros?

I want to insert 7 columns from my table in QV into the database.

I've tried to find in forum but no good luck.

10 Replies
mountaindude
Partner Ambassador
Partner Ambassador

No need to use the $(Include=e:\temp\insert_test.txt); syntax unless you really have a reason to.

You can simply write your SQL insert statements in the QV load script, along these lines:

ODBC CONNECT TO postgres_server1;

SQL          INSERT INTO table1 VALUES ('2012-08-01', 'SE', 345, 0.345);

SQL          INSERT INTO table1 VALUES ('2012-08-01', 'SE', 456, 0.456);

DISCONNECT;

The above has been verified to work with PostgreSQL, using their standard ODBC 64 bit Unicode driver.

Please note however that there is a readonly check box in the ODBC driver settings. Obviously, it should not be checked...

Seems there is a bug in the help file relating to this. In QV11 SR1 the help text for "SQL" states:

"Sending SQL statements which update the database will return an error, since QlikView per definition accesses all ODBC sources in read-only mode."

AFAICT that is simply not true, at least not when connecting to PostgreSQL databases.

/Göran

Please mark the post as a solution if it provided you with a solution to the topic at hand. Thanks!