On 03.Jun.2002 -- 10:11 AM, daniel robinson wrote:
> Hi,
> 
> I've been poking around but I'm clueless (yes, generally as well as
> specifically).
> 
> What am I trying to do:
> 
> 1) I have a PostgreSQL table with a field called "StoryText" defined as
> a "Text" (virtually unlmited size text data)

Texts are a special case that is IMHO not handled. Texts (CLOBs and
BLOBs) need to be read and written through a stream. Patches are welcome :-)

> 2) I wish to update this table with the contents of an XML element ( say
> 
> <StoryText>a lot of text with special characters like ' as well as
> html code <a href="www.clueless.com/IAM">who is this
> noob?</a></StoryText>

esql:get-xml is your friend. But it requires well formed XML / XHTML.

> 3) I've tried ESQL like this:
> 
> <esql:connection>
>      <esql:pool>VSolano</esql:pool>
>      <esql:execute-query>
>        <esql:query>
> 
> 
>         update "Story" set "Title"= '<xsp-request:get-parameter
> name="Title"/>',
>                               "Description"= '<xsp-request:get-parameter
> name="Description"/>',
>                               StoryText"= '<xsp-request:get-parameter
> name="StoryText"/>'
>                 where "ContentID" = '<xsp-request:get-parameter
> name="ContentID"/>'
> 
>        </esql:query>
>      </esql:execute-query>
>    </esql:connection>
> 
> There have been many attempts :).  I HAVE been able to update the table
> when I use literals and short values for the updates themselves (i.e.
> ...set "Title"='This is for noobs'....).

See above.

> My questions:
> 
> 1) should I be using ESQL or Actions?  There has been some discussion on
> the listserve that seems to indicate that Actions are the way to go.

In my opinion actions are great for inset / delete / update and esql
is great for select. BTW the database actions do support CLOBs.

> 2) do the DatabaseActions work?  there seems to have been a lot of
> confusion about this.

They do work, although I advocate using the "new" ones form the
actions.modular package (CVS-HEAD or CVS-2.0.3 scratchpad).
Is there? If you can sumarize it I'd be happy to comment.

> 3) Does someone have examples - hopefully of exactly the sort of thing
> I'm trying to do - Store XML in the db - I'm sure I'm not the first.

Sorry, not at hand.

> I am putting together documentation so that when this is all over I can
> SHARE IT, because no-one should have to live through this again.  :)

Speaking of documentation, there is some more on datbases and cocoon
in CVS-2.0.3 or now live on site. See
http://xml.apache.org/cocoon/userdocs/concepts/databases.html for a
start.

Plus, I'm currently (right now) writing a bit more on the esql
logicsheet. Stay tuned. That shouldn't keep you from writing docs,
though. We can't get enough of them!

        Chris.

-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


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

Reply via email to