These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Using Oracle Database function
PostPosted: Sun Nov 01, 2009 9:57 pm 
Newbie

Joined: Sun Nov 01, 2009 9:49 pm
Posts: 1
I might have posted this question in the wrong section, I'm not sure.

I have created a function using sample code I found online to split string values in a comma separated field in the database. The values in the database are read into a parameter in a stored procedure and the stored procedure is meant to call the function to split the comma separated values into individual values.

This is the function I am using:

create or replace FUNCTION PARAMSPLIT
(
p_list VARCHAR2
, p_del VARCHAR2:= ','
, SPLIT_TBL VARCHAR2

)
RETURN SPLIT_TBL PIPELINED
IS
l_idx pls_integer;
l_list varchar2(32767) := p_list;
SPLIT_TBL:= SPLIT_TBL;
--AA
l_value varchar2(32767);
BEGIN
LOOP
l_idx := instr(l_list,p_del);
if l_idx > 0 then
pipe row(substr(l_list,1,l_idx-1));
l_list := substr(l_list,l_idx+length(p_del));

else
pipe row(l_list);
exit;
end if;
END LOOP;

RETURN;
END PARAMSPLIT;


I am getting the following error when I compile the function:

Error(13,12): PLS-00103: Encountered the symbol "=" when expecting one of the following: constant exception <an identifier> <a double-quoted delimited-identifier> table LONG_ double ref char time timestamp interval date binary national character nchar The symbol "<an identifier>" was substituted for "=" to continue.

Would someone be able to help me?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.