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

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;

1 Reply
Not applicable
Author

Hi,

    I went through certail forums and found peek function but still it is not returning any values

set user_id='USER1';

data_tab:
LOAD *;
sql select count(1) cnt from schema.table where upper(usr_id) = upper('$(user_id)');

let vCnt=Peek('maxusr',0,data_tab);

when I debug it is showing vCnt=<NULL>