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

Comment sign in external sql file

Hello!

For loading data from databse tables I use exteranal sql-script files attaching it like this:

$(Include=rows.sql);

Before start loading I debug query in Database Query Analyser.

The problem is in comments. SQL comment style looks like:

-- My Comment

But signs "--" cause error in QlikView.

QlikView comment style "//" causes error in SQL Query Analyser.

How can I write comments in external sql-script so that still work in Query Analyser?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I am not sure how you are using this particular include file, but it is no different than anywhere else in the script. Statements executed by SQL server (ie after a SQL statement up to the closing ; sign) need -- SQL comments, and all other statements need // QV comments.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I am not sure how you are using this particular include file, but it is no different than anywhere else in the script. Statements executed by SQL server (ie after a SQL statement up to the closing ; sign) need -- SQL comments, and all other statements need // QV comments.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

maybe you could use the /* */ notations.

Not applicable
Author

Hi Pavel,

You can use find and replace functionality and replace all -- with // in your external script.

Thanks & Regards

Suhas Gupta

Not applicable
Author

Thank you very much Jonathan!

It realy works!

jonathandienst
Partner - Champion III
Partner - Champion III

Michele Barini wrote:

Hi,

maybe you could use the /* */ notations.

Good suggestion - that would also work.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein