Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
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
tresesco
MVP
MVP

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.