Unix Technical Forum

generating lots of sample records

This is a discussion on generating lots of sample records within the MySQL forums, part of the Database Server Software category; --> I want to generate a bunch (10000-100000) of sample records in a table with IDs from N to N+K-1. ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:42 AM
Jason S
 
Posts: n/a
Default generating lots of sample records

I want to generate a bunch (10000-100000) of sample records in a table
with IDs from N to N+K-1. which is equivalent to:

insert into `mytable`.`myfield` (id) values (2000),(2001),(2002),
(2003),(2004);

except instead of having to write out numbers manually, I want to
generate records automatically. Here N = 2000, K=5.

what's the easiest way to do this? (preferably in sql but if there is
another easy way, I'm open to hearing it)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:42 AM
strawberry
 
Posts: n/a
Default Re: generating lots of sample records

On Apr 27, 5:24 pm, Jason S <jmsa...@gmail.com> wrote:
> I want to generate a bunch (10000-100000) of sample records in a table
> with IDs from N to N+K-1. which is equivalent to:
>
> insert into `mytable`.`myfield` (id) values (2000),(2001),(2002),
> (2003),(2004);
>
> except instead of having to write out numbers manually, I want to
> generate records automatically. Here N = 2000, K=5.
>
> what's the easiest way to do this? (preferably in sql but if there is
> another easy way, I'm open to hearing it)



I don't know if it's exactly what you're after, but back in June of
last year Giuseppe Maxia describe a method for doing this sort of
thing with dates, words and numbers all purely within mysql.

http://tinyurl.com/26xf2j

HIH

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 10:42 AM
Jason S
 
Posts: n/a
Default Re: generating lots of sample records

On Apr 28, 9:22 am, strawberry <zac.ca...@gmail.com> wrote:
> I don't know if it's exactly what you're after, but back in June of
> last year Giuseppe Maxia describe a method for doing this sort of
> thing with dates, words and numbers all purely within mysql.
>
> http://tinyurl.com/26xf2j
>
> HIH


thanks, that's the kind of thing. clever!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:22 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com