SQL script doesn't accept folder name in a variable
Hi there,
i wrote a simple sql script, that determine the database folder an store it in a variable (see code).
--- snip ---
-- Creating RedoLog file for a database instance
-- select statement gets the database folder
set echo off feedback off heading off underline off newpage none;
var f_name varchar2(513);
declare
f_name varchar2(513) :='test123';
begin
--select Name
select distinct regexp_substr(name,'^.*\\') || 'redo4.log'
into :f_name
from v$datafile;
end;
/
Print :f_name;
ALTER DATABASE ADD LOGFILE GROUP 4 (:f_name) SIZE 250M;
--- snip ---
The variable "f_name" contains the folder and the filename of the redo log (M:\ORADATA\MYDATABASE\redo4.log).