1 Reply Latest reply: Dec 8, 2011 3:04 PM by aditya26849 RSS

    Urgent: Selecting count from oracle sql into Qlikview Script Editor Variable

      Hi,

          I am new to Qlikview so would require your help...

       

      As per my current requirements, I need to insert a username value into oracle table through a procedure...

       

      If the user already exists in the table then I should not run the procedure otherwise I should execute the procedure...

       

      The procedure only inserts the record into table...

       

      this i am implementing by taking the count into a variable cnt and then checking the same..

       

      but during debugging cnt value is showing as <NULL> so i am unable to process the same

       

      I am connecting to an Oracle database using ODBC connector and then check whether the user already exist in the table 

       

      Need urgent support from you guys

       

      the script is as follows:

       

      ODBC CONNECT TO [dbname;DBQ=dbname] (XUserId is user, XPassword is pass, mode IS write);


      set user_id='USER1';

       

      table1:
      load *;
      select count(1) cnt from ushypadm.eradb_dim_sec_v where upper(usr_id) = upper('$(user_id)');

       

      set c1=$(cnt);

       

      if c1=0 then
      SQL CALL schema_name.proc_name('$(user_id)');

      ENDIF;