You can get a ZSQLMethod that's used for inserting to return the last
inserted ID by doing the following:

  INSERT ...whatever...

  <dtml-var sql_delimiter>

  SELECT LAST_INSERT_ID() AS newid

You get the results as you would with any ZSQLMethod:

  <dtml-in my_zsql_method>
  Inserted ID: <dtml-var newid>
  </dtml-in>

_______________________

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Andy
> Sent: Wednesday, May 17, 2000 7:45 PM
> To: [EMAIL PROTECTED]
> Subject: [Zope] ZSQL-Methods: last inserted id
>
>
>
> I wonder how I can find out about the last inserted id of a row in my
> mysql-database, which I inserted through a ZSQL-Method...
>
> I tried mysql's built-in function LAST_INSERT_ID(), but that did not solve
> my problem...
>
>
> _______________________________________________
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>


_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to