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

how to insert,update and delete Record from to database table from inline load statement of qlikview script

Hi,

My requirement is insert,update and delete  record of inline section accesses to database while loading.

example : what ever I  do change in inline section accesses script it will reflect to database table.

Please help on this scenario.

Thanks,

Debabrat

3 Replies
debabrata_sahoo
Contributor III
Contributor III
Author

it asking to join group..

tresesco
MVP
MVP

Let me get the content here:

Hi,

The below script helps to insert data from Qlikview to Database using Script.

//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.