Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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
jsn
Honored Contributor

sql stored procedure + input parameter

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)'

8 Replies
jsn
Honored Contributor

sql stored procedure + input parameter

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

sql stored procedure + input parameter

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

sql stored procedure + input parameter

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?

jsn
Honored Contributor

sql stored procedure + input parameter

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

sql stored procedure + input parameter

Bingo, i finally got the answer i want.

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

jsn
Honored Contributor

sql stored procedure + input parameter

Haha, thanks murabza! Glad to be of assistance

arturbrandys
New Contributor II

Re: sql stored procedure + input parameter

Yes it works. Thank you.

Highlighted
mick1234
New Contributor II

Re: sql stored procedure + input parameter

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