Re: Can't update record - dup_val_on_index

From: Brian W. Chester <bwchester_at_home.com>
Date: Mon, 21 Feb 2000 15:29:54 GMT
Message-ID: <SRcs4.9673$a27.200988_at_news1.rdc1.mb.home.com>


Phoebe,

Is this a forms application? If so, is the "save button" in reference, a button you have added, or is the default forms save button?

If you have added the button and the record is displayed in the current data block simply change the desired field on the form then use a When-Button-Pressed trigger to commit the record.

If you are using the default forms save button, simply change the field data then press the button with out any additional code. This will save the record.

If I have totally mis-understood your post and the record truly is not displayed but are trying to update a record or group of records based on the ID of the currently displayed record then:

Using an added button use a When-Button-Pressed trigger as BEGIN
  UPDATE mytable

      SET field = your_new_data_item
     WHERE id = :id;

EXCEPTION
  WHEN some_exception THEN

      handle the exception;
END; HTH Brian

"Phoebe" <phoebe_at_hkem.com> wrote in message news:88oec7$nm8$1_at_news.ctinets.com...
> Dear all,
>
> I am writing application to update the record. I try to update the
> record when the "save" button pressed. But it throws an exception :
> dup_val_on_index
>
> cursor cur_cus is select * from customer
> where :id = id
> for update nowait;
> val_cus cur_cus%rowtype;
>
> if cur_cus%found then
> update customer set name = :name,
> address = :address
> where id = :id;
> commit;
>
> Can anyone tell me why dup_val_on_index raised when i update the record ??
> Thanks in advance.
>
> Phoebe
>
>
>
>
>
>
>
>
>
Received on Mon Feb 21 2000 - 16:29:54 CET

Original text of this message