0

I have a table as items, and a view is created from it as below.

# I have a table items as below

dbas_db_con.execute("SELECT *FROM items").df()

# Created a view items_v1 from items
dbas_db_con.execute("CREATE VIEW items_v1 AS SELECT *FROM items")

enter image description here

Here i would like to update items table as below-

# update a table items where comments is EMPTY with a TEST value as below

dbas_db_con.execute("UPDATE items SET comments='TEST' WHERE comments=''")

Now i will query on items and items_v1 as below:

# Query on Table: items
dbas_db_con.execute("SELECT *FROM items").df()

# Query on view : items_v1

dbas_db_con.execute("SELECT *FROM items_v1").df()

enter image description here

Here I can see comments field is updated in both table and view. How to restrict an update in view on doing a changes in items table?

myamulla_ciencia
  • 1,282
  • 1
  • 8
  • 30

0 Answers0