You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nassim Majdalany <na...@eigroup.com> on 2000/08/02 19:22:39 UTC

Inserting multiple related records (MS SQL 7)

Hi all

I still couldn't find an answer to this after looking through the archives:

I have to use MS SQL server 7, and can't rely on sequences. After creating a
record which is automatically given an ID, I want to insert a related record
which contains the id given in the first insert (foreign key). My problem is
I can't get the first ID, and am concerned that even if I could, it would
not be possible to refer to it from the same xml page.

I've tried using "select @@identity as test" (not sure if this is a MS SQL
only statement) and <ROW VALUE="NULL"></ROW> was returned.

Is this possible from xml using the standard processors, or should it be
handled from Java?

I would very be grateful for any views (not to mention a working example!)

Thanks

Nassim

PS: without resorting to the (mis)use of "select MAX(id) from ..."