Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
desert_dweller
Contributor
Contributor

Oracle Where In Variable Clause

Hi Data Experts,

 

I'm trying to limit my Oracle load based a variable I create from a preceding load. The variable has several hundred comma separated values in it and the load fails every time. It doesn't give me an error message, just tells me it can't find the first field in my select list. However if I limit the same where clause to just one value it works fine. Is there a problem with this syntax? This same syntax has worked fine for me in the past.

 

Side question-if I limit my values in the Qlik load (instead of the SQL) does that mean that Oracle is returning the millions of rows in the table and then Qlik is sorting through them? Not sure how that load works behind the scenes...

 

Variable Creation:

DOCsDistinct:
Load Distinct

concat(chr(39)&DOC_NO&chr(39),',') as AllDOCs

Resident FiscalRecords;

Let vDOCList=FieldValue('AllDOCs',1);
Drop table DOCsDistinct;

 

Oracle SQL Where Clause:

FROM "DATAWAREHOUSE"."DW_DOCS"
Where "DOC_NO" in ($(vDOCList));

Labels (1)
1 Reply
rubenmarin

Hi, try to add the distinct inside the concat: concat(distinct chr(39)&DOC_NO&chr(39),',')

Maybe it's still too long, check the documento log to see if the last sentence was completed. Or try to reduce your data to only 10 documents to confirm if the variable length is the issue.