Insert data into database from a UDF

Extensibility

Insert data into database from a UDF

Hallo everybody

I would like to read a lot of images, get some information out of them and store these information into the database.

The tutorial about image processing with JUDF sounds great but still leaves me with a problem:

Is it possible to write data from a JUDF into the database?

So I don't need a return value but I will have several columns in a table I would like to fill from within the JUDF.

Of course I could write a JUDF with a return type for each column and insert the data per

INSERT INTO ... select myJUDF1() ...

INSERT INTO ... select myJUDF2() ...

statements. But That would just make the whole process slow.

What do you recommend as the best solution for writing information into the database from within a JUDF?

2 REPLIES

Re: Insert data into database from a UDF

You can write a table UDF.  A table function may be invoked in the FROM clause of a query.  Unlike a scalar function, a table function returns a table.  See the topic "Table UDFs" under "Chapter 4 Java User-Defined Functions" in the SQL External Routine Programming volume of the Teradata user documentation set.

Re: Insert data into database from a UDF

Thank you. I will try that.