[Zope] Problem with Z SQL Method

Doug Wyatt doug@sonosphere.com
Tue, 15 Jun 1999 16:42:53 -0400


At 12:43 -0700 6/15/99, kevin@beatseek.com wrote:
> I've created several Z SQL methods and they are running fine (connecting to
> mySQL). Now one that I'm working on gives a exceptions.KeyError: unhandled
> error. I don't believe it's a problem with the sql syntax because I can
> copy and paste the sql directly into the mysql client and it runs fine.
>
> Any suggestions?

I ran into this when trying to have a method return LAST_INSERT_ID().

I forget the exact nature of the problem, but it had something to do 
with the return variable type or its column name.  This worked:

	select CONCAT(LAST_INSERT_ID()) as insID

(CONCAT converts to a string, as insID gives the returned column a name)

HTH
Doug

-- 
Doug Wyatt                             doug@sonosphere.com
Sonosphere (electric/improv music)     http://www.sonosphere.com/