[Zope] Inserting values into db - problems

Joel Burton joel@joelburton.com
Wed, 13 Mar 2002 09:27:43 -0500


Wayne --

Please cc the zope@zope.org when you respond to me; other people may find
this help useful.

> <dtml-raise type="client">
> </dtml-raise>
> insert into y8 values(
> now(),
> now(),
> <dtml-sqlvar  client type="string">,
> <dtml-sqlvar product type="string">,
> nextval('y8_number'),
> <dtml-sqlvar  description type="string">,
> <dtml-sqlvar  clientJobNumber type="string">,
> <dtml-sqlvar  clientPoNumber type="string">,
> <dtml-sqlvar  clientContact type="string">,
> <dtml-sqlvar  techContact type="string">,
> <dtml-sqlvar  jobCloseDate type="string">
> )

make that

<dtml-raise type="client">
  <dtml-var client>
</dtml-raise>

So that we see the actual output of the client variable.

One small idea: it's possible that "client" is a meaningful word to Zope.
Might want to change the parameter & dtml-sqlvar to "theclient" or somesuch
and see what happens.

> > Don't understand the question about an if block? What are you
> talking about?
>
> On the zope site, the example I saw is as follows :
>
> <dtml-if "balance >= debit_amount">
> <dtml-call "debitAccount(account)">
> Your account, <dtml-var account>, has been debited.
> <dtml-else>
> <dtml-raise type="Insufficient funds">
> There is not enough money in account <dtml-account>
> to cover the requested debit amount.<p>
> </dtml-raise>
> </dtml-if>
>
> So I am trying to work out if I have to test the value and then do a
> dtml-raise if it fails, inside a dtml-if block as the example does...

Normally, dtml-raise would be used to raise an error manually if something
bad happens, so, yes, it would often be used with dtml-if. However, you can
use it yourself for debugging purposes, and it's quite useful like this.