Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

there's any way to save the connection result in a variable

Hi dear experts,

there's any way to save the connection result in a variable or something,

I mean if the connection is success or not then sabe that result in a boolean or something like that?

regards Experts.

2 Replies
maxgro
MVP
MVP

maybe

// on error continue

set ErrorMode=0;

// wrong connection

OLEDB CONNECT32 TO [Provider=OraOLEDB1.Oracle.1;Persist Security Info=True;User ID=test;Data Source=dev11;Extended Properties=""] (XPassword is EJXTIKVITCVUM);

// store result

set vResult=$(ScriptError);

trace connection result is $(vResult) ;

// halt andprompt user on error

set ErrorMode=1;

the execution log is

Connecting to Provider=OraOLEDB1.Oracle.1;Persist Security Info=True;User ID=test;Data Source=dev11;Extended Properties=""

Failed to connect

connection result is General Error

Not applicable
Author

Thanks Massimo,

I only replace the variable ScriptError with ScripErrorcount

just one more think ,

there's any way to send the ODBC since a variable?

Regards.