Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Oracle Split Function

Re: Oracle Split Function

From: Norman Dunbar <norman.dunbar_at_environment-agency.gov.uk>
Date: Tue, 31 Jan 2006 09:56:25 +0000
Message-Id: <s3df345e.030@environment-agency.gov.uk>

Morning,

I did this ages ago - it might be useful.

create or replace function xxnd_basename(iFullName in varchar2) return varchar2
as

	vSlash number := 0;
	vSize number := 0;

begin
	vSlash := instr(iFullName, '\', -1);
	if (vSlash = 0) then
		return iFullName;
	end if;

	vSize := length(iFullName);
	return substr(iFullName, 1+ vSlash, vSize - vSlash);
end;
/

Testing :

select xxnd_basename(file_name) from dba_data_files;

Cheers,
Norm.

Norman Dunbar.
Contract Oracle DBA.
Rivers House, Leeds.

Internal : 7 28 2051
External : 0113 231 2051

>>> "Subbiah, Nagarajan" <Nagarajan.Subbiah_at_aetn.com> 01/30/06 04:14pm
>>>

Hi List,

Which SQL function can help me get the file name from a string like this
"C:\program files\my apps\2005\reports_New.doc".?Do We have any split function in Oracle? We are at Oracle 9.2.0.5.

Thanks,
Raja.

--
http://www.freelists.org/webpage/oracle-l 



Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.

We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation.  Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506.  Find out more about the Environment Agency at www.environment-agency.gov.uk
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 31 2006 - 03:56:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US