MySQL Forums
Forum List  »  General

Stored Procedures returning errors
Posted by: Craig
Date: February 21, 2005 10:42AM

hey all,

figured this out by accident from within c-api, thought it was a bug there until i tried it on the command line too.

it seems that stored procedures will only return an error value for you to select if you are using the database that the stored proc was created in.

i.e. if you have a table with a field which is a primary key, and try to insert a new entry which has the same value...

start command line:
use mysql;
CALL mybd.myStoredProc();

// should throw an error here,
"duplicate entry x for key one", where x is the number you tried to enter

will not return any error values,
whereas this will:
start command line:
use mydb;
CALL myStoredProc();
// throws duplicate key error

is this intentional?

cheers,
Craig

Options: ReplyQuote


Subject
Written By
Posted
Stored Procedures returning errors
February 21, 2005 10:42AM


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.