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

Create temporary table in SQL and insert values doesn't work in QLIikSense

For testing purposes I tried to create two temporary tables in A QLikSense script, written in SQL. My code is:

LIB CONNECT TO 'db02';

SQL

CREATE TABLE #A
(
    Nr int, 
    helft1 Varchar(1)
)

CREATE TABLE #B
(
    Nr int, 
    helft2 Varchar(1)
)

INSERT INTO #A VALUES (1, 'A')
INSERT INTO #A VALUES (2, 'B')
INSERT INTO #A VALUES (3, 'C')

INSERT INTO #B VALUES (4, 'D')
INSERT INTO #B VALUES (5, 'E')
INSERT INTO #B VALUES (6, 'F')

SELECT * FROM #A

SELECT * FROM #B

;

When I run the script I don't get any error messages:

Laden van gegevens gestart

Er worden verbinding gemaakt met db02
Verbonden
Zoekindex maken
Maken van zoekindex is voltooid

App opgeslagen

Voltooid
0 geforceerde fout(en)
0 synthetische sleutel(s)

My meaning is to create the two tables in SQL temporary and after querying this tables, get them in the model viewer of QLikSense. At the moment I don't get any data in my application. What am I doing wrong. My goal is to use SQL to manipulate and create tables instead of QLik-language.

Labels (1)
2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Most of this script looks OK to me, but I am not sure that Qliksense can use the two result sets returned. For testing, I would remove the second select * and see if QS get that data from a single select. I that works, then concatenate the two temp tables in the SQL select expression. 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

I am of course assuming that the SQL syntax is correct for the DBMS. I would test the script in a query test tool (like SMS for SQL server, Toad or other).
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein