Home » Developer & Programmer » Forms » Function Error
Function Error [message #162379] Fri, 10 March 2006 00:06 Go to next message
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

Re: Function Error [message #162396 is a reply to message #162379] Fri, 10 March 2006 00:54 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What error code does your "Some Syntax error" have?
Re: Function Error [message #162675 is a reply to message #162396] Mon, 13 March 2006 00:29 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I think you need to use a block which has its 'Query Data Source Type' defined as a 'procedure'. Store your code in the database and then base your block on it.

I did a google search for '"Query Data Source Type" procedure'. Have a look at http://www.experts-exchange.com/Databases/Oracle/Product_Info/Q_21019264.html.

Also search this forum for the same keywords.

David
Previous Topic: Form6i form calling an other form
Next Topic: How to change passwaord
Goto Forum:
  


Current Time: Fri Sep 20 07:39:21 CDT 2024