On 07.Mar.2002 -- 03:35 PM, marco wrote:
> I have a program to let user add records to a table of "country" and the
> user has to input a new code for a new country. I have to check the
> existenance of the new user input code in the database table, before saving
> inserting the new record.
> 
> What can I do?

If there is a uniqueness constraint (unique or primary key) for that
column, you could just try to insert it and display an error page if
the insert operation fails. Remember that actions can be used to
switch process flow within a pipeline.

Otherwise you would need to look up the value (esql or
DatabaseSelectAction) and act accordingly either on your XSP or
propagate the read value to the sitemap and use a selector or write
your own action that does this.

        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