friends,
in oracle, one can define a RECORD type which is collection of attributes of built-in data type and it can be used as the data type of a parameter to a procedure...
i'm trying to find out the equivalent in DB2... i tried to create a user-defined data type and used it as the data type of a parameter in the procedure...
DB2 throws an error saying (DB2 UDB v8.1.3 windows 2000)
------------------------------------------------------------------------
SQL0789N The data type for the parameter or variable "TESTTYPE" is not supported in the SQL routine
<b>The DB2 docs says:</b>
SQL0789N The data type for parameter or variable "<name>" is not supported in the SQL routine.
Explanation: The SQL routine (function, method, or procedure) does not support variables or parameters of DATALINK, REFERENCE, DISTINCT, STRUCTURED, or LOB data types.
User Response: Do not use SQL variables or parameters of DATALINK, REFERENCE, DISTINCT, STRUCTURED, or LOB data types in the SQL routine definition. Specify a different data type for the parameter or variable "<name>".
sqlcode: -789
sqlstate: 429BB
------------------------------------------------------------------------
where am i going wrong? can anyone help me to find out the equivalent?
my procedure and type are as follows:
------------------------------------------------------------------------
CREATE TYPE TESTTYPE
AS
(
ATTR1 VARCHAR(20),
ATTR2 INT,
ATTR3 CHAR(1)
)MODE DB2SQL
@
CREATE PROCEDURE TESTTYPEPROC(PARAM1 TESTTYPE)
LANGUAGE SQL
BEGIN
DECLARE DUMMY VARCHAR(10);
SET DUMMY = 'TEST';
END
@
------------------------------------------------------------------------
Jake