LeonelSanchezJr
Programmer
My code is the following
SET DESTFN = STUFF(DESTNAME,CHARINDEX('200',DESTFN),8,@DATE)
Thanks,
Leo ;-)
SET DESTFN = STUFF(DESTNAME,CHARINDEX('200',DESTFN),8,@DATE)
Thanks,
Leo ;-)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT STUFF('abcdef', 2, 3, 'ijklmn')
GO
Copy Code
---------
aijklmnef
(1 row(s) affected)
create or replace function stuff
(str_in varchar2, beg number, len number, str_new varchar2)
return varchar2
is
begin
return substr(str_in,1,beg-1)||str_new||substr(str_in,beg+len);
end;
/
Function created.
SQL> select * from leo;
TXT
------------------------------
abc20070401pdfreport.pdf
somemore20070401pdfreport.pdf
andsomelonger20070401xlrpt.pdf
someshorter20070401.pdf
xyz20070401somelonger.pdf
col result format a30
select stuff(txt,instr(txt,'200'),8,to_char(sysdate,'yyyymmdd')) result from leo;
RESULT
------------------------------
abc20070417pdfreport.pdf
somemore20070417pdfreport.pdf
andsomelonger20070417xlrpt.pdf
someshorter20070417.pdf
xyz20070417somelonger.pdf
************************************************************************