Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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
Not applicable
Author

Hi,

I usually just pull all the fields I need and then in the preload i use qlikview functions.

You can give that a whirl.

Thanks

AJ

rbecher
MVP
MVP

What kind of SQL function? Can you post an example..

Astrato.io Head of R&D
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Is this a table based function or a scalar based function?  Have you tried wrapping the output from the function in a view?

I would try going to the Settings tab on the load script and tick the Open Databases In Read Write Mode tick box and add the text (mode is write) after the connection string (between the ] and the ; .

Hope one of these things helps.

Steve

MK_QSL
MVP
MVP

You can use QlikView Function by preceding load.

OLEDB CONNECT32 TO .....:

LOAD

     DepartmentID,

    Name,

    GroupName,

    Date,

     Month(Date) as Month,

     Year(Date) as Year;

SQL SELECT

    DepartmentID,

    Name,

    GroupName,

    Date

FROM TableName;

rbecher
MVP
MVP

Uh.., dangerous write mode.. Usually this shouldn't be needed to execute a function.

Astrato.io Head of R&D
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Personally I tend to avoid using write mode - I can only think of one case where I have had to (the only access I was given to the database was to a Stored Procedure that did some inserts before returning any data) but it is worth trying it to see if the function works.

Anonymous
Not applicable
Author

Hi Ralf,

I am trying to work with a user defined function.  Here is generic example, hope it paints the picture:

LOAD

Field1,

Field2,

Field3;

SQL

SELECT

Field1,

Field2,

Field3

From Database

Where Database.udf_Table (Field1) = 0

Anonymous
Not applicable
Author

I haven't tried wrapping - not sure what that entails.

Write mode is not an option for me, as the user base cannot have those rights.

rbecher
MVP
MVP

Maybe you're using a different database user in QlikView connection?

Astrato.io Head of R&D