R: Cocoon SQL Transformation

2002-10-29 Thread Luca Morandini
Tom,

what about adding a couple quotes around the username value ?

Something like:
insert into user_info (USERNAME) values ('xsl:value-of
select=detail/name/')

Best regards,

P.S.
Mind ! Strings may contain unmatched single quotes, which greatly offend the
SQL parser, think about converting unmatched single quotes in matched ones
(' -- '') before sending SQL statements to the SQLTransformer.

Luca Morandini
[EMAIL PROTECTED]


 -Messaggio originale-
 Da: Tom Place [mailto:psyttrp;nottingham.ac.uk]
 Inviato: lunedì 28 ottobre 2002 18.19
 A: [EMAIL PROTECTED]
 Oggetto: RE: Cocoon SQL Transformation


 OK the actual XML that is going into the failing XSL is as follows:

 user
   detail
 nametomplace/name
 passwordtom/password
 firsttom/first
 lastplace/last
   /detail
   existing-user
 rowset /
   /existing-user
 /user

 The fact that the existing user rowset is empty is a good thing (if it
 wasn't empty then something else happens that works!

 The xsl that fails is as follows:

 ?xml version=1.0?

 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:sql=http://apache.org/cocoon/SQL/2.0;

 xsl:template match=user

   page
 xsl:choose
   xsl:when test=existing-user/sql:rowset/sql:row
 titleBlah/title
   /xsl:when
   xsl:otherwise
 execute-query xmlns=http://apache.org/cocoon/SQL/2.0;
   query
  insert into user_info (USERNAME) values (xsl:value-of
 select=detail/name/)
   /query
 /execute-query

 titleBlah 2/title
   /xsl:otherwise
 /xsl:choose
   /page
 /xsl:template
 /xsl:stylesheet

 -Original Message-
 From: Luca Morandini [mailto:spectrum.morandini;ipzs.it]
 Sent: 28 October 2002 15:27
 To: [EMAIL PROTECTED]
 Subject: R: Cocoon SQL Transformation

 Tom,

 I guess your pipeline contains a couple XSLT transformations and a
 couple
 SQL ones (one for the select, one for the insert), isn't it ?

 If this is true, could you please send me the XML which is sent to the
 failing transformation (be it SQL or XSLT) ?

 I'm interested in the actual XML document going into the transformer,
 not in
 the XSL source code.

 Best regards,

 Luca Morandini
 Istituto Poligrafico e Zecca dello Stato
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]




  We are protected from the virus by Norton Antivirus Corporate
 Edition

 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.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/faq/index.html

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



 We are protected from the virus by Norton Antivirus Corporate Edition

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

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




R: Cocoon SQL Transformation

2002-10-28 Thread Luca Morandini
Tom,

every query element should live within a separate execute-query one,
like in:

 execute-query xmlns=http://apache.org/cocoon/SQL/2.0;
   query
 insert into my_table (Col1, Col2) values ('1', '2')
   /query
 /execute-query

 execute-query xmlns=http://apache.org/cocoon/SQL/2.0;
   query
 insert into my_table (Col1, Col2) values ('2', '3')
   /query
 /execute-query

I suppose you've already try this... then, what's the error you get ?

Best regards,

Luca Morandini
[EMAIL PROTECTED]


 -Messaggio originale-
 Da: Tom Place [mailto:psyttrp;nottingham.ac.uk]
 Inviato: lunedì 28 ottobre 2002 14.27
 A: [EMAIL PROTECTED]
 Oggetto: Cocoon SQL Transformation


 Hi all,

 Quick question to do with the way the cocoon SQL parser copes with
 multiple SQL statements.
 There is probably a very quick fix for this but I'm tearing my hair out
 trying to find it!

 When inserting using and SQL statement based in XSL like so:

 execute-query xmlns=http://apache.org/cocoon/SQL/2.0;
   query
 insert into my_table (Col1, Col2) values ('1', '2')
   /query
 /execute-query
 This is fine, but when you want to add a second it wont do it!
 I have tried with a second set of execute-query tags, I have tried
 putting a second set of query tags within an execute-query

 Any Ideas?

 Cheers
 Tom


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

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



 We are protected from the virus by Norton Antivirus Corporate Edition

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

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




R: Cocoon SQL Transformation

2002-10-28 Thread Luca Morandini
Tom,

could you post the XML document that fails ?

Best regards,

Luca Morandini
[EMAIL PROTECTED]


 -Messaggio originale-
 Da: Tom Place [mailto:psyttrp;nottingham.ac.uk]
 Inviato: lunedì 28 ottobre 2002 15.38
 A: [EMAIL PROTECTED]
 Oggetto: RE: Cocoon SQL Transformation


 I have tried it like you say however am still getting an internal server
 error:

 org.apache.cocoon.ProcessingException: Exception during processing of
 file:/C:/tomcat/webapps/cocoon/autorevs/docs/doregister.xml:
 java.lang.RuntimeException: java.lang.RuntimeException:
 java.lang.NullPointerException

 The page will run with the sql commented out so that’s not the problem
 and the sql actually does insert into the db, but then you get the
 above!

 Tom

 -Original Message-
 From: Luca Morandini [mailto:spectrum.morandini;ipzs.it]
 Sent: 28 October 2002 14:06
 To: [EMAIL PROTECTED]
 Subject: R: Cocoon SQL Transformation

 Tom,

 every query element should live within a separate execute-query one,
 like in:

  execute-query xmlns=http://apache.org/cocoon/SQL/2.0;
query
  insert into my_table (Col1, Col2) values ('1', '2')
/query
  /execute-query

  execute-query xmlns=http://apache.org/cocoon/SQL/2.0;
query
  insert into my_table (Col1, Col2) values ('2', '3')
/query
  /execute-query

 I suppose you've already try this... then, what's the error you get ?

 Best regards,

 Luca Morandini
 [EMAIL PROTECTED]


  -Messaggio originale-
  Da: Tom Place [mailto:psyttrp;nottingham.ac.uk]
  Inviato: lunedì 28 ottobre 2002 14.27
  A: [EMAIL PROTECTED]
  Oggetto: Cocoon SQL Transformation
 
 
  Hi all,
 
  Quick question to do with the way the cocoon SQL parser copes with
  multiple SQL statements.
  There is probably a very quick fix for this but I'm tearing my hair
 out
  trying to find it!
 
  When inserting using and SQL statement based in XSL like so:
 
  execute-query xmlns=http://apache.org/cocoon/SQL/2.0;
query
  insert into my_table (Col1, Col2) values ('1', '2')
/query
  /execute-query
  This is fine, but when you want to add a second it wont do it!
  I have tried with a second set of execute-query tags, I have tried
  putting a second set of query tags within an execute-query
 
  Any Ideas?
 
  Cheers
  Tom
 
 
  -
  Please check that your question  has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faq/index.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:   [EMAIL PROTECTED]
 


  We are protected from the virus by Norton Antivirus Corporate
 Edition

 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.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/faq/index.html

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



 We are protected from the virus by Norton Antivirus Corporate Edition

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

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