cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: _esql_connection.connection should be public
Date Mon, 12 May 2003 13:05:40 GMT
On 12.May.2003 -- 06:45 AM, Antonio Gallardo wrote:
> Christian Haul dijo:
> > On 12.May.2003 -- 06:26 AM, Antonio Gallardo wrote:
> >> Torsten Curdt dijo:

<snip/>

> >> Syntax:
> >> <get-field pool="MyPoolName" table="MyTableName"
> >> field="MyRequestedfield" condition="anotherfield=3" default="ERROR"/>
> >>
> >> internal process:
> >> 1-Create a conection to "MyPoolName" Database.
> >> 2-Create a SQL string to retrieve the field from the given table using
> >> the given condition:
> >>
> >> SELECT MyRequestedfield FROM MyTableName WHERE MyRequestedfield;
> 
> Sorry, :)
> 
> SELECT MyRequestedfield FROM MyTableName WHERE @condition;
> 
> >>
> >> 3-If there is ONE recordset then return the VALUE for the field,
> >>   else: return default
> >>
> >> 4-Close the connection to the database pool.
> >>
> >> What about something like this? this is just a first draft.
> >> Is something like that what are you looking for?
> >>
> >> It would be enough to take the company name from a Database.
> >
> > Maybe that should go into a logicsheet that _uses_ esql?
> 
> Why not into esql? This is a very simple SQL query that every RDBMS can
> execute without errors.

IMHO this layers on top of esql. In addition, esql is quite complex
and powerful already. Adding such a tag would complicate
things. Actually, thinking about it, it is a little more difficult
than at first sight since the tag needs to be usable from an
expression. Thus the result needs to be computed in a method and not
in place => either a method of the XSP or a helper class. Helper
classes are way cleaner => not much to share with esql.

What happens if several such tags appear on a page? Would each
generate a query to the DB? Should they be combined, how?

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

Mime
View raw message