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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Ajinkya1
Partner - Contributor
Partner - Contributor

Can Qlik QVD upload directly to Postgres or redshift db as a new table

Hi All,

 

I have one data model in app where I am cleaning and transforming some data which I want to store in Postgres or redshift database as a new table.

mostly preferring to load QVD directly into db table.

Can anyone suggest me a way. Thanks in Advance!!

Regards,

Ajinkya

1 Reply
Vegar
MVP
MVP

You can load data into a database using the odbc connector adding one row at the time. The script could look something like this:

1. Load QVD data into a RESIDENT table

2. For each row in your resident table insert those into your sql table as below.

      LIB CONNECT TO 'database';

        SQL  INSERT INTO fieldA, fieldB VALUES ('fieldvalue_A_on_row_x' , 'fieldvalue_B_on_row_x')
            !EXECUTE_NON_SELECT_QUERY; //Needed for non select queries with the odbc connector (link)

      Disconnect;
 
 

You could have a look at the old post by the Community MVP @OmarBenSalem  from 2017 in order  to get inspiration on how to do the loop (he also shows a slightly different method using procedures creating the table and for performing the insert). Find it here: Store a QlikSense table directly into an SQL table using the script.