Luis,

this is really a database issue and not a Cocoon or esql issue.  The answer
may vary from db to db.  For instance, I would never do something like this
in Oracle.  Instead, I would use a sequence to provide unique values for
"column1" on each insert.  Other database have other mechanisms.  I would
recommend getting a good book on your particular database, or the vendor's
documentation if no third-party books are available.  Also look for
newsgroups for your particular database (e.g., comp.databases.informix,
comp.databases.oracle, etc.).  There may be some frameworks (such as
TOPLink) that abstract this problem and let you ignore the implementation
details for different databases, but as far as I know, jdbc doesn't do
that, and neither does Cocoon's esql taglib.

-Christopher




Please respond to [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   cocoon-users <[EMAIL PROTECTED]>
cc:

Subject:  HELP on "Help with esql results for 'insert' query"



I've read a thread in Cocoon's April mail archives which was getting
interesting but it stopped without a definite conclusion.

I'm using Informix DBMS (but I could also be using MySQL, Oracle, etc
... I wan't portability here!) and I wan't to do something like "INSERT
INTO table1 (column1, column2, column3) VALUES ((SELECT MAX(column1)+1
FROM table1), 0, 0)" without going into multithread issues, i.e., I
wan't to run this query as the only query at that moment operating on
table1. I thought queries operate on an atomic basis, so this INSERT
with a SELECT could be what I really wanted ... but from what I read
here, there are who disagree from this.

thanks for any advices/help !


--
Luis A. Gois
---

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>





---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to