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

Using Oracle Prepared Statement in Qlikview

Hi everybody. I have some trouble in my work. All queries, in a database severely used here, have to change and use "prepared statement" (Oracle). I searched, but I can't found. How I can do that in Qlikview?

SELECT
*
FROM
ATE
WHERE
ATE.DT_ALTERACAO_REGISTRO BETWEEN TO_DATE('$(DataInicioExtracao)', 'dd/mm/yyyy HH24:MI:SS') AND TO_DATE('$(DataFimExtracao)', 'dd/mm/yyyy HH24:MI:SS')...

How I can use Oracle Prepared Statement to do this query? 🙂

Labels (5)
2 Replies
talespv
Contributor
Contributor
Author

I'm tried to make a bind using two dots, but I was have this error:

OleDb error - Connector reply error: ErrorSource: OraOLEDB, ErrorMsg: ORA-01008 : Not all variables bound

Script:
...
AND ATE.DT_ALTERACAO_REGISTRO BETWEEN TO_DATE(:"'$(DataInicioExtracao)'", 'dd/mm/yyyy HH24:MI:SS') AND TO_DATE('$(DataFimExtracao)', 'dd/mm/yyyy HH24:MI:SS')
...

Brett_Bleess
Former Employee
Former Employee

Tales, one key thing to understand, the error being returned is not really from QlikView, it is coming from your Oracle Driver/Client, we are just passing it back to the log/user interface, so you really likely want to be on the Oracle forum.  

Regarding running straight SQL in the QlikView Script, provided the client driver/connector is able to translate the code you are putting in our script editor, everything should run perfectly.  I do know Oracle is quite particular etc. as we receive quite a few cases regarding Oracle issues, and in most cases they are syntax, configuration or driver related issues.  

The only thing of which I can think is there may be something wrong in your Connect statement, you may want to try to use the Wizard to create that and then try to do the Select after the Connect string is working, and then add your Where clause etc., that way you should be able to narrow things further.  Sorry I do not have a better answer at the moment.

Only other thing I have is the Help doc on things:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.