Home » SQL & PL/SQL » SQL & PL/SQL » creating sequences for all tables in the database at a time (creating sequences for all tables in the database at a time)
creating sequences for all tables in the database at a time [message #274201] Mon, 15 October 2007 01:25 Go to next message
novice1
Messages: 15
Registered: September 2007
Junior Member
Hi ,

I need to create sequences for all the tables in my database.
i can create individually ,using toad and sqlplus.
Can any one give me a code for creating the sequences dynamically at a time for all the tables.

My oracle database is 10g.

it is urgent ..

Regards.
Re: creating sequences for all tables in the database at a time [message #274211 is a reply to message #274201] Mon, 15 October 2007 01:58 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
You could use SQL to generate the SQL for you. Have you tried something like:
SELECT 'CREATE SEQUENCE '||table_name||'_SEQ START WITH 1 INCREMENT BY 1;'
FROM   user_tables
You can spool that to a file and run the file afterwards.

sudhir_83k wrote on Mon, 15 October 2007 08:25

it is urgent ..
No it is not. Not to me. Don't do that. It's impolite and will act against you Wink.

MHE
Re: creating sequences for all tables in the database at a time [message #274218 is a reply to message #274201] Mon, 15 October 2007 02:17 Go to previous message
novice1
Messages: 15
Registered: September 2007
Junior Member
thanks..Maheer
Previous Topic: Premature EOF encountered, no trailer found
Next Topic: Exiting from sqlplus when there is any errors while compiling pl/sql programs
Goto Forum:
  


Current Time: Fri Feb 14 09:56:48 CST 2025