Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Views and Inserts

Re: Views and Inserts

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 02 Feb 2004 11:48:16 -0800
Message-ID: <1075751237.951408@yasure>


Rajesh Patel wrote:

> I have an existing database that i cannot change, unfortunately
> they have used CHAR instead of VARCHAR, so we
> are going to have to code around the right padding
> issues.
>
> I attempted to remedy this by using a view and using
> TRIM to get rid of the padding, however when I do
> an insert on the trimmed fields I get:
>
> [WARN] JDBCExceptionReporter - -SQL Error: 1733, SQLState: 42000
> [ERROR] JDBCExceptionReporter - -ORA-01733: virtual column not allowed here
>
> I take this to mean that when trimmed those fields the database lost
> the link to the underlying table. If I remove the trim statments
> from the view inserts work correctly.
>
> Any Ideas? Strategies to get around this issues?
>
> Raj
>

Look at CAST as well as TRIM ... but the solution is to use an INSTEAD-OF trigger on the view.

http://www.psoug.org/reference/instead_of_trigger.html

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Mon Feb 02 2004 - 13:48:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US