Home » SQL & PL/SQL » SQL & PL/SQL » Java TABLE function in Oracle
Java TABLE function in Oracle [message #214466] Tue, 16 January 2007 09:44 Go to next message
Messages: 3
Registered: January 2007
Junior Member

Are external language Table functions available in Oracle? I know, that you can write Table functions in PL/SQL in Oracle, but can you write a Table function in Java?

A Table function is a function that returns a Table. I am not even able to compile an sql statement like this:

FUNCTION testfn (a NUMBER) return TABLE
as LANGUAGE JAVA NAME 'test.testfn(int) return java.sql.Array';

It is saying

Error(1,38): PLS-00103: Encountered the symbol "TABLE" when expecting one of the following: <an identifier> <a double-quoted delimited-identifier> SELF_ LONG_ double ref char time timestamp interval date binary national character nchar The symbol "<an identifier> was inserted before "TABLE" to continue.

DB2 allows table functions to be written in java. Is there a way around in Java for this. I need to return multiple values from a java function. So the table function is the only answer.

Re: Java TABLE function in Oracle [message #214487 is a reply to message #214466] Tue, 16 January 2007 13:22 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member

Add these 2 lines to your function to make sure the buffers you need are enabled.
   DBMS_OUTPUT.ENABLE (1000000); 
   dbms_java.set_output (1000000); 

[Updated on: Tue, 16 January 2007 13:22]

Report message to a moderator

Previous Topic: need urgent help !!!
Next Topic: PLS-00123: program too large
Goto Forum:

Current Time: Thu Oct 27 21:46:26 CDT 2016

Total time taken to generate the page: 0.05055 seconds