You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Pål Wester <pa...@never.no> on 2001/01/24 21:07:34 UTC
Has esql taglib a template for no-errors??
I want to do an insert into a table
and has written following:
<esql:connection>
<esql:driver>org.gjt.mm.mysql.Driver</esql:driver>
<esql:dburl>jdbc:mysql://localhost:3306/quart</esql:dburl>
<esql:username>quartuser</esql:username>
<esql:password>passwd</esql:password>
<esql:execute-query>
<esql:query>INSERT INTO Q_ANSATT ( brukid, navn, tel, funksjon,
passord, avd ) VALUES(
'<xsp:expr>login</xsp:expr>','<xsp:expr>name</xsp:expr>','<xsp:expr>tel</xsp
:expr>','<xsp:expr>funksjon</xsp:expr>','<xsp:expr>passwd</xsp:expr>',
'<xsp:expr>avd</xsp:expr>' )</esql:query>
<esql:error-results>
<section>
An error has occured
</section>
<section>
Error:<esql:get-message/>
</section>
</esql:error-results>
</esql:execute-query>
</esql:connection>
this will catch errors, but I can't give the user a
message that the task was successfull, or can I?
Any comment about this is apreciated
thx:
Pål Christian Wester
Programmer
never.no AS
tlf. : 22 01 66 20
fax : 22 01 66 21
Direkte: 22 01 66 34
Mobil : 90 69 00 62
pal.wester@never.no
http://www.never.no/
icq: 103476059
Re: Has esql taglib a template for no-errors??
Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 24 Jan 2001, [iso-8859-1] P�l Wester wrote:
> I want to do an insert into a table
> and has written following:
>
> <esql:connection>
> <esql:driver>org.gjt.mm.mysql.Driver</esql:driver>
> <esql:dburl>jdbc:mysql://localhost:3306/quart</esql:dburl>
> <esql:username>quartuser</esql:username>
> <esql:password>passwd</esql:password>
> <esql:execute-query>
> <esql:query>INSERT INTO Q_ANSATT ( brukid, navn, tel, funksjon,
> passord, avd ) VALUES(
> '<xsp:expr>login</xsp:expr>','<xsp:expr>name</xsp:expr>','<xsp:expr>tel</xsp
> :expr>','<xsp:expr>funksjon</xsp:expr>','<xsp:expr>passwd</xsp:expr>',
> '<xsp:expr>avd</xsp:expr>' )</esql:query>
> <esql:error-results>
> <section>
> An error has occured
> </section>
> <section>
> Error:<esql:get-message/>
> </section>
> </esql:error-results>
> </esql:execute-query>
> </esql:connection>
>
> this will catch errors, but I can't give the user a
> message that the task was successfull, or can I?
try update-results. also try using esql:parameter in your query. it's
safer.
- donald