Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Cannot insert record error in form
Maria J wrote:
> I have a form that uses a query to access a view. I want to take 2
> fields from that view and post them to a table that is not part of the
> data block. I have confirmed the variables I have chosen match the
> format of the table I need to update. Here's the code - I can do this
> as an anonymous block in SqLPlus but not in the PL/SQL code.
>
> If res=alert_button1 then
> -- Insert information into Wish List Table
>
> DECLARE
> cid number(10):=:customer_id;
> isbn varchar2(20):=:isbn_no;
> BEGIN
> INSERT into tbl_wish_list
> VALUES(cid,isbn);
> END;
> Else
> -- Return to the search results screen
> message('We have not added this book.');
> message(' ');
> End If;
>
> Is it because I am doing this via PL/SQL and not a package? I tried
> to create the package but have another type of error (I posted
> earlier)
Well thank you for thinking that providing the error was irrelevant. That makes the job of trying to help you so much easier.
The only thing wrong with the block, above, is your formatting:
DECLARE
<variable declarations here>
BEGIN
<code here>
EXCEPTIONS
WHEN <here>
END;
That is not what you wrote.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Tue Jul 27 2004 - 23:08:15 CDT
![]() |
![]() |