Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
Not applicable

Problem executing multiple SQL statements

Team,

I successfully established ODBC connection.

Now when I write multiple SQL Statements, one after another, only the 1st one executes successfully whereas the subsequent one fails/doesn't do anything.

I wan to understand the following:

1. Why only  the first one executes? How can I make 2nd SQL satement work? When it didn't work in the same tab I created another tab and put it there and reloaded script still it executed first one but the second one remained untouched. DO I need ODBC connection string in each tab? Do I need Load statement for each SQL, if YES, why the 1st one executed without Load statement?

2. Is there a way I can go to Edit Script --> Data Tab --> Select --> Create Select Statement window --> Script and write my SQL there so that it executes against my Database that I am connected to and get my desired results?

Thanks.

Samuel

1 Solution

Accepted Solutions

Re: Problem executing multiple SQL statements

Is there the ; after the last instruction in your select?

Select * form mytable where condition;

Let me know

5 Replies

Re: Problem executing multiple SQL statements

Is there the ; after the last instruction in your select?

Select * form mytable where condition;

Let me know

javier_florian
Contributor III

Re: Problem executing multiple SQL statements

Hi Sam,

If you have problem with the several scripts, a recommendation is working with multiple tabs:

multiple scripts.JPG.jpg

You must have in mind the recommendation of Alessandro, where every single script must end with ";"

select field_a, field_b from mytable where condition;

-JFlorian

Employee
Employee

Re: Problem executing multiple SQL statements

Could you post your script here?

Not applicable

Re: Problem executing multiple SQL statements

Alessandro Saccoe

A BIG Thank YOU. It worked. I didn't realize that a semicolon (;) was required after each SQL statements.

I spent a couple of hours trying different things like putting SQL statements under different TABS, etc and I was very frustrated at the end. Finally, I created my account and post a question.

May GOD bless you and I hope to stay in touch with you. It's a good community work. It really helped.

With Kindest Regards,

SD

Not applicable

Re: Problem executing multiple SQL statements

I got my problem solved. Thank you for your help. It is a good community work.

Regards,

SD