List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:May 25 2007 6:53pm
Subject:Re: Need script to populate data.
View as plain text  
In the last episode (May 25), SRM SRM said:
>  Thanks for your help.  I'm not able to ssh into this box - how can I
>  run this script, basically all I have to work with is MySQL Query
>  Broswer.

You can generate data by using a stroed procedure, too.  I prefer this
method because it doesn't require any external software:

drop procedure if exists populate;
delimiter //
create procedure populate()
begin
  declare i int;

  set i = 0;
  start transaction;
  while i < 10000 do
    insert into mytable (forumid, styleid, title, title_clean, description,
description_clean, options)
      values (i, i, concat("Title",i), concat("Title",i), concat("Desc",i),
concat("Desc",i) , 0);
    set i = i + 1;
    if i % 1000 = 0 then
      start transaction;
    end if;
  end while;
  commit;
end;
//
delimiter ;
call populate();
drop procedure populate;

-- 
	Dan Nelson
	dnelson@stripped
Thread
How to get the table.column in mysql client tab completion? Or feature request to add this.Daevid Vincent25 May
  • Re: How to get the table.column in mysql client tab completion? Orfeature request to add this.Baron Schwartz25 May
    • RE: How to get the table.column in mysql client tab completion? Or feature request to add this.Daevid Vincent25 May
  • Need script to populate data.SRM SRM25 May
  • Need script to populate data.SRM SRM25 May
    • Re: Need script to populate data.Ryan Stille25 May
      • Re: Need script to populate data.SRM SRM25 May
        • Re: Need script to populate data.Dan Nelson25 May