Problem inserting into view

  • I am getting an error on insert into a view:

    Update or insert of view or function %viewname% failed because it contains a derived or constant field.

    1) There are not contact or derived fields in the view or table

    2) The view explicitly selects all of the columns in the table (no select *)

    3) The insert explicitly names all of the columns

    I'm a little puzzled !!

  • We need the DDL of the tables and view(s) involved.  Along with the DML of the insert statement.  The exact error message may also be helpfull.

     

    TIA.

  • Remi isn't it true that if one of the columns is aliased, like SELECT CUSTNO as CustomerNumber, an insert into a view will fail?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Tooo many late nights .. I missed that I had added a computed column, although it wasn't showing up in the script or visual from Object Browser since I hadn't refreshed ..

    Thanks for the quick responses.

  • I'll have to take you word on this one.  I have neer been confronted with that situation.  However it does seem to make a lot of sens !

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply