Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Creating a Table with a variable in the name?
set -e
$ORACLE_HOME/bin/sqlplus /NOLOG >> $LOGFILE 2>&1 <<-END
whenever SQLERROR CONTINUE
whenever OSERROR CONTINUE
conn system/$SYSTEMPASSWORD;
drop tablespace ABS_AUDIT INCLUDING CONTENTS;
drop tablespace ABS_DATA INCLUDING CONTENTS;
drop tablespace ABS_INDEX INCLUDING CONTENTS;
whenever SQLERROR exit 2
whenever OSERROR exit 2
CREATE TABLESPACE abs_data
DATAFILE '$DATAFILEPATH1/$DBNAME/abs_data_1.dbf'
SIZE 100M reuse
DEFAULT STORAGE (INITIAL 10K NEXT 10K MINEXTENTS 1 PCTincrease 0) ;
END Works for tablespaces. should work for tables.
Also PL/SQL provides DBMS_SQL.EXECUTE and DBMS_SQL.BIND_VARIABLE
Iain
"jennetta" <jennetta_at_NOSPAM.hotmail.com> wrote in message
news:WZlk5.18980$c8.5234842_at_typhoon-news1.southeast.rr.com...
> I'm trying to script the creation of table to be used for backing up some
> data. I want the table to include the value of SYSDATE, named something
> like backup_table_20000809. I got the value of SYSDATE going into a
> variable but I can't see how to create the table with a name partially
> composed of the value of a variable. Any ideas?
>
> Thanks in Advance!
>
>
Received on Thu Aug 10 2000 - 00:00:00 CDT
![]() |
![]() |