Home » SQL & PL/SQL » SQL & PL/SQL » cursoe creation (oracle 9i)
cursoe creation [message #344880] Mon, 01 September 2008 09:35 Go to next message
tannad
Messages: 43
Registered: January 2008
Location: mumbai
Member
I have one table TBLSPACEINFOTBL in which all the table space are defined .
I want to create a tables using the tablespace name from this table .

I decleared a variable
DECLARE
TBSNAME_L1D VARCHAR2(30);
BEGIN
SELECT TBLSPACENAME INTO TBSNAME_L1D FROM TBLSPACEINFOTBL WHERE TBLSPACEID ='L1D';

my create table statement is like this
CREATE TABLE AEMODELSETTINGTBL ( NAME VARCHAR2(50 BYTE), VALUE VARCHAR2(50 BYTE), DESCRIPTION VARCHAR2(200 BYTE) ) TABLESPACE 'TBSNAME_L1D';

how I will create a cursor that will replace the 'TBSNAME_L1D' by the actual tablespace name?
Re: cursoe creation [message #344884 is a reply to message #344880] Mon, 01 September 2008 10:06 Go to previous messageGo to next message
BlackSwan
Messages: 25045
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW the Posting Guidelines as stated in URL above

It is a bad "design" to be generating & executing DDL from PL/SQL.

Data base objects should be created one time only from static SQL
Re: cursoe creation [message #344887 is a reply to message #344880] Mon, 01 September 2008 10:17 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As already been said in your previous topics, for instance:
Michel Cadot wrote on Wed, 12 March 2008 07:03
Now please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Always post your Oracle version (4 decimals).

Regards
Michel


Previous Topic: In Date field null value gets stores like '01/01/0001'
Next Topic: How to access package via DBlink without using Public synonym
Goto Forum:
  


Current Time: Wed Dec 07 16:43:59 CST 2016

Total time taken to generate the page: 0.17880 seconds