Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
rajtechnocraft
Contributor III
Contributor III

To pass parameters from QlikView application to a stored Procedure

Dear All,

I want to pass parametrs from qlikview application to a stored procedure

Right now i am using hard coded parametrs from SP and directly calling SP into Qlikview application

Can kindly any one help me on this urgently.

I will be thankful to you guys.

Regards

Raj,

19 Replies
hector
Specialist
Specialist

Have you tried something like this?

SQL

Exec sp_test 'paramvarchar', paramnum

;

etc etc

Greetings

rajtechnocraft
Contributor III
Contributor III
Author

Dear Héctor Muñoz

I tried this but SP doesn't ask me to pass parameter when i execute qlikview application

what i wanted is when i refresh my qlikview application it should ask me to supply parameters for which i want to fetch results and

based on the input provided by user i should be able to refresh qlikview application and fetch the result set.

Regards

Raj Technocraft

hector
Specialist
Specialist

Hi, and something like this?

Input:
Load
Input('Enter an integer value', 'Input box') as value_int,
Input('Enter an char value', 'Input box') as value_char
autogenerate 1;

Let vValue_int = peek('value_int',0,'Input');
Let vValue_char = peek('value_char',0,'Input');

drop table Input;

SQL
exec sp_test $(vValue_int),$(vValue_char)
;

C ya!

Not applicable

hi Hector this code is not working ..........

in exec statement is not able to identify $(variable) name .................... it gives "blank field not allowed error"

Bjorn_Wedbratt
Support
Support

Try putting single quotes around the $(variable), like '$(variable)'.

See if that helps.

Not applicable

still not working

Bjorn_Wedbratt
Support
Support

What kind of DB are you using? Are you using OLEDB or ODBC? Can you provide an example of your code?

I tried the exact same thing against AdventureWorks in MS SQL2008 executing the SP uspGetEmployeeManagers, like:

Input:
Load input('Employee Manager','Input box') as val_int
autogenerate 1;
Let vValue=peek('val_int',0,'Input');
SQL EXEC dbo.uspGetEmployeeManagers '$(vValue)'


It's working great here, using OLEDB

Not applicable

we using ODBC .................

Ms sQL server2005

Not applicable

Create Procedure test_proc @date1 datetime, @date2 Datetime, @Vol Float Output
AS
Begin
Select @Vol = Max(Volume) From Test Where date1 >= @date1 and date2 <= @date2
End

this is my proc @ backend which accepts two input parametes date1 & date2 ...... based on that it returns output in @vol.

code i'm using in QV

Input:

load

Input('Enter an from date value', 'Input box') as value1_date,
Input('Enter an end date value', 'Input box') as value2_date
autogenerate 1;

Let FromDate = peek('value1_date','2008/01/04','Input');
Let DateTo = peek('value2_date','2009/01/04','Input');

sql

Declare
@vol int,
@FromDate datetime,
@DateTo datetime

Execute [dbo].[test_proc] '$(FromDate)', '$(DateTo)', @vol = @vol output

Select @vol

when i refresh my appn it asks me for two input dates , but doesnt display any output...

what i believe is that it might not be passing '$variable' to input parameters . i confirmed this by adding same code to another sp which gives error saying" blan fields not allowed in sql"