MySQL Forums
Forum List  »  General

Re: MySQL Stored Procedures
Posted by: raji
Date: February 16, 2005 09:58PM

Hi...

Thanx for ur response....
Your site 'http://mysql.gilfster.com/'; is very useful......
My procedure is as follows...

Create procedure proc()
begin
declare count int;
select max(num) into count;
delete from table1 where num<count-5;
end

My aim is that the table should contain the most recently inserted 5 records only. I want to delete all other records. The table is table1(qty int,price int,num int auto_increment)

After the 1st call to this procedure, the output is perfect. But from 2nd time onwards I got the error

'ERROR 1172 (42000): Result consisted of more than one row'

Can u help me???

Expecting reply.....
Regards,
Raji

Options: ReplyQuote


Subject
Written By
Posted
January 30, 2005 03:36PM
February 16, 2005 12:28AM
February 16, 2005 12:48PM
February 16, 2005 10:53PM
Re: MySQL Stored Procedures
February 16, 2005 09:58PM
February 17, 2005 10:42AM
February 17, 2005 10:49PM
February 18, 2005 03:34AM
March 01, 2005 03:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.