cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Delis, Christopher E." <cede...@uillinois.edu>
Subject RE: sql transformer question; *not* esql... (was RE: ???ESQL upda te table???)
Date Tue, 18 Mar 2003 16:18:18 GMT
actually, now that i return back to my problem... i am not so embarassed (at
least not yet!)...

this solution doesn't appear to solve my problem because my stylesheet is in
the middle of a pipeline and the substitute values are not easily attainable
from within the sitemap.  also, i do not wish to have to declare each
variable more times than i have to (another reason i don't want it in the
sitemap).  has anyone else run into a similar situation?  of course, i could
write (i'd rather "find" one already developed ;-) another transform to
strip offending characters (such as single-quotes) for each variable but i'd
rather not.  any ideas?  do i need to re-design my approach?

here is the update command i wish to perform.  it receives the variables
from previous generator/transforms:

<?xml version="1.0"?>

<sql:execute-query xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0">
   <sql:use-connection>idal</sql:use-connection>
   <sql:query>
            update contact
            set last_name = '<xsl:value-of
select="/library/contact/last_name"/>',
            first_name = '<xsl:value-of
select="/library/contact/first_name"/>',
            email = '<xsl:value-of select="/library/contact/email"/>',
            phone = '<xsl:value-of select="/library/contact/phone"/>',
            address = '<xsl:value-of select="/library/contact/address"/>',
            city = '<xsl:value-of select="/library/contact/city"/>',
            zip = '<xsl:value-of select="/library/contact/zip"/>'
            where library_id = <xsl:value-of select="/library/id"/>
   </sql:query>
</sql:execute-query>




> -----Original Message-----
> From: Delis, Christopher E. [mailto:cedelis@uillinois.edu]
> Sent: Tuesday, March 18, 2003 4:08 AM
> To: 'Luca Morandini '; 'cocoon-users@xml.apache.org '
> Subject: RE: sql transformer question; *not* esql... (was RE: ???ESQL
> upda te table???)
> 
> 
>  thanks!  i am so embarassed. ;-)  i gazed right past that little
> paragraph...  sheesh!
> 
> -----Original Message-----
> From: Luca Morandini
> To: cocoon-users@xml.apache.org
> Sent: 3/18/03 1:15 AM
> Subject: RE: sql transformer question; *not* esql... (was RE: 
> ???ESQL update
> table???)
> 
> Christopher,
> 
> IIUC, you need substitution: go to
> http://xml.apache.org/cocoon/userdocs/transformers/sql-transfo
> rmer.html
> and look for the
> "Substitution" topic
> 
> Regards,
> 
> ---------------------------------------------
>                Luca Morandini
>                GIS Consultant
>               lmorandini@ieee.org
> http://utenti.tripod.it/lmorandini/index.html
> ---------------------------------------------
> 
> 
> > -----Original Message-----
> > From: Delis, Christopher E. [mailto:cedelis@uillinois.edu]
> > Sent: Tuesday, March 18, 2003 1:53 AM
> > To: Delis, Christopher E.; ''cocoon-users@xml.apache.org' '
> > Subject: sql transformer question; *not* esql... (was RE: ???ESQL
> update
> > table???)
> >
> >
> > i replied to the wrong topic.  sorry...  what i meant to 
> ask was:  is
> there
> > a "place-holder" mechanism available using the sql transformer?
> --chris
> >
> > -----Original Message-----
> > From: Delis, Christopher E.
> > To: 'cocoon-users@xml.apache.org'
> > Sent: 3/17/03 9:48 AM
> > Subject: RE: ???ESQL update table???
> >
> > on a slightly different note, is there "place-holder" 
> functionality in
> > esql
> > stylesheet language?  e.g.,
> >
> > insert into atable (field1, field2) values (?, ?)
> > select * from atable where field1 = ? limit ?
> > ...
> >
> > TIA,
> > chris
> >
> >
> > > -----Original Message-----
> > > From: Maxime.Gheysen@swisscom.com
> [mailto:Maxime.Gheysen@swisscom.com]
> > > Sent: Friday, March 14, 2003 9:20 AM
> > > To: cocoon-users@xml.apache.org
> > > Subject: ???ESQL update table???
> > >
> > >
> > > Hi,
> > > This is a part of a query. My problem is that when I make a
> > > SELECT right
> > > after an INSERT I don't get the last updated query :
> > >
> > > ---------------------------
> > > <esql:execute-query>
> > >  <esql:query>
> > >   INSERT INTO Actions  (at_name, at_order)
> > >   VALUES ('<esql:get-string column="at_name" ancestor="1"/>',
> > > <xsp:expr>nouvOrder</xsp:expr>)
> > >  </esql:query>
> > >  <esql:update-results/>
> > > </esql:execute-query>
> > >
> > > <esql:execute-query>
> > >  <esql:query>
> > >   SELECT TOP <xsp:expr>myTopCnt</xsp:expr> * FROM Actions
> > >   WHERE at_order = <xsp:expr>myOrderID</xsp:expr>
> > >   ORDER BY at_id DESC
> > >  </esql:query>
> > >  <esql:results>
> > >  <esql:row-results>
> > >   <xsp:logic>
> > >     nouvActionName = <esql:get-string column="at_name"/>;
> > >   </xsp:logic>
> > >  </esql:row-results>
> > >  </esql:results>
> > > </esql:execute-query>
> > >
> > > <esql:execute-query>
> > >  <esql:query>
> > >   SELECT TOP 1 * FROM Actions
> > >   WHERE at_name = '<xsp:expr>nouvActionName</xsp:expr>'
> > >   ORDER BY at_id DESC
> > >  </esql:query>
> > >  <esql:results>
> > >  <esql:row-results>
> > >    <xsp:logic>
> > >     nouvAction = <esql:get-int column="at_order"/>;
> > >    </xsp:logic>
> > >   </esql:row-results>
> > >  </esql:results>
> > > </esql:execute-query>
> > > -------------------------------
> > > What I mean is that in the last "execute-query" the value
> > > "<esql:get-int
> > > column="at_order"/>" returns a value, but in my SQL 
> Profiler I get a
> > > query witch returns another value (the right)!!!!
> > > I think that it is due to the refreshing from the insert, because
> the
> > > insert value is queried!
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> 

---------------------------------------------------------------------
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