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: syntax variable question

Re: syntax variable question

From: Domingo Diaz Saenz <domingo.diazs_at_gmail.com>
Date: Wed, 19 Apr 2006 09:13:04 +0200
Message-ID: <990cd870604190013h2fa7f8dwb8d456a773720ca7@mail.gmail.com>


Hi Bob,

You can try this code:

DECLARE
ranon varchar2(16);
BEGIN
select to_char(sysdate, 'YYYYMMDDHH24MISS') INTO ranon from dual; execute immediate 'ALTER DATABASE backup CONTROLFILE to trace as '''||ranon||'.ctl''';
END;
/

Best Regards
On 4/19/06, orcl <orcl_at_comcast.net> wrote:
>
> 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
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
Domingo Diaz Saenz

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Apr 19 2006 - 02:13:04 CDT

Original text of this message

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