Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
riho92qv
Contributor III
Contributor III

SQL function in script

Hi

Is it possible to call the sql function with parameters in QlikView script. I've used the stored procedure call and it works. 

Is the only option is to change the sql function  to stored procedure.

Riho

5 Replies
riho92qv
Contributor III
Contributor III
Author

To clarify, this is a Table valued SQL function.

riho92qv
Contributor III
Contributor III
Author

https://community.qlik.com/t5/New-to-QlikView/Reading-data-from-SQL-table-valued-function/td-p/80419...

There is something on the same subject here, but I do not see a workable solution here either

riho92qv
Contributor III
Contributor III
Author

I found a solution to my problem or rather my error, it is definitely necessary to add the name of the database when calling the function. Calling tables and views doesn't need that, that's why I made a mistake.

LOAD
*;
SELECT * FROM [database_name].[dbo].[sqlfunction_name] (parameters);

riho92qv
Contributor III
Contributor III
Author

Unfortunately, I was wrong again, the database name is always needed. Because I tried to call a function for the first time, then I just forgot it and looked elsewhere for an error. Maybe someone other than me learned from this mistake.

Brett_Bleess
Former Employee
Former Employee

In general the issues with these types of things stem from the ability of the DB connector being able to handle the call back to the DB, and in most cases, that connector is likely not our product, so you might need to check the connector vendors site for info as well to see if you can track something down there.  Hopefully this may help you find something on their site.  If you are using a Qlik connector, be sure to check the Help content on the connector at the help.qlik.com site in that case, as they are pretty well documented as to what they can do and parameters they can handle.  Sorry I do not have anything better for you.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.