Vittorio, have you considered Stored Procedures (provided ypur DBMS supports them) ?
This is the most flexible way to deal with a databsse task, and you can cope easily with errors within a Stored Procedure. in my eyes, you should use SQL Transformer and build a series of SP-call using a stylesheet; your XML file will be used to fill the input parameters. Let's suppose every SP would output a status code, then SQL Transformer will produce an XML stream with these codes, and another stylesheet could tranform them into useful error message. Best regards, --------------------------------------------- Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html --------------------------------------------- > -----Original Message----- > From: Rigamonti Vittorio [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 04, 2002 12:09 PM > To: '[EMAIL PROTECTED]' > Subject: Design question with DB > > > Hi All! > Can anyone help me with this problem? > > I'm developing a little piece of a B2B application that deal with DB > updating. > > This is what I want to do: > > My input is an XML document like this: > > <rowSet> > <row id="1" > > <el>field1</el><el>field2</el><el>field3</el><el>field4</el> > </row> > <row id="2"> > <el>aaa</el><el>bbb</el><el>ccc</el><el>ddd</el> > </row> > <row id="3"> > <el>1</el><el>2</el><el>3</el><el>4</el> > </row> > </rowSet> > > With this input file I want to update a DB. > > Now suppose that the update with the 2nd <row id="2"> element fails due to > incorrect data. > > What I want is: > > 1) the DB updated with the correct rows (<row id="1"> <row id="3">) > 2) an output document like this: > > <rowSet> > <row id="1"> > <el>field1</el><el>field2</el><el>field3</el><el>field4</el> > </row> > <row id="2" note="DBError" sympthom="......"> > <el>aaa</el><el>bbb</el><el>ccc</el><el>ddd</el> > </row> > <row id="3"> > <el>1</el><el>2</el><el>3</el><el>4</el> > </row> > </rowSet> > > I think I should use the SQL transformer (is this the right way?) but I'm > not able to imagine how to handle the DB error and how > to produce the output document. > > Any idea? > > Thanks billions, > Vittorio > > > --------------------------------------------------------------------- > 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]>