Free Blog |  HTTPPoint discussion forum |  Recreation vehicle insurance |  Casino news |  Debt Info |  Debt Info(uk) |  Computer Info |  History of computer |  Flight Simulator | 

PDA

View Full Version : Re: function and procedure


Luuk
06-17-2008, 03:31
"Séverin Richard" <severin.richard@free.fr> schreef in bericht
news:46e26590$0$32451$426a74cc@news.free.fr...
> Hi,
>
> I want to insert in an empty table, 75 records with autoincrement:
> __________________________________
> mytable: empty
>
> "a mysterios proc"
>
> mytable: 75 records ( 0-74 or 1-75 )
> id_mytable (autoincrement) secondaryfield
> 0 --
> 1 --
> 2 ...
> 3
> ....
>
>
> __________________________________
> I try:
> insert into mytable (secondaryfields )
> select 1 limit 0,75
>
> then autoinc will increment my table with
> (id_table:autoinc, scondaryfield:1).
> But this inserts only one record. I have to repeat this query 75 times!!!
> ___________________________________
>
> I see procedure and functions in mysql_manual, BEGIN END, but how to make
> a FOR or a WHILE???
>
> Any idears?? THX

the output of 'select 1 limit 0,75' is only 1 record

your insert statment will work i you it with this query:
select 1 from some_huge_table_containing_at_least_75_records limit 0,75

(and of course, the table 'some_huge_table_containing_at_least_75_records'
contains at least 75 records....)

Free Blog |  HTTPPoint discussion forum |  Recreation vehicle insurance |  Casino news |  Debt Info |  Debt Info(uk) |  Computer Info |  History of computer |  Flight Simulator | 
Fridges
Get your fridges from pricerunner.

Find jobs
Find jobs, services, gigs - It's the best place who looking for a job and it's free to post, no registration needed.