Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: VARRAY Object types for Numbers, how to avoid roundoff?
Thanks for looking at my problem, I am using Oracle 8.0.5.0.0. Here are the
declarations I used and a simple INSERT followed by a SELECT showing the
rounded values which are supposed to be in NUMBER(6,2). Is there another
way to retrieve collection type data from the database?
Thanks, Dan
Test SELECTS show the comparison method is working properly.
CREATE TYPE TDI_param_array_t AS VARRAY(100) OF NUMBER(6,2);
CREATE TYPE TDI_parameters_t AS OBJECT (
TDI_param_array TDI_param_array_t, ORDER MEMBER FUNCTION isEqual (TDI_obj TDI_parameters_t) RETURNINTEGER
desc TDI_parameters
Name Null? Type ------------------------------- -------- ---- TDI_ID NOT NULL NUMBER(4) TDI_PARAM TDI_PARAMETERS_T INFILE NUMBER(1) TDI_RISE_RATE NUMBER(6,2)
INSERT INTO TDI_parameters VALUES ( 3, TDI_parameters_t(TDI_param_array_t(1.1, 2.2, 3.3, 4.4, 5.5, 6.6)), 1, 12.23);
1 row created.
SELECT TDI_param from TDI_parameters WHERE TDI_param = TDI_parameters_t(TDI_param_array_t(1.1, 2.2, 3.3, 4.4, 5.5, 6.6));
TDI_PARAM(TDI_PARAM_ARRAY)