File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes Function error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Function error" Watch "Function error" New topic
Author

Function error

Shashi Iyy
Greenhorn

Joined: Jun 12, 2008
Posts: 18
Hi All,

I am executing the following function :

CREATE OR REPLACE FUNCTION F_SPLITNTEXTDATA (
P_TEXT_I IN VARCHAR2(4000),
P_DELIMITER_I IN CHAR
)
RETURN TY_SPLITDATAWITHKEYTAB PIPELINED
AS
L_STRING LONG DEFAULT P_TEXT_I || P_DELIMITER_I;
N NUMBER;
I NUMBER;
OUT_REC TY_SPLITDATAWITHKEYOBJ := TY_SPLITDATAWITHKEYOBJ(NULL, NULL);
BEGIN
L_STRING := P_TEXT_I;
I := 1;
N := INSTR (L_STRING, P_DELIMITER_I);
LOOP
EXIT WHEN L_STRING IS NULL OR N=0;

OUT_REC.ROWUID := I;
OUT_REC.VALUE1 := LTRIM (RTRIM (SUBSTR (L_STRING, 1, N-1 )));
PIPE ROW(OUT_REC);
L_STRING := SUBSTR (L_STRING, N + 1);
N := N;
N := INSTR (L_STRING, P_DELIMITER_I);
I := I+1;
END LOOP;
OUT_REC.ROWUID := I;
OUT_REC.VALUE1 := LTRIM (RTRIM (SUBSTR (L_STRING, N+1 )));
PIPE ROW(OUT_REC);
END;
/
SHOW ERRORS;

But,I am getting a error as below :

PLS-00103: Encountered the symbol "(" when expecting
following:
:= . ) , @ % default character
The symbol ":=" was substituted for "(" to continue.

What could be the reason for getting the above error?Am I going wrong somewhere?Please let me know.Thanks in advance.
Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
Try replacing your first four lines with :
CREATE OR REPLACE FUNCTION F_SPLITNTEXTDATA (
P_TEXT_I IN VARCHAR2 ,
P_DELIMITER_I IN CHAR
)
 
Don't get me started about those stupid light bulbs.
 
subject: Function error