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

Loading a Stored Proc from SQL

Hi All,

I am trying to load a stored proc from SQL called OITMVIEW, I have the following in my script;

ITEMS:
LOAD *;
SQL Exec OITMVIEW;

But when executed I receive the following error;

" Error: File .\extdata.cpp, Line 1826
SQL Exec OITMVIEW "



Any help would be greatly appreciated. Note that I dont have any variables to sent through to SQL.
Kind Regards,
Wynand.


1 Solution

Accepted Solutions
Not applicable
Author

you may want to try the steps on this http://community.qlik.com/forums/p/19638/74936.aspx

I hope this helps.

View solution in original post

9 Replies
Not applicable
Author

Hi,

Normally the stored procedure is working as for SQL syntax:

that means that SQL EXECUTE MyProcedure; Should work

Maybe this is not as simple, but are you sure that when you are connecting with your SQL command line, with the same user, then, running EXEC xxxxx is working fine ?

Maybe parameters are missing ?

Maybe you should specify the db owner to execute the stored procedure from ?

Rgds,

Sébastien

Not applicable
Author

Hi Wynand,

Once you stablisch the ODBC connection to the SQL Server..

You can do it like this:

ODBC

CONNECT TO [PACLDB2K801 -LINCS] .........



XYZ:

LOAD *

;

SQL

// you may need to include the database name on the next statement, depending if the login id has a default db different than were the stored procedure is located..

EXEC [dbo].[RPT_OR_Pressing_Material]



@LocationID = 0,

@DepartmentID = 0,

@WorkgroupID = 0,

@WorkcenterID = 0,

@StartDate = N'05/01/2010',

05/09/2020',

-1',

-1',

@ReportOptionID = N'Detail',

@ResponsibleIDs = N'-1'

;

mike_garcia
Luminary Alumni
Luminary Alumni

Hi,

It is not something related to the SQL statement. It is related to security rights, as explained here: http://community.qlik.com/forums/p/26440/101333.aspx#101333

That also happens when connecting to other DB's

Mike.

Miguel García
Qlik Expert, Author and Trainer
Not applicable
Author

Hi Mike,

The link you provided refers to someone trying to execute a SAP query. I am trying to run a SQL Stored Procedure. I have a proper connection to the database as I am drawing other data into Qlikview, I am just unable to get the Stored Procedure to execute.

Does anyone else perhaps have any other input?

Thanks,

Wynand.

Not applicable
Author


MiguelMena wrote:
Hi Wynand,
Once you stablisch the ODBC connection to the SQL Server..
You can do it like this:


ODBC
CONNECT TO [PACLDB2K801 -LINCS] .........



XYZ:
LOAD *
;

SQL

// you may need to include the database name on the next statement, depending if the login id has a default db different than were the stored procedure is located..
EXEC [dbo].[RPT_OR_Pressing_Material]

@LocationID = 0,
@DepartmentID = 0,
@WorkgroupID = 0,
@WorkcenterID = 0,
@StartDate = N'05/01/2010',
05/09/2020',
-1',
-1',
@ReportOptionID = N'Detail',
@ResponsibleIDs = N'-1'
;


<div></div>


Hi,

I am currently using an OLE DB connection to SQL. When I change to ODBC, I receive this error.

"ODBC read failed
SQL Execute OITMVIEW"

Thanks,

Wynand.



Not applicable
Author

you may want to try the steps on this http://community.qlik.com/forums/p/19638/74936.aspx

I hope this helps.

Not applicable
Author

     Error: Error: File .\extdata.cpp, Line 1826

     General Script Error

     Execution Failed

We are getting the above error while the applicaton reload via QEMC. Have you found any solution for this and why this is happening.

Thanks in advance.

Arunesh

helgeantonsen
Partner - Contributor
Partner - Contributor

Hi,

I have also this problem latest described 13. September 2011, but can't see any solutions in this threat.

helgeantonsen
Partner - Contributor
Partner - Contributor

My problem is solved. I used ODBC connection in stead of OLE DB connection.  Probably an old SQL server or driver. If you also have this problem you can try.