Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
alexandros17
Partner - Champion III
Partner - Champion III

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

Select * form mytable where condition;

Let me know

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

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

Select * form mytable where condition;

Let me know

javier_florian
Creator III
Creator III

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

Clever_Anjos
Employee
Employee

Could you post your script here?

Not applicable
Author

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
Author

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

Regards,

SD