Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Stored Procedure Parameters SQL

Hello

I used stored procedures to bring my qlikview data, and it always works, now I need to pass a parameter which is the name of the user and the domain

but does not work, you can be wrong?

Thanks, regards

Cesar Estrada

vUserx = OSUser();

OLEDB CONNECT TO [Provider=SQLNCLI10.1;Integrated Security="";Persist Security Info=...............................................];

sql exec  ('[SERVER\XXX].[DBASE].[dbo].[gtStep1O] vUserx ' ) ;

1 Solution

Accepted Solutions
pgrenier
Partner - Creator III
Partner - Creator III

If you would like QlikView to send the contents of the variable through the SQL EXEC statement, you might want to add $() around the variable name, such as:

sql exec  ('[SERVER\XXX].[DBASE].[dbo].[gtStep1O] $(vUserx) ' ) ;


Cheers,


Philippe

View solution in original post

4 Replies
pgrenier
Partner - Creator III
Partner - Creator III

If you would like QlikView to send the contents of the variable through the SQL EXEC statement, you might want to add $() around the variable name, such as:

sql exec  ('[SERVER\XXX].[DBASE].[dbo].[gtStep1O] $(vUserx) ' ) ;


Cheers,


Philippe

Not applicable
Author

Hi Philippe:

when execute the script return this error

ErrorSource: Microsoft SQL Server Native Client 10.0, ErrorMsg: Incorrect syntax near '\'.

sql exec  ('[SERVER\XXX].[DBASE].[dbo].[gtpaso1O] DOMAIN\cestrada ' )

Thanks!

César

Not applicable
Author

Hi

sql exec  ('[SERVER\XXX].[DBASE].[dbo].[gtStep1O] "$(vUserx)"  ' )

Now Work Perfect!!

Thanks Philippe!!

Regards

César

pgrenier
Partner - Creator III
Partner - Creator III

Good catch César