2 Replies Latest reply: Jun 27, 2013 2:32 PM by Gysbert Wassenaar RSS

    Using SQL commands on script

    paulo costa

      Hi,

       

      I need to update some Oracle's OLTP tables before runnning a QV script. I could create a stored procedure, schedule it to run, but it would be more usefull (for maintenance reasons) if these statements could be lines of a QV script. The lines are:

       

      update brito.tbl_cad_brito a

      SET a.dtfimhabil =(select dtfimhabilitacao from tb_contribuinte where nriecontrib=a.inscrest)

      where exists(select dtfimhabilitacao from tb_contribuinte where nriecontrib=a.inscrest and NOT dtfimhabilitacao=a.dtfimhabil);

      commit;

       

      Is it possible?

       

      regards,

       

      Paulo Costa

        • Re: Using SQL commands on script
          Srikanth P

          May be you will ran procedure to batch file. So just call the batch file (.bat) in the script by using EXECUTE command.

          • Re: Using SQL commands on script
            Gysbert Wassenaar

            It is possible. But make sure to enable the option "Open Databases in Read and Write mode" on the Settings tab in the script editor. Otherwise Qlikview will open a read-only connection. Of course you need also priviliges in the Oracle database that allow you to update records in Oracle in that table. And you need to check if the ODBC or OLEDB connection allows write commands. If the ODBC or OLEDB datasource is defined as read-only it you can't write to it.