I have searched the forum, but didn’t found any help about this.
Can someone please tell me how I can call a user defined function (from my MS SQL 2000 Server) in Data Integrator ?
Example :
I have a table with all Company names. With the database user defined function (namefilter) I filter these names. The filtered name is also stored in the table.
So I tried to map this column as follows, but it doesn’t work, I always get an error of incorrect syntax.
Here is the code I try to use in the mapping of the query :
Go to any query, the output schema and right click. In the popup menu, you can add new columns, modify properties or add a “New Function Call”. In the wizard shown next, select the datastore and its stored procedure.
I haven’t checked with XI, but with 6.5, I don’t think DI properly pushes down the SQL Server user-defined function to the database, and instead calls it individually, separately, for each incoming row.
The way to verify this would be to look at the generated SQL for the dataflow and see if it’s doing a
select blah, blah, NAMEFILTER(blah)
from YOUR_TABLE
I can see why this might be: If it is a stored procedure, you can’t use it inline with SQL. And when you import a stored procedure or a SQL function, DI doesn’t seem to know the difference between the two. So it treats everything like a stored procedure.
Maybe the enhancement would be: after importing the function into DI, if you could tick a checkbox that said “allow inline pushdown”…