Re: syntax variable question

  • From: Maxim Demenko <mdemenko@xxxxxxxxx>
  • To: orcl@xxxxxxxxxxx
  • Date: Wed, 19 Apr 2006 09:28:49 +0200

orcl schrieb:

Hi, Im trying to get a variable passed , something is obviously wrong as every combination I've tried failed.
Any suggestions for this simple syntax ?


set serveroutput on
DECLARE
ranon varchar2(14);
BEGIN
select to_char(sysdate, 'YYYYMMDDHH24MISS')INTO ranon from dual;
execute immediate 'ALTER DATABASE backup CONTROLFILE to trace as '||ranon||'ctl';
-- DBMS_OUTPUT.PUT_LINE(ranon);
END;
/


sorry I dont post much, I lurk ;-)

thanks!
bob
--
//www.freelists.org/webpage/oracle-l



This should work
DECLARE
ranon varchar2(14);
BEGIN
select to_char(sysdate, 'YYYYMMDDHH24MISS')INTO ranon from dual;
execute immediate 'ALTER DATABASE backup CONTROLFILE to trace as '''||ranon||'.ctl''';
-- DBMS_OUTPUT.PUT_LINE(ranon);
END;
/


Backup  will be written not to the udump, but to $ORACLE_HOME/dbs

Best regards

Maxim
--
//www.freelists.org/webpage/oracle-l


Other related posts: