Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

ramkrishna86
Contributor II

How to use sql #temp table and insert statement in qlik

Hi,

Anyone have idea about sql #temp table and insert statement usability in qlik.

I have a sql query with multiple insert and #temp table, how to use this query in qlik.

Thanks,

RK

1 Reply
MVP
MVP

Re: How to use sql #temp table and insert statement in qlik

Just use the SQL keyword. The load will return no data but that is not a problem. For example

CONNECT ...

// create temp table (no data returned)

SQL

SELECT * into #temp

FROM mytable;

// do some manipulation to the temp table (no data returned)

SQL

UPDATE #temp

...

...

// Now get the data into QV

Table:

SQL SELECT * FROM #temp;

DISCONNECT; //#temp out of scope after disconnect, so the resources used are released

The #temp table remains in scope for the duration of a single database connection. Make sure that the connection has the necessary permissions to create temp tables.