Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
neapicture
New Contributor III

Insert single record in table

Insert single record in table

Hello, I invite from an SQL database, a table and would like to add a single record permanently, since this subject is not in the DB there.

This script exists:

-----------------------------------------------

projects:

SQL SELECT `projekt_bereich`,

    `projekt_bereichsleiter`,

    `projekt_beschreibung`,

    `projekt_ende`,

    `projekt_id`,

    `projekt_kundenbetreuer`,

    `projekt_name`,

    `projekt_start`

FROM `qlik_reporting`.`projekte`;

insert into projects (`projekt_id`,` projekt_name`) VALUES (0, 'Absence types');

// Save the table on Server

store * from projects into $ (vDatenquelle) timo_projekte.qvd (QVD);

DROP TABLE timo_projekte;

-------------------------------------

but the Insert command does not work in Qlik.

I just want to insert a record with Projekt_ID "0". the ProjectID is then "Absence types" assigned as projekt_name.

Is there a way Thanks much in advance

1 Solution

Accepted Solutions
chrwolf64
Contributor III

Re: Insert single record in table

projects:

SQL SELECT `projekt_bereich`,

    `projekt_bereichsleiter`,

    `projekt_beschreibung`,

    `projekt_ende`,

    `projekt_id`,

    `projekt_kundenbetreuer`,

    `projekt_name`,

    `projekt_start`

FROM `qlik_reporting`.`projekte`;

Concatenate(projects)

LOAD * INLINE [

    projekt_id,projekt_name

    0,'Absence types'

];

3 Replies
mark6505
Valued Contributor III

Re: Insert single record in table

Hi,

What exactly you trying to do?

Just add a new row to the table as you can do a concatenate and do an inline load with the data?

Or a new column just add in the qlikview load

'Thing'  as NewField.

Mark

chrwolf64
Contributor III

Re: Insert single record in table

projects:

SQL SELECT `projekt_bereich`,

    `projekt_bereichsleiter`,

    `projekt_beschreibung`,

    `projekt_ende`,

    `projekt_id`,

    `projekt_kundenbetreuer`,

    `projekt_name`,

    `projekt_start`

FROM `qlik_reporting`.`projekte`;

Concatenate(projects)

LOAD * INLINE [

    projekt_id,projekt_name

    0,'Absence types'

];

Re: Insert single record in table

I think you can do better than "it doesn't work". For example, what error message do you get when you execute this script?

If you want to add a record to your source database (WriteBack), switch to R/W mode (see Script Editor->Bottom right tab called 'Settings'->Open databases in Read/Write mode) and add the SQL keyword in front of the INSERT statement.

If you just want to add a new project record to the loaded data in QlikView, see the suggestions by Christian & Mark.

Community Browser