Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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