Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to insert CSV file data into database using Qlikview script

Dear All,

Please share your ideas to insert data into oracle databse from csv file using QV script.

BR,

Chinna

5 Replies
jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

//Connection Sring

ODBC Connect to trDatabase;

//Load Data from Excel file

TABLE:

LOAD transaction_date,

     location,

     item,

     site

FROM

[Data.xlsx]

(ooxml, embedded labels, table is Sheet1);

// Getting number of records in Table

LET V_ROWS = NoOfRows('TABLE');

// Loop through the records and insert into Database table

FOR V_ROW = 0 TO V_ROWS - 1

LET V_FIELD1 = Peek('transaction_date',V_ROW);

LET V_FIELD2 = Peek('location',V_ROW);

LET V_FIELD3 = Peek('item',V_ROW);

LET V_FIELD4 = Peek('site',V_ROW);

SQL INSERT INTO dbo.temp_Table(transaction_date, location,item, site) VALUES('$(V_FIELD1)','$(V_FIELD2)', '$(V_FIELD3)','$(V_FIELD4)');

NEXT;

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

ashwanin
Specialist
Specialist

might be below thread help you :

Re: Can Qlikview write-back to an Oracle database?

jagan
Luminary Alumni
Luminary Alumni

Hi Chinna,

If you got the Answer please close this thread by giving Correct Answer.

Regards,

Jagan.

Anonymous
Not applicable
Author

Hi Jagan,

I will test and mark accordingly.

Best Regards,

Chinna