1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

With read only view

Discussion in 'Oracle Apps Technical' started by salmankhalid, May 20, 2009.

  1. salmankhalid

    salmankhalid Forum Advisor

    Messages:
    116
    Likes Received:
    6
    Trophy Points:
    260
    Location:
    Lahore, Pakistan
    Code (Text):
    CREATE OR REPLACE VIEW mms.v_mmd_items
    AS
       SELECT qm.tender_id, '001021' tender_type_id, qm.quotation_no quotation_id,
              ig.description generic, qd.item_type, df.description dosage_form,
              qd.required_scale, ur.short_desc req_scale_unit, sp.NAME supplier,
              qd.description brand, co.NAME, qd.scale, us.short_desc scale_unit,
              qd.pack_size, UP.short_desc pack_unit, qd.pack_price,
              qd.unit_price_with_sales_tax unit_price, qd.final_price,
              qm.party_id supplier_id, qd.accepted, qd.approved,
              qd.manufacturer_id company_id, qd.base_pack_price,
              qd.sales_tax_percent gst, mf.NAME manufacturer_desc
         FROM mms.quotation_master qm,
              mms.quotation_detail qd,
              definitions.dosage_type df,
              definitions.unit us,
              definitions.unit UP,
              party.party co,
              party.manufacturer mf,
              party.party_mms sp,
              definitions.unit ur,
              inventory.mmd_item_group ig
        WHERE qm.tender_id = qd.tender_id
          AND qm.quotation_no = qd.quotation_no
          AND qd.dosage_form_id = df.dosage_type_id(+)
          AND qd.manufacturer_id = co.party_id(+)
          AND qm.party_id = sp.party_id(+)
          AND qd.required_scale_id = ur.unit_id(+)
          AND qd.scale_id = us.unit_id(+)
          AND qd.pack_unit_id = UP.unit_id(+)
          AND qd.manufacturer_id = mf.manufacturer_id(+)
          AND qd.generic_id = ig.item_id
                    [COLOR="Magenta"][B]WITH READ ONLY;[/B][/COLOR]

    What does the last line means in creating this view (With Read Only).....
     
  2. rajavu

    rajavu Forum Guru

    Messages:
    815
    Likes Received:
    52
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    Re: Help me in this matter

    Refer the link .. .

    Read Only Views

    You cant update or insert on such views. . .
     
  3. tyro

    tyro Forum Genius

    Messages:
    368
    Likes Received:
    20
    Trophy Points:
    260
    Location:
    India
    Re: Help me in this matter

    Hi Salman

    WITH READ ONLY implies that there can be no operations can be performed on this view. Now an updatable view is one you can use to insert, update, or delete base table rows. You can create a view to be inherently updatable, or you can create an INSTEAD OF trigger on any view to make it updatable.

    You write WITH READ ONLY to indicate that the table or view cannot be updated.
     
    salmankhalid likes this.
  4. rajavu

    rajavu Forum Guru

    Messages:
    815
    Likes Received:
    52
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    Except SELECT statement ...
     
    salmankhalid likes this.
  5. NAVEED

    NAVEED Active Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    55
    Location:
    karachi
    we are all know about view we can update and insert in view but according to this situation we can not modify this view its mean you can not insert and update to this view.
     
  6. salmankhalid

    salmankhalid Forum Advisor

    Messages:
    116
    Likes Received:
    6
    Trophy Points:
    260
    Location:
    Lahore, Pakistan
    thanx all of you helping me understanding this issue.........
     
  7. ranjithkeral

    ranjithkeral Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Gurgaon
    Re: Help me in this matter

    Hi tyro,

    I have seen your comments on read only view. it is wrong.

    Actually you can update any table irrespective of the views defined on the table.
    because view is nothing but a select statement on a single or multiple table.

    Second thing you can also update the table through view.
    if it is a simple view you can directly update the table throgh view. but if it is a complex
    view you have to use instead of trigger.

    Here in the case of read only view you can not update the table through view. but can update table directly. I think here instead of trigger will also work(not checked). bcz basically we will try to update base table through the trigger.

    Remember view is just like a select statement. so never compare this with a table...

    Hope this will guide you to assist others.

    Regards

    Ranjith.k
     
  8. ranjithkeral

    ranjithkeral Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Gurgaon
    Hi Salman,

    for your update...


    Actually you can update any table irrespective of the views defined on the table.
    because view is nothing but a select statement on a single or multiple table.

    Second thing you can also update the table through view.
    if it is a simple view you can directly update the table throgh view. but if it is a complex
    view you have to use instead of trigger.

    Here in the case of read only view you can not update the table through view. but can update table directly. I think here instead of trigger will also work(not checked). bcz basically we will try to update base table through the trigger.

    Remember view is just like a select statement. so never compare this with a table...

    Hope this will guide you to assist others.

    Regards

    Ranjith.k
     
  9. tyro

    tyro Forum Genius

    Messages:
    368
    Likes Received:
    20
    Trophy Points:
    260
    Location:
    India
    :) yes... i thought that was obvious...
     
  10. tyro

    tyro Forum Genius

    Messages:
    368
    Likes Received:
    20
    Trophy Points:
    260
    Location:
    India
    Re: Help me in this matter

    Oh sorry i didn't mean that the table can't be updated. I was saying that the Read Only View can't be updated.