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

Executing a stored procedure

Hi All,

I'm very new to Qlikview, and I was trying to create my first report based on a stored procedure in my MS SQL database.  In other report tools, I would simply write the SQL statement as follows, but I keep getting an error in the edit script function of Qlikview.  Here's my script so far:

ODBC CONNECT TO [Quantim Production] (XUserId is DIUESZFMKC, XPassword is TFSbJEFGNabcWIRKNKLB);
EXEC dbo.sp_RUNScoreEncountersINPATIENT '10/01/2011','5/18/2012','SHEARTIN';

I get connected to the DB OK, and I can do simple Select statements, but I get an "Unknown Statement" when I try to reload using an "EXEC" SQL command.

Any ideas?

-Bob

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

You can access data from database using store procedure like this

TableName:

SQL EXEC usp_GetData;

Hope this helps you.

Regards,

Jagan.

View solution in original post

10 Replies
MayilVahanan

Hi,

     In qlikview , there is no option like Exec as in database.. Can you say your requirement , its help to achieve your requirement..

     You can use like this.

     Select * from tablename where DateField = '10/01/2011' and DateField = '5/18/2012' and NameField = 'SHEARTIN';

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Yes, as I said, I've been successfuly with simple table queries, but the data I need to extract is somewhat complex, and has been consolidated into a stored procedure.  Are you saying that Qlikview cannot execute Microsoft SQL stored procedures?

MayilVahanan

Hi,

     See the folllowing links:

     http://community.qlik.com/message/162897#162897

    

     http://community.qlik.com/thread/3223

    

     http://community.qlik.com/message/132679#132679


Use Sql Exec dbo.sp_RUNScoreEncountersINPATIENT

    Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jagan
Luminary Alumni
Luminary Alumni

Hi,

You can access data from database using store procedure like this

TableName:

SQL EXEC usp_GetData;

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

PERFECT.  I knew it was something easy!  Thank you.

Not applicable
Author

+ ...And how can I exec procedure in package (ODBC, ORACLE)?

because same formula is not works

SQL EXEC export_pkg.set_from_date;

q1.jpg

Not applicable
Author

it's works with CALL instead EXEC/EXECUTE

thanks

http://qlikviewmaven.blogspot.ru/2012/12/execute-oracle-procedure-from-loadscript.html

// Call Oracle data summarization procedure

sql call corp_report.update_rpt_data('$(var_COUNTRY)');

Not applicable
Author

Hi All,

Thanks for the discussion!!.

I am facing issues in integrating oracle stored procedure data with QlikView.

I am not able to fetch Oracle stored procedure data into QlikView. I have posted the issue in forum atQlikView integration with Oracle Stored procedure FAILS in fetching data and inserting data to oracl...

Could you please take a look at and advise for corrections.

Thanks a lot in advance.

Regards,

Laxmaiah Chowdary

Not applicable
Author

Hello Jagan,

Thanks for the discussion!!.

I am facing issues in integrating oracle stored procedure data with QlikView.

I am not able to fetch Oracle stored procedure data into QlikView. I have posted the issue in forum atQlikView integration with Oracle Stored procedure FAILS in fetching data and inserting data to oracl...

Could you please take a look at and advise for corrections.

Thanks a lot in advance.

Regards,

Laxmaiah Chowdary