Impact of making a stored program transactional while running under transaction manager?

2009-03-09 Thread David Karr
it's supposedly good advice in a multi-step stored procedure to have an explicit "start transaction" and "commit" wrapping the work. What is the impact of doing this if the stored procedure is called from code managed by a transaction manager. For instance, in a JEE appserver and a transaction ma

Re: Possible to get better error handling for invalid enum parameter to stored program?

2009-03-08 Thread David Karr
poster pointed out that there's no resolution to this, outside of not using enum columns, or simply accepting their limitations. http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html >http://dev.mysql.com/doc/refman/5.0/en/enum.html > >- steve edberg > > &

How expensive is exception handling at end of cursor vs. UNIONing a sentinel?

2009-03-06 Thread David Karr
Although I've been doing lots of work with SQL over the years, I've never done anything with stored procedures. While reading a book on MySQL stored programs, I'm struck by the fact that the common method of iterating through a resultset using a cursor requires doing "exception-based branching" (a

Re: Possible to get better error handling for invalid enum parameter to stored program?

2009-03-06 Thread David Karr
values, you need to use a lookup table and a foreign > key constraint. > > - Perrin > > On Fri, Mar 6, 2009 at 1:35 PM, David Karr > wrote: > > If I define an enum parameter for a stored program, and the calling code > > sends an invalid value, they get the less than u

Possible to get better error handling for invalid enum parameter to stored program?

2009-03-06 Thread David Karr
If I define an enum parameter for a stored program, and the calling code sends an invalid value, they get the less than useful "data truncated" error. Is it possible to define the stored program to produce better error handling for that kind of error? This is probably a FAQ, but in general, it ap

Re: Why is simple query not using index?

2009-03-04 Thread David Karr
e scan would be less expensive, but nothing that says specifically when this would happen (which doesn't surprise me). > > - Perrin > > On Tue, Mar 3, 2009 at 7:58 PM, David Karr > wrote: > > I'm using MySQL 5.0.67-0ubuntu6. > > > > I'm stepping thro

Why is simple query not using index?

2009-03-03 Thread David Karr
I'm using MySQL 5.0.67-0ubuntu6. I'm stepping through "MySQL - 4th Edition". There's a simple table called "member" that we've just added an index to, for the "expiration" column, which is a date column. The current example in the book is: mysql> EXPLAIN SELECT * FROM MEMBER > -> WHERE expir