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

Load where Exists (iseries(

Hi all,

This works well

  

H_Order:

LOAD *, (OTAAOR & OTNUOR) AS KeyOrd;
SELECT *
FROM   HORDER;
L_Order:
LOAD *,
(ORAAOR & ORNUOR) AS KeyOrd         
WHERE EXISTS (OTNUOR, ORNUOR) ;
SQL SELECT *
FROM   LORDER;

This one causes an error on EXIST istruction

 

H_Order:
LOAD *, (OTAAOR & OTNUOR) AS KeyOrd;
SELECT *
FROM   HORDER;

L_Order:
LOAD *,
(ORAAOR & ORNUOR) AS KeyOrd;
SQL SELECT *
FROM   LORDER
WHERE EXISTS (OTNUOR, ORNUOR);

I have to use exist only after LOAD STATEMENTS ?

Many thanks in advance

4 Replies
sunny_talwar

Yes, because Where Exists is a QlikView function, AFAIK. You cannot take that into your SQL. I am sure there must be a way to check Where Exist in SQL, but that will have to be done by using the SQL queries.

swuehl
MVP
MVP

Everything after SQL up to the semicolon will be sent to the SQL driver and executed by the driver.

SQL SELECT *

FROM   LORDER;


If you want to use the QV function EXISTS(), you need to use it in a preceding QV LOAD statement.

swuehl
MVP
MVP

Sunny, there exists also a SQL Exists() condition, but the syntax is different. I assume the OP is refering to the QV functions Exists().

sunny_talwar

Right, that's what I meant. There is definitely a way to do it but the syntax would require to have the two tables in one SQL and doing some manipulation. The back and forth interaction with SQL won't work the way tried above is what I was trying to refer.