Home » SQL & PL/SQL » SQL & PL/SQL » Populate a table with multiple records (any)
Populate a table with multiple records [message #390271] Thu, 05 March 2009 12:30 Go to next message
gkrishn
Messages: 506
Registered: December 2005
Location: Putty a dark screen
Senior Member
I want to populate a table with say 500 records for learning purpose and do some perfomance tuning tests.
here is the table i created
SQL> desc employee
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 NAME                                               VARCHAR2(10)
 ID                                                 NUMBER
 AGE                                                NUMBER
 DEPT                                               VARCHAR2(10)


Can someone help me iwht a pl/sql or cursor , to insert 500 records , i want only ID column to be incremental .rest of the data can be same. Any help would be appreciated.
Re: Populate a table with multiple records [message #390276 is a reply to message #390271] Thu, 05 March 2009 12:42 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Search the forum.
There are several versions available.
Easiest being selecting from a dictionary view like dba_extents and insert into your table.
Re: Populate a table with multiple records [message #390277 is a reply to message #390271] Thu, 05 March 2009 12:43 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Post what you already tried.
Row generator is a FAQ and you must search before posting.

Regards
Michel
Re: Populate a table with multiple records [message #390279 is a reply to message #390271] Thu, 05 March 2009 12:56 Go to previous messageGo to next message
BlackSwan
Messages: 25038
Registered: January 2009
Location: SoCal
Senior Member
>I want to populate a table with say 500 records for learning purpose and do some perfomance tuning tests.
Good luck, but realize that 500 may be much too small to be able to measure time differences between alternatives.
Re: Populate a table with multiple records [message #390283 is a reply to message #390271] Thu, 05 March 2009 13:11 Go to previous messageGo to next message
gkrishn
Messages: 506
Registered: December 2005
Location: Putty a dark screen
Senior Member
Yeah, i just want to learn tkprof, statspack etc... i will add more records,indexes etc.. to check perfomance Smile

i still hav no luck in populating table, trying to dig more with plsql loops.
Re: Populate a table with multiple records [message #390285 is a reply to message #390283] Thu, 05 March 2009 13:13 Go to previous message
trivendra
Messages: 208
Registered: October 2007
Location: Noida, India
Senior Member
Row generator is a FAQ and you must search before posting


Search for the same as suggested by Michel.

Thanks
Trivendra
Previous Topic: manipulate the decode function?
Next Topic: Timer
Goto Forum:
  


Current Time: Mon Dec 05 12:47:44 CST 2016

Total time taken to generate the page: 0.05095 seconds