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

QlikView SQL string length limit

I use a loop to build up a SQL string to be sent to SQL server via OLE DB. The loops works fine - when I "capture" the SQL before it gets sent to the database and then paste it into Query Analyzer - it runs and returns results.

If I limit the loop to generate a SQL string of less then 165,000 (approximate) characters it runs throught in QlikView, but over that the script fails withou error.

The question then is - is there a limit to the length of an SQL string the QlikView can handle.

13 Replies
rbecher
MVP
MVP

Yea, you should always use a column list, not SELECT *.

Astrato.io Head of R&D
Not applicable

Agreed, thanks.

One more question. Any idea how I could do the following:

LET lSQLString = 'SELECT REPLACE(REPLACE(W_MobileWeb_Dev.dbo.qmob_values.value_comments,';','-'),':','-') AS value_comments FROM W_MobileWeb_Dev.dbo.qmob_phcs LEFT JOIN W_MobileWeb_Dev.dbo.qmob_values ON W_MobileWeb_Dev.dbo.qmob_values.phcs_id = W_MobileWeb_Dev.dbo.qmob_phcs.id';

SQL $(lSQLString);

The quotes in the SQL statement are causing the quotes in QlikView to indicate the string are conflicting.

I've tried adding quotes, but without success.

Any ideas?

Regards,

Johan

rbecher
MVP
MVP

This should work with doubling the quotes inside the string:

LET lSQLString = 'SELECT REPLACE(REPLACE(W_MobileWeb_Dev.dbo.qmob_values.value_comments,'';'',''-''),'':'',''-'') AS ..'

- Ralf

Astrato.io Head of R&D
Not applicable

Excellent!!! Thank you Ralf, your assistance is MUCH appreciated!