Here is an example of how to invoke the table function with constant expression input arguments and get a result row with four columns:
SELECT * FROM TABLE (get_data('1356,122,20061009,abc') RETURNS (col1 INTEGER, col2 BYTEINT, col3 DATE, col4 VARCHAR(5))) AS t1;
Here is another example of how to invoke the table function with constant expression input arguments and get a result row with three columns:
SELECT * FROM TABLE (get_data('1234,56,20061010') RETURNS (col1 INTEGER, col2 BYTEINT, col3 DATE)) AS t1;
Here is an example of how to invoke the table function using the columns from a derived table as input arguments:
SELECT tf.col1, tf.col2, tf.col3, tf.col4 FROM raw_cust, TABLE (get_data(raw_cust.text) RETURNS (col1 INTEGER, col2 BYTEINT, col3 DATE, col4 VARCHAR(5))) AS tf;
Here is the definition of the raw_cust table:
CREATE TABLE raw_cust (C1 INT, text VARCHAR(30)); INSERT INTO raw_cust (1,'1356,122,20061009,abc');