Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I got my odbc data source setup to connect to an Oracle 11g instance. I also got the Oracle connection string
created in script editor and tested it. However, when I plugged in my Oracle PL/SQL statement, I got an "Unknow Statement"
error. I have been testing this statement in Oracle SQL Developer and it's running fine.
Can someone provide some help to me as to what I need to do in order to submit this query to Oracle and
get the data back?
Thank you.
And the reason is simple:
Whatever comes after a SQL prefix until (but not including) the semicolon will be sent through your open ODBC connection to the DB engine. QlikView Script Engine doesn't know anything about SQL (not really true but you get the idea) and as such is incapable of parsing and understanding a complex SQL statement. So it stuffs everything through the pipe for someone else to handle.
If you do not prefix such a statement with the SQL keyword, QlikView Script Engine will think that this series of keywords-clauses-&-operators is meant to be parsed and executed by the Script Engine. Which of course won't work.
SELECT is a special case, because it seems that it doesn't always require the SQL prefix.
Hope this helps.
Peter
Peter,
Thanks for the explanation.
Yes, I kind of figured that QV should not know anything about the actual Oracle SQL. It's a QV engine not an Oracle engine. I knew the actual parsing and execution was going to happen on the Oracle server. I initially though we could only submit SELECT and nothing more complcated than that. As I discovered and in your explanation, prefixing SQL
tells the QV engine to send the text after that and including the last semi-colon. I guess I'm learning QV through
writing Oracle PL/SQL.
Good luck!
Enjoy QlikView and the Qlik Community