All Forums Extensibility
terausr123 9 posts Joined 04/12
06 May 2012
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?

Jim Chapman 449 posts Joined 09/04
09 May 2012

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.

terausr123 9 posts Joined 04/12
13 May 2012

Thank you. I will try that.

You must sign in to leave a comment.