Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL Stored Procedure into QlikView

Hi,

i'm currently trying to get data with stored procedures into Qlikview.
Is this possible?

Thanks in advance

Elzo

64 Replies
Not applicable
Author

hi,

can anybody tell me how to run a stored procedure if i am using  informix database using ODBC connection

ksmccann
Partner - Contributor III
Partner - Contributor III

                I did some quick testing on QV and stored procs and was able to use temp tableswithout any issues, see below for my simple script.

               Here is what I did discover:

  • -         QV stops at the first select statement that itencounters, so in the case I have below it shows the select of the temp tablebut not the data from the select off the POS$ table ( a physical table)
  • -         Deletes and updates have no effect on QV andexecute as expected
  • -         If you do not set NOCOUNT on QV stops at thefirst message(which may be what you are encountering)

USE [QVDemo]

GO

/****** Object:  StoredProcedure[dbo].[spQV]    Script Date: 04/01/2012 10:45:50 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

--=============================================

--Author:        <Author,,Name>

-- Create date: <Create Date,,>

-- Description:  <Description,,>

--=============================================

ALTER PROCEDURE [dbo].[spQV]

      -- Add the parameters for the stored procedure here

     

AS

BEGIN

      -- SET NOCOUNT ON added to prevent extra result sets from

      -- interfering with SELECT statements.

      SET NOCOUNT ON;

     

      CREATE TABLE[#tmp_Response]

(

     [SurveyKey] [INTEGER] NULL

     

);

INSERT INTO[#tmp_Response] ([SurveyKey])   values(1)

INSERT INTO[#tmp_Response] ([SurveyKey])   values(2)

INSERT INTO[#tmp_Response] ([SurveyKey])   values(3)

delete from[#tmp_Response] where [SurveyKey] = 3

update [#tmp_Response] set[SurveyKey] = 3 where[SurveyKey] = 1

select * from [#tmp_Response]

      SELECT* from dbo.POS$

     

      select * from [#tmp_Response]

END

Not applicable
Author

hello everyone!

I think there's a clear solution with this issue after I tried to use ODBC instead of OLEDB connection.. no need for "mode is write" as well as ticking the box to allow database write under settings. My stored proc worked just fine and displayed the table just how i want it. 😃

ODBC CONNECT TO DBName (XUserId is UserID, XPassword is Pwd);

[Inventory]:

SQL EXEC [DBName].[dbo].[sproc_ListEnhancedAllInventory] @startDate='1/1/2010', @endDate='1/31/2010';

regards,

Enard

Not applicable
Author

Hi All,

I have a situation where in i need to pass the Input Parameter from the URL (Query String) to the stored procedure and bind the dashboard.

Ex: www.google.com/ID=4

I am trying to access the above ID field in a variable and then pass to the Stored Procedure as

sql exec sproc $(ID);

I am facing issues to access the query string value and also to bind a variable to the stored procedure dynamically instead of declaring as above(@Country='Canada').

Please let me know if you find any solutions.

Thanks

Sai Krishna

Not applicable
Author

Hi Sunden,

I have a situation where in i need to pass the Input Parameter from the URL (Query String) to the stored procedure and bind the dashboard.

Ex: www.google.com/ID=4

I am trying to access the above ID field in a variable and then pass to the Stored Procedure as

sql exec sproc $(ID);

I am facing issues to access the query string value and also to bind a variable to the stored procedure dynamically instead of declaring as $(ID)=1.

Please let me know if you find any solutions.

Thanks

Sai Krishna

Marcio_Campestrini
Specialist
Specialist

Hi Johannes.

Thanks for the answer. I was just looking for this...

Márcio Rodrigo Campestrini
Not applicable
Author

thanks, set nocount on was the response for my problem

Not applicable
Author

Thnx ..

Anonymous
Not applicable
Author

Hi Stephen,

can you please help me,

how to execute stored procedure with parameters because i have tried without parameters its working but with

parameters its not working.

<pre>

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='$#,##0.00;($#,##0.00)';

SET TimeFormat='h:mm:ss TT';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Initial Catalog=DB_9B08BD_automobile;Data Source=localhost;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=DEVELOPER-PC;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is EOIeQYIGTBNKDbEF);

FieldService_Cost:

LOAD Tickte,

  drss,

  rig,

  well,

  jobtype,

  Mobilization_date,

  fromdate,

  todate,

  Equipments,

  jobcost;

SQL EXEC Sp_TicketCost '4','03/01/2015', '03/31/2015';

</pre>

Sp_TicketCost contains three parameters, DeptID, fromdate, todate.

Mohammed

Marcio_Campestrini
Specialist
Specialist

Mohammed,

Try this:

SQL EXEC Sp_TicketCost('4','03/01/2015', '03/31/2015')

Márcio Rodrigo Campestrini