Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8792415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:58:33+00:00 2026-06-13T22:58:33+00:00

I created a view using this (neglected other columns): create view view_table (is_root) as

  • 0

I created a view using this (neglected other columns):

create view view_table (is_root) as select
  case when C1 = 'Yes' then 1
       when C1 = 'No' then 0
       else 0
  end as is_root
  from remote_db_table

But when I tried to update the view using:

update view_table set is_root=1

It does not work. Any way to do it? The view is in Oracle but the remote table is in mySQL

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:58:34+00:00Added an answer on June 13, 2026 at 10:58 pm

    You can do this in Oracle by building an INSTEAD OF trigger on the view.

    create or replace trigger vt_instead
        instead of update on view_table
    begin
        if :new.is_root != :old.is_root
        then
            update remote_db_table
            set C1 = case when :new.is_root = 1 then 'Yes'
                          else 'No' end
            where id = :new.id;
        end if;
    end;
    /
    

    This will allow you to issue an UPDATE against the view which will propagate changes to the underlying view:

    update view_table
    set is_root = 0
    where id = 23
    /
    

    I haven’t tested this against a remote table on a MySQL database (not having such a set-up to hand), but if you can update the table remotely in SQL*Plus then the trigger should work as well.


    ” I want to update all the 40 columns, but only one columns is not
    updatable like above”

    I’m afraid you’re still not making completely yourself clear but what I think you’re asking is how to handle columns which don’t require translation.

    The INSTEAD OF trigger fires instead of the triggering DML statement (the clue is in the name). That means you need to handle all the columns which you want to be updated through the view. In your scenario that would be all forty columns. The revised trigger
    code might look like this:

    create or replace trigger vt_instead
        instead of update on view_table
    begin
        update remote_db_table
        set C1 = case when :new.is_root = 1 then 'Yes'
                      else 'No' end
            , C2 = :new.col2
            , C3 = :new.col3
            , C4 = :new.col4
            ....
            , C40 = :new.col40
        where id = :new.id;
    end;
    /
    

    Any column not included in the table update statement cannot be updated through the view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a page by using view 2. This page list all
I generated a View using VS 2010 functionality. This auto code generation created this
I have created a 3D flip of a view using this android tutorial However,
I have an assignment to create a print view using HTML & CSS. This
I created a Materialized view using the following code: CREATE MATERIALIZED VIEW M_USER_HIERARCHY BUILD
I have created a VIEW using the CREATE OR REPLACE VIEW statement at the
I want to create a control like this: I created view and viewmodel of
I have created navigaton view using Sencha touch 2. Navigation view has list component
I have a View (created using Backbone.View.extend) and a JSON object, I actually get
So I created a custom text view using core graphics and have it conformed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.