Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

oracle user function - how to end

User_QCDJEJan 24 2020 — edited Jan 25 2020

Hi,

I have the script below:

----------------------------------------------------------

CREATE OR REPLACE FUNCTION uf_getInnerText(expr in varchar2, tagname in varchar2) 
RETURN varchar2 is
begin

declare

begin_tag varchar(20) := '<' + tagname + '>' ;
end_tag varchar(20) :=  '</' + tagname + '>' ;
tagnameLength number := length(tagname) + 2;
innerText varchar(20) := SUBSTR(expr, instr(expr, begin_tag) + tagnameLength, instr(expr, end_tag) - instr(expr, begin_tag) - tagnameLength);

return innerText;

END  uf_getInnerText;

-------------------------------------------------------------

It's getting the error

19/1      PLS-00103: Encountered the symbol "END" when expecting one of the following:     begin function pragma procedure subtype type <an identifier>    <a double-quoted delimited-identifier> current cursor delete    exists prior

Errors: check compiler log

Please advise.

Thanks!

Comments
Post Details
Added on Jan 24 2020
4 comments
245 views