Go Back   Forum Care Forums > Development Reference Area > MySQL Discussion

Reply
 
LinkBack Thread Tools Display Modes
newbie: debugging stored procedure, how?
Old
  (#1)
Jeff
Guest
 
Posts: n/a
Default newbie: debugging stored procedure, how? - 06-04-2007, 07:50 AM

Hey

I've created a stored procedure in a MySql5 database.

I've got some problems with this stored procedure. So I thought it would be
great to insert some kind of code which can generate debug info. I tryed to
use print "helloworld"; but that doesn't work...

By the way, this is the body of the stored procedure:
BEGIN
DECLARE counter int;
IF (id = NULL)THEN
SELECT count(*) INTO counter FROM Property WHERE UniqueId = uniqueId;
IF (counter=0) THEN
INSERT INTO Property (Field1, Field2) VALUES (field1, field2);
END IF;
ELSE
UPDATE Property
Set Field1 = field1,
Field2 = field2
WHERE Id = id;
END IF;
END;

any suggestions?

Jeff


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

Re: newbie: debugging stored procedure, how?
Old
  (#2)
Jeff
Guest
 
Posts: n/a
Default Re: newbie: debugging stored procedure, how? - 06-04-2007, 07:50 AM

okay, I've solved it by using this sql statement: select "helloworld" as
"action";




"Jeff" <EMAIL REMOVED> wrote in message
news:EMAIL REMOVED...
> Hey
>
> I've created a stored procedure in a MySql5 database.
>
> I've got some problems with this stored procedure. So I thought it would
> be great to insert some kind of code which can generate debug info. I
> tryed to use print "helloworld"; but that doesn't work...
>
> By the way, this is the body of the stored procedure:
> BEGIN
> DECLARE counter int;
> IF (id = NULL)THEN
> SELECT count(*) INTO counter FROM Property WHERE UniqueId =
> uniqueId;
> IF (counter=0) THEN
> INSERT INTO Property (Field1, Field2) VALUES (field1, field2);
> END IF;
> ELSE
> UPDATE Property
> Set Field1 = field1,
> Field2 = field2
> WHERE Id = id;
> END IF;
> END;
>
> any suggestions?
>
> Jeff
>



   
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top