cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Cordes <mcord...@maine.edu>
Subject Re: Help with esql results for 'insert' query
Date Tue, 09 Jan 2001 15:09:55 GMT
> 
> 
> 
> As far as I know, the variables are local to every database connection
> you make.. To be completely sure, lock the tables or make a transaction..
> 
> 

In oracle at least this too will not work.  Sequences are atomic and 
are not bounded by transactions, etc... I would not do this if you 
value the integrity of the data or your own sanity.

-matt


> > 
> > -matt
> > 
> > On Tue, Jan 09, 2001 at 07:26:48PM +0800, Perry Molendijk wrote:
> > > This will also return your latest entry:
> > > 
> > > SELECT MAX(owner_id) FROM owners
> > > 
> > > I have used in the past in asp applications so I can't see why it wouldn't
> > > work with esql
> > > 
> > > ----- Original Message -----
> > > From: "Paul Brown" <prb@fivesight.com>
> > > To: <cocoon-users@xml.apache.org>
> > > Sent: Tuesday, January 09, 2001 10:30 AM
> > > Subject: RE: Help with esql results for 'insert' query
> > > 
> > > 
> > > >
> > > > You want to "SELECT @@IDENTITY".  Be aware that triggers and transactions
> > > > affect its value.
> > > >
> > > > - Paul
> > > >
> > > > > -----Original Message-----
> > > > > From: eliza.khosrova@TMINUS10.com [mailto:eliza.khosrova@TMINUS10.com]
> > > > > Sent: Monday, January 08, 2001 7:11 PM
> > > > > To: cocoon-users@xml.apache.org
> > > > > Subject: Help with esql results for 'insert' query
> > > > >
> > > > >
> > > > > Hello,
> > > > >
> > > > > I am using MS SQL database and the tables are set up in a way that
the
> > > > > primary keys get generated automatically when inserting entries.
> > > > > Is it feasible to get the generated id after 'insert' query in esql?
> > > > >
> > > > > Example:  I have a table called 'owners' with three columns:
> > > > > name, address,
> > > > > owner_id where owner_id is the primary key.
> > > > >
> > > > > After I insert as follows:
> > > > > <eql:execute-query>
> > > > >    <esql:query>insert into owners values('john smith')</esql:query>
> > > > >
> > > > > would query return the generated id for the entry that I just inserted?
> > > If
> > > > > so, what is the esql tags?  I don't seem to find it when looking
at the
> > > > > esql logicsheet.  Please note that querying based on 'name' or 'address'
> > > > > will not help me because they are not necessarily unique, i.e. I
> > > > > could have
> > > > > entries with same names or address.
> > > > >
> > > > > Any help or suggestion is greatly appreciated.
> > > > > Eliza
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > > > > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > > > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> > > >
> > > >
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> > > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

Mime
View raw message