Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Andreas Jung
--On 9. März 2007 14:42:57 +0530 Remil Mathew [EMAIL PROTECTED] wrote: Hi, How can run multiple query in an Z sql method.. Sure. SQL Statement just have to separated by dtml-sql-delimiter. I am using Mysql.. Also is there any method to return a value from insert query? An insert

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Tino Wildenhain
Andreas Jung schrieb: --On 9. März 2007 14:42:57 +0530 Remil Mathew [EMAIL PROTECTED] wrote: Hi, How can run multiple query in an Z sql method.. Sure. SQL Statement just have to separated by dtml-sql-delimiter. I am using Mysql.. Also is there any method to return a value from insert

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Gaute Amundsen
On Friday 09 March 2007 10:12, Remil Mathew wrote: Hi, How can run multiple query in an Z sql method.. I am using Mysql.. Also is there any method to return a value from insert query? Thanks Remil could you possibly be thinking of? insert foo into bar dtml-var sql_delimiter SELECT

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Jary Busato
Yes, I must do it when I need to know an autonumber PK after an insert. when DB support transaction i write: begin transaction insert foo into bar dtml-var sql_delimiter SELECT LAST_INSERT_ID() as lastid commit Then, a DTML method: dtml-in myZSQLinsertandselect() dtml-var lastid /dtml-in

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Andreas Jung
--On 9. März 2007 15:30:23 +0100 Jary Busato [EMAIL PROTECTED] wrote: Yes, I must do it when I need to know an autonumber PK after an insert. when DB support transaction i write: begin transaction insert foo into bar dtml-var sql_delimiter SELECT LAST_INSERT_ID() as lastid commit Sorry,

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Jary Busato
My only need is to be sure to keep the right id; I did'nt use this method for other operations. You sayd that it's not recommended but I don't understand why in this simple context. Andreas Jung ha scritto: --On 9. März 2007 15:30:23 +0100 Jary Busato [EMAIL PROTECTED] wrote: Yes, I must

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Andreas Jung
--On 9. März 2007 16:45:56 +0100 Jary Busato [EMAIL PROTECTED] wrote: My only need is to be sure to keep the right id; I did'nt use this method for other operations. You sayd that it's not recommended but I don't understand why in this simple context. Simple or complex context..that does

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Marco Bizzarri
On 3/9/07, Jary Busato [EMAIL PROTECTED] wrote: If I understood you're telling me that begin and commit statements are redundant. Yes, exactly: they are issued by Zope at the boundaries of a transaction. Sometimes conflicts are not correctly managed by ZTM (no rollbacks in db) Are you

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Marco Bizzarri
On 3/9/07, Jary Busato [EMAIL PROTECTED] wrote: Marco Bizzarri ha scritto: On 3/9/07, Jary Busato [EMAIL PROTECTED] wrote: If I understood you're telling me that begin and commit statements are redundant. Yes, exactly: they are issued by Zope at the boundaries of a transaction. Sometimes