Sure,
Here it is:
set serveroutput on;
spool d:\temp.sql;
accept var_a char prompt 'Enter new location:'
declare
temp varchar2(520);
i number;
startpos number;
cursor cur1 is select name from v_$datafile;
local_var varchar2(100) := &var_a;
begin
DBMS_OUTPUT.ENABLE(10000);
open cur1;
loop
fetch cur1 into temp;
i:= instr(temp,'\');
startpos:= 0;
while i<>0 loop
startpos:= i+1;
i:= instr(temp,'\',startpos);
end loop;
dbms_output.put_line('alter database rename file ' || temp ||
local_var ||substr(temp,startpos) ||';');
exit when cur1%notfound;
end loop;
close cur1;
end;
/
spool off;
Steven H.
-----Original Message-----
Gennick
Sent: 18 September 2001 19:25
To: Multiple recipients of list ORACLE-L
Tuesday, September 18, 2001, 1:30:17 PM, you wrote:
SH> I'm am trying to use an accept statement to grab some info from the user
in
SH> an SQL script,
SH> and then use that in a subsequent PL/SQL block. I can do the Accept ok,
but
SH> can't sem to
SH> access the variable onside the block. Can anyone point me in the right
SH> direction?
Can you post the part of your script in which you are doing
this?
Best regards,
Jonathan Gennick
mailto:[EMAIL PROTECTED] * 906.387.1698
http://Gennick.com * http://MichiganWaterfalls.com * http://MetalDrums.org
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Steven Hovington
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).