Function Error [message #162379] |
Fri, 10 March 2006 00:06 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
amkotz
Messages: 72 Registered: May 2005 Location: Bangalore
|
Member |
|
|
hi , i am using a function which has OBJECT AND TABLE types.
i.e. Nested Tables and Varrays.
The function works fine in SQL*Plus.
I want to write the function in forms, but dont know how to write.
I am using Forms 10g.
The function is:PROMPT Type creation
CREATE TYPE vc2_type AS OBJECT ( the_value VARCHAR2(255));
/
CREATE TYPE vc2_tab AS TABLE OF vc2_type;
/
PROMPT Function creation
CREATE OR REPLACE FUNCTION string_to_tab(piv_string IN VARCHAR2, piv_delimiter IN VARCHAR2)
RETURN vc2_tab PIPELINED DETERMINISTIC
IS
v_string VARCHAR2(4000) DEFAULT piv_string;
v_offset PLS_INTEGER;
BEGIN
LOOP
v_offset := INSTR(v_string, piv_delimiter);
IF v_offset > 0 THEN
PIPE ROW ( new vc2_type( SUBSTR(v_string, 1, v_offset-1)
)
);
v_string := SUBSTR(v_string, v_offset+1, LENGTH(v_string));
END IF;
EXIT WHEN v_string Is NULL OR v_offset = 0;
END LOOP;
IF v_string is not null then
PIPE ROW ( new vc2_type( v_string ) );
END IF;
RETURN;
END string_to_tab;
/ Problem is the Return statement of TABLE type.
I am not getting how to write in the forms .Some Syntax error.
Thanks in Advance,
Amkotz
[Updated on: Mon, 13 March 2006 00:18] by Moderator Report message to a moderator
|
|
|
|
|