cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joose Vettenranta <jo...@iki.fi>
Subject Re: XSP : store the result of the ESQL query
Date Tue, 18 May 2004 08:25:08 GMT
And still one sidenode..

No logic is needed here.

SELECT rub_position+10 does the same thing.

And even more..

how about
insert into m_rub_player_ope
  (rub_id,player_url_name,ope_url_name,rub_display,rub_position)
select foo,bar,baz,quux...

Don't know if this is possible because part of that code is missing... 
But most likely you can do that insert with one query.

- Joose

18.5.2004 kello 11:03, Derek Hohls kirjoitti:

  And as a side issue - given that many developers eschew
> the use of XSP (exactly because it does logic calculations
> as shown in your example) - is it possible to reproduce
> this type of approach using, say, JXTemplates and the
> SQLTransformer...
>
> Thanks
> Derek
>
>>>> obillard@jouve.fr 2004/05/18 09:49:42 AM >>>
> Hi homonym,
>
> This solution works "if it works" !
> But if the first query fails, you'll get an unexpected result for the
> second query if maxpos is not initialized...
> Remember that queries can be embedded in each other :
>
> sql = "SELECT rub_position FROM m_rub_player_ope WHERE player_url_name
> =
> '"+player_url_name+"' ORDER BY rub_position LIMIT 1";
> <esql:connection>
> <esql:pool>my_pool</esql:pool>
> <esql:execute-query>
> <esql:query><xsp:expr>sql</xsp:expr></esql:query>
> <esql:results>
> <esql:row-results>
> <xsp:logic>
> maxpos = <esql:get-int column="rub_position"/>;
> maxpos = maxpos + 10;
>
> <esql:execute-query>
> <esql:query>
> INSERT INTO m_rub_player_ope
> (rub_id,player_url_name,ope_url_name,rub_display,rub_position)
> VALUES (
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message