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

sql stored procedure + input parameter

I m trying to execute sql stored procedure with 3 input parameter namely : B_year,B_month,B_type

I want qlikview to prompt me to enter those input parameter whenever i make refresh or some other means.

How can i do that?

Please Help.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

The input box popup is a QlikView function and will not work in an SQL statement like that.

You need to place it outside:

LET vYear=INPUT('ENTER YEAR VALUE','INPUT BOX');

LET vMonth=INPUT('ENTER MONTH VALUE','INPUT BOX');

SQL EXECUTE SP_SAMPLE '$(vYear)','$(vMonth)'

Ps. You might not need the quotations around the variables when calling them.. i.e. $(vYear) instead of '$(vYear)'

View solution in original post

8 Replies
Anonymous
Not applicable
Author

Hi Murabza,

You can use input boxes to store the input values in variables before passing them as parameters in your stored procedure call.

Example:

Let vParam1 = Input('Enter value for Parameter 1', 'Input box');

Then you just use vParam1 to pass the value.

How to execute stored procedures has been answered several times in the forums, here for example:

http://community.qlik.com/forums/p/19638/75070.aspx#75070

Not applicable
Author

Sorry for not being specific.

What i want is when i refresh my qlikview, it must prompt me to put values

i tried the following script which only prompt me to enter value but at the enfd i get an error.



sql

declare

Let

SQL

EXECUTE SP_SAMPLE @year,@month; @year = Input('Enter year value', 'Input box');

Let

@month = Input('Enter month value', 'Input box'); @year int,@month int;



Not applicable
Author

SQL

DECLARE @YEAR INT, @MONTH INT;

LET @YEAR=INPUT('ENTER YEAR VALUE','INPUT BOX');

LET @MONTH=INPUT('ENTER MONTH VALUE','INPUT BOX');

SQL EXECUTE SP_SAMPLE @YEAR,@MONTH

------------------------------------

The above code gives me error when i execute it,

but when i hard coded the input parameter it goes fine e.g SQL EXECUTE SP_SAMPLE 2008,8

---------------------------

WHAT CAN I DO?

Anonymous
Not applicable
Author

The input box popup is a QlikView function and will not work in an SQL statement like that.

You need to place it outside:

LET vYear=INPUT('ENTER YEAR VALUE','INPUT BOX');

LET vMonth=INPUT('ENTER MONTH VALUE','INPUT BOX');

SQL EXECUTE SP_SAMPLE '$(vYear)','$(vMonth)'

Ps. You might not need the quotations around the variables when calling them.. i.e. $(vYear) instead of '$(vYear)'

Not applicable
Author

Bingo, i finally got the answer i want.

Thank you just isn't enough! You're the best!

Anonymous
Not applicable
Author

Haha, thanks murabza! Glad to be of assistance

arturbrandys
Contributor II
Contributor II

Yes it works. Thank you.

mick1234
Contributor II
Contributor II

Hi, and what about Qlik Sense Desktop or Enterprise? i cannot find input function 😞