MySQL Forums
Forum List  »  Stored Procedures

Re: Stored procedures - why does this fail ????
Posted by: Jay Pipes
Date: February 13, 2006 04:30PM

takashi_949 wrote:

> Why is there a warning?, and could anyone please
> tell me how I can access details (i.e. msg, err
> level etc) about thi warning?

SHOW WARNINGS;

The problem with your insert part is that it will never be executed. Try this instead:

Delimiter $
create procedure sp_addWhoisInfo(
IN paramUID varchar(64),
IN paramMKTID INT(10),
IN paramEID INT(10)
)
BEGIN
DECLARE mkt_id INT(10);

select COUNT(*) INTO mkt_id from user_whois where uid=paramUID and mktid=paramMKTID ;

IF (mkt_id = 0) THEN
insert into user_whois values(paramUID,paramMKTID,paramEID) ;
ELSE
update user_whois set expid = paramEID where uid=paramUID and mktid=paramMKTID ;
END IF;
END$

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote




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.