Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Execute SQL Function in Qlikview Script

Hi Qlikview Community!

Has anyone successfuly used a sql function in qlikview?

I have seen a ton of started conversations, but it seems we all get stuck with a permissions error.

(I can execute the function in sql with the same permissions, so I know that is not the true error.)

Hope we can figure this out together!

Thanks!

13 Replies
Anonymous
Not applicable
Author

That was my first thought too, but the connection string is the correct user.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

By wrapping in a view I simply meant creating a view that includes the function.  So to take your example you could have:

CREATE VIEW dbo.MyView

AS

SELECT

Field1,

Field2,

Field3

From Database

Where Database.udf_Table (Field1) = 0

GO

QlikView would then simply load from the view:

LOAD
     Field1,

     Field2,

     Field3

     ;

SQL SELECT

     Field1,

     Field2,

     Field3

FROM dbo.MyView

;


This way the fact that a function is being called is one step removed from QlikView.

You may find that the user requires rights above what they currently have in order to execute the User Defined Function.  Have you tried firing it in Query Analyser whilst logged in as that user?

Steve


rbecher
MVP
MVP

I think this makes it more complicated because now you have two database objects where you need to grant the rights. The original SQL statement should be fine and will not be touched by QlikView. It's just passed thru the ODBC/OLEDB connection. Of course there could be an issue although..

Astrato.io Head of R&D
Not applicable
Author

Friends, I have a similar situation. Do we have any standard procedure for executing the SQL table function.