Hi all,
I am working on User Defined Structured Types. Here are the sqls for creating types and using it in a table.


CREATE TYPE db2admin.Person_t AS (Name VARCHAR(20), Age INT, Address VARCHAR(200)) INSTANTIABLE REF USING VARCHAR(13) FOR BIT DATA MODE DB2SQL

create table db2admin.emp (ID INT, EMP_DETAILS db2admin.Person_t)

CREATE FUNCTION db2admin.person_to_sql (A DB2ADMIN.PERSON_T) RETURNS ROW(Name VARCHAR(20), Age INT, Address VARCHAR(200)) LANGUAGE SQL RETURN values(A..Name, A..Age, A..Address)

CREATE FUNCTION db2admin.person_from_sql(Name VARCHAR(20), Age INT, Address VARCHAR(200)) RETURNS DB2ADMIN.PERSON_T LANGUAGE SQL CONTAINS SQL RETURN DB2ADMIN.PERSON_T()..Name(Name)..Age(Age)..Address (Address)

CREATE TRANSFORM FOR DB2ADMIN.PERSON_T DB2_PROGRAM (TO SQL WITH FUNCTION db2admin.person_from_sql, FROM SQL WITH FUNCTION db2admin.person_to_sql)


Now for getting the contents of table I am running the following query from command center

SELECT * from db2admin.emp

and getting the following Error Message. Can any body tell what is wrong in the whole process ..

SQL0390N The function "DB2ADMIN.PERSON_TO_SQL" resolved to
specific function "SQL040408135726000
" that is not valid in the context where it is used.