Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to insert data in database

Hi,

Is it possible to export data from Qlkview QVD to a SQL table?

Anybody can help on this..

I have the same fields in the qvd and the SQl table

And I have the connection to the SQL table using ODBC

It will be great if someone can advice me.

Thxs

1 Reply
mountaindude
Partner Ambassador
Partner Ambassador

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!