Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Request PL/SQL Help
I am trying to parse a string that contains an email address of a certain domain, say "abc.com". The string could contain many addresses, and in any order. I have written a PL/SQL program to do it, but it's not working quite right. Can someone spot my error? Here is the PL/SQL, and some test data.
CREATE OR REPLACE FUNCTION getourmail( email_in IN TEST.EMAIL_ADDR%TYPE,domain_in IN VARCHAR2)
RETURN VARCHAR2
IS
end_of_address NUMBER := 0; beg_of_address NUMBER := 0; string VARCHAR2(1000) := email_in;
insert into test values
('jim_at_abc.com,jim_at_pqr.com');
insert into test values
( 'jim_at_pqr.com,jim_at_abc.com');
insert into test values
( 'jim_at_pqr.com,jim_at_abc.com,jim_at_tuv.com');
commit;
select email_addr,getourmail(email_addr,'abc.com') from test Received on Tue Jan 23 2001 - 19:40:06 CST