Home » SQL & PL/SQL » SQL & PL/SQL » Use SQLPLUS Variable in DDL Command (Oracle 10G)
Use SQLPLUS Variable in DDL Command [message #396059] Fri, 03 April 2009 12:13 Go to next message
bholeuday
Messages: 28
Registered: April 2009
Location: Talavali
Junior Member

Hi I have a requirement like i have to use SQLPLUS Variable in DDL statement like below

create table abc (a varchar2(32))
tablespace v_tab_tablespace;

(v_tab_tablespace is SQLPLUS variable which holds valid tablespace name)

also value in variable v_tab_tablespace should be selected from SQL Statement. (Not from PL/SQL like SELECT INTO)

Please help.

Thanks & Regards

Uday
Re: Use SQLPLUS Variable in DDL Command [message #396060 is a reply to message #396059] Fri, 03 April 2009 12:17 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL*Plus substitution variable or SQL*Plus bind variable?

Regards
Michel
Re: Use SQLPLUS Variable in DDL Command [message #396063 is a reply to message #396059] Fri, 03 April 2009 12:22 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
Write SQL to write SQL.

Search this forum.

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Re: Use SQLPLUS Variable in DDL Command [message #396066 is a reply to message #396059] Fri, 03 April 2009 12:43 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> col ts new_value ts
SQL> select 'TEST' ts from dual;
TS
----
TEST

1 row selected.

SQL> create table tt (col number) tablespace &ts;

Table created.

SQL> select tablespace_name from user_segments where segment_name='TT';
TABLESPACE_NAME
------------------------------
TEST

1 row selected.

Regards
Michel
Re: Use SQLPLUS Variable in DDL Command [message #396073 is a reply to message #396066] Fri, 03 April 2009 13:20 Go to previous message
bholeuday
Messages: 28
Registered: April 2009
Location: Talavali
Junior Member

Thanks a Lot Michel...
your reply has solved my problem.
Previous Topic: Procedure Creation : Hanging in Parse phase (merged)
Next Topic: sql problem
Goto Forum:
  


Current Time: Sat Dec 03 10:02:21 CST 2016

Total time taken to generate the page: 0.30836 seconds