[Zope] MySQL LAST_INSERT_ID...

Tom Jenkins TomJenkins@zentuit.com
Tue, 16 Mar 1999 16:52:32 -0500


OK to follow up,  if you use call mysql using the form
select CONCAT(LAST_INSERT_ID()) as new_id 
you get back the correct value in 'last_id'

now I'm still having problems with getting that value into the REQUEST 
object.  What goes in place of the ???
<!--#call REQUEST.set('last_id', ???)-->

(Pardon me if this has been answered already, there was some 
problems with me getting messages from zope list)
Thanks again...

> On Mon, 15 Mar 1999, Tom Jenkins wrote:
> 
> > To followup my last post, I'm getting an exception when trying to use 
> > MySQL's  "select LAST_INSERT_ID()" function:
> > 
> > Error, exceptions.KeyError: unhandled 
> > 
> > SQL used:
> > 
> > select LAST_INSERT_ID()
> > 
> > Anybody have any ideas?
> 
> Try: select LAST_INSERT_ID()+0 to cast it to an int...
> 
> Also, check your declaration for LAST_INSERT_ID().. if the above doesn't
> work you'll need to either try the patch for ZMySQLDA that was posted a
> week or so ago, or do something like: SELECT CONCAT(LAST_INSERT_ID()) to
> cast it to a string and then use a nifty Python fn. to convert it to an
> integer number. 
> 

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Tom Jenkins                    DevIS (http://www.devis.com)
Linux & Samba 2.0 : The best Windows file server
http://www.zdnet.com/sr/stories/issue/0,4537,2196106,00.html                                         
"Do not be overcome by evil, but overcome evil with good." Romans 12:21