Update a view in oracle forms

Hi.
I have a block based on a view ( this view is based on two tables). How do I update the base tables when the record based on this view is updated in the form?
Thanks

one way is to control the transaction by using database trigger " instead of "
on the view.
If a view is inherently updatable and has INSTEAD OF triggers, the triggers take preference. In other words, Oracle fires the triggers instead of performing DML on the view.
second way is to execute a DML from the forms manually by intersepting the default functionality of on-insert, on-update trigger and so on..... to perform transaction on the table.
But i'll recommend using the INSTEAD of triggers, see documentation for more help and examples.

Similar Messages

  • Updating record in a data block based on view in oracle forms

    hi all ,
    We have two data blocks in our custom oracle form.The first data block is for search criteria provided with buttons 'GO' and 'ADD ROW' and the second data block is based on a view that fetches record when user clicks on GO based on the the criteria specified in the above block. The Below block contains one SAVE button too.
    We have a requirement when GO button is pressed and corresponding records are shown in the below block, user should be able to edit the record. Want to know how to make it editable?
    Help appreciated....!!!

    Your view is based on how many tables and does it include all NOT NULL fields from all tables?

  • Need to update mutli record in oracle forms - Urgent please

    Hi,
    We are using Oracle apps release 11i - Oracle forms 6i.
    I have a field "project_start_date" in project_block in a custom form. There is another multi-record block called role_block in the same custom form and it has a field named start_date. Requirement is when ever I make change in the project_start_date in project_block, that should reflect in role_block.start_date. I tried different means and could update only the very first record of the multi-record block - role_block. I need to update all the records in the role_block with the same project_start_date. Used looping and several other methods. But could not achieve. Any help is really appreciated.
    Thanks
    Akil

    Please first read this https://forums.oracle.com/forums/ann.jspa?annID=432
    We are using Oracle apps release 11i - Oracle forms 6i.I can't understand this together.
    I have a field "project_start_date" in project_block in a custom form. There is another multi-record block called role_block in the same custom form and it has a field named start_date. Requirement is when ever I make change in the project_start_date in project_block, that should reflect in role_block.start_date. I tried different means and could update only the very first record of the multi-record block - role_block. I need to update all the records in the role_block with the same project_start_date. Used looping and several other methods. But could not achieve. Any help is really appreciated.
    Thanks
    AkilIs there any relation between project_block and role_block ?
    Do u want to update corresponding column (specific filed) of role_block when updating project_start_date in forms? How may rows will be updated for one project_start_date update ? one or multiple or all ?

  • Tree view in Oracle forms

    Hello experts,
                         I am new in oracle forms and i am using oracle forms 11g with weblogic server 10.3.5 at windows7.I have a problem to make a tree item in oracle forms based on two tables.
    I have 2 tables as:
    TBL_ARTICAL_MSTR
    ARTICLE_ID
    ATRTICLE_TYPE
    1
    MAN
    2
    Women
    TBL_ARTICLE_DTL
    ARTICLE_NO
    NAME
    ARTICLE_ID
    1
    Jeans
    1
    2
    Skirts
    2
    3
    T-Shirt
    1
    Now I want a tree view as:
    |
    |___MAN
    |       |______JEANS
    |       |______T-Shirt
    |
    |___WOMEN
            |______Skirts
    For this I have made a Record group  with a sql query as:
    SELECT 1 , level , TBL_ARTICAL_MSTR.ATRTICLE_TYPE,TBL_ARTICLE_DTL.NAME , NULL , to_char( TBL_ARTICLE_DTL.ARTICLE_NO)
    FROM TBL_ARTICAL_MSTR LEFT JOIN TBL_ARTICLE_DTL ON TBL_ARTICAL_MSTR.ARTICLE_ID=TBL_ARTICLE_DTL.ARTICLE_ID
    CONNECT BY prior TBL_ARTICLE_DTL.ARTICLE_NO = TBL_ARTICAL_MSTR.ARTICLE_ID
    START WITH TBL_ARTICAL_MSTR.ARTICLE_ID=1
    But There is no any output,Please help me to know that how can i solve it.
    Thank You
    regards
    aaditya.

    how to create hierarchical tree form
    https://sites.google.com/site/craigsoraclestuff/oracle-forms---how-to-s/forms-how-to-create-a-hierachical-tree-form

  • The requirement to view online Oracle Form?

    Hello there,
    I am trying to view an online Oracle Form from an Oracle Form Server. As I know that, IE browsers with JVM support should be able to open the form and view it. But I am not so sure which version of the IE browser is able to do that. What I know is, with IE version 5 and above, it is able to do so. But how about IE 4 with JVM support? Is it able to do so?
    Best Regards,
    Candy

    check out the client platform support paper on http://otn.oracle.com/products/forms

  • Database replication with updatable materialized view in oracle 10gR2

    I neet to set up 1 central server and two local databases ....the local database will hold materialized view....now how to replicate data...in this scenario...please help as soon as possible...i am in rush.....
    the database i use is oracle 10g Release 2
    Edited by: user9932019 on Sep 4, 2009 2:25 AM

    It's not a process that can be explained in a forums posting. You have to understand the steps.
    Here are some other examples :
    http://www.orafaq.com/wiki/Scripts#Oracle_Advanced_Replication_Scripts

  • Created by & Updated by in the Oracle forms

    Hi All,
    As you know in the menu window -> Record history we can trace who created updated the PO or Invoice or Receipt etc. For the update by, it will record the lastest update person for the object. But if the object has been updated by different ppls more than once, how can know list of user which updated the object before? Could you help me on this?
    Thanks & Best Regards,
    Jerome

    Hi,
    Thanks for your help. Could you guide me enable the auditing?Please refer to:
    Note: 60828.1 - Overview of Oracle Applications AuditTrails
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=60828.1
    Note: 105624.1 - Troubleshooting (Audit Trail)
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=105624.1
    Note: 395849.1 - How do you audit an Oracle Applications' user?
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=395849.1
    Regards,
    Hussein

  • Oracle forms and reports with object views in oracle 9i

    Can We use oracle 9i Object Views in oracle forms and reports. If yes, then which version?

    MichaelFerrante,Thank you for your help.
    I have already used the HS services to connecto to external databases from our main Oracle database, and the solution works fine.
    But unfortunally for this particular client he cannont have installed a Oracle database due to internal policies restrictions.
    I can not migrate the full application to another technology like ADF in less than 6 or 8 months.
    Do you thifnk that there is any other solution?
    Mensagem editada por: user10660669

  • Insert multiple record Oracle forms 6i/9i/10g

    Hi,
    how can i insert multiple record using a tabular view in oracle form,
    do i have to use for loop?
    can someone help me? i've kindda stuck in this problem..
    scenario:
    i have 5 display of last_name text_item and i put 4 names on it..
    if i use insert into, it only get the 4th name i putted..
    question:
    how can i put them all together?

    Hi Vansul,
    for example, let us use the field name last_name on the employees table
    and we have text_item named text_last_name that has been displayed 4 times.
    and i will put 4 names on it.
    last name
    brown
    marco
    lester
    king
    when i click the submit button, it will only get the last_name king.
    now the question is how can i insert them all in my table?
    my PL/SQL in my submit button is
    begin
    insert into employees
    +(last_name)+
    values(:blk_emp.text_last_name);
    standard.commit;
    end;
    any help? I really need to solve this one.
    Edited by: Nelzki on Jan 26, 2012 1:59 AM

  • View based form updation in 6i and 10g forms.

    Hi All,
    I am facing a strange problem.
    I created a form based on a view, which is based on a single table. i made a copy of the form and converted it to 10g.
    When running in 6i, i can update the data through forms. But in 10g, its showing FRM-40602: Cannot insert into or update data in a view.
    Can anyone tell what is wrong?
    Thanks & Regards,
    Manu.

    hi Manu
    How to insert new record or update existing record using a complex view?
    to make dml against a complex view with instead of triggers a reality. There should be no need to write an on-update trigger in your form. Indeed, the reason for a view and instead-of-trigger on that view is so that you do not require additional coding in your form.
    1) you need the instead-of-trigger on the view (confirm it is there)
    2) you need to change the locking mode in the form for the block based on your view so that it uses the logical key for locking purposes. There is a lock mode setting somewhere in the block properties page, find it, understand the differences and pick the righ tone (I forget at this moment which on it is, try them all if necessary).
    3) #2 will involve selecting those fields that map to the business identifier/primary key you want to you use for finding rows. You need to visit each field's property page and set the appropriate attribute to indicate that is is part of the key used to find rows. It is there on the properties page but not having forms available at the moment I cannot give you the property name. You will have to do a little exploring to find it.
    If you do these things, the error should go away and the view become updatable via oracle forms without the need to write any on-update trigger.
    Do some testing at the database level first. Make sure you can update the view directly via sqlplus first with the instead-of-trigger before you attempt it in the form. This will ensure that your issue is forms related and not database related. This is an important step because the database will return a similar error to what you have reported if the instead-of-trigger does not exist on the view.
    sarah

  • View pdf file stored in oracle database through oracle forms

    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    Oracle Toolkit Version 10.1.2.0.2 (Production)
    PL/SQL Version 10.1.0.4.2 (Production)
    Oracle Procedure Builder V10.1.2.0.2 - Production
    PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
    Oracle Query Builder 10.1.2.0.2 - Production
    Oracle Virtual Graphics System Version 10.1.2.0.2 (Production)
    Oracle Tools GUI Utilities Version 10.1.2.0.2 (Production)
    Oracle Multimedia Version 10.1.2.0.2 (Production)
    Oracle Tools Integration Version 10.1.2.0.2 (Production)
    Oracle Tools Common Area Version 10.1.2.0.2
    Oracle CORE     10.1.0.4.0     Production
    I have created external directory and am able to load pdf files in oracle database table called test_blob.
    CREATE TABLE test_blob (
    id NUMBER(15)
    , file_name VARCHAR2(1000)
    , image BLOB
    , timestamp DATE
    I have 2 pdf files in the table. I want to view this pdf from forms when the user clicks on the button. On when-button-pressed trigger I want to show pdf on the screen. Any help is appreciated. Not on the designer. I want to run form application.
    SELECT id, file_name,
    DBMS_LOB.GETLENGTH(image) Length,
    timestamp
    FROM test_blob
    ID|FILE_NAME|LENGTH|TIMESTAMP
    1001|2011 HeartlandEmployeeReferralCard.pdf|353718|1/28/2013 11:44:41 AM
    1002|2011 HeartlandEmployeeReferralCard.pdf|353718|1/28/2013 11:51:07 AM
    Edited by: user_anumoses on Jan 28, 2013 11:45 AM

    We were able to do the same thing with Oracle Application Server and Oracle WebLogic Server. I cannot remember how different the processes were, but it seems like they were very similar. I am going to give you the instructions on how we implemented a "Read PDF" procedure on the WebLogic Server. If you are still on the Application Server you may have to do some Google searches, but it all boils down to the mod_plsql DAD Configuration file.
    Our PDF was located in a table with the following structure:
    CASE_DOCUMENTS
       (id_document                    NUMBER NOT NULL,
        doc_blob                       BLOB,
        note                           VARCHAR2(240),
        created_by                     VARCHAR2(20) NOT NULL,
        created_dt                     DATE NOT NULL,
        case_id                        NUMBER NOT NULL,
        filename                       VARCHAR2(100) NOT NULL)Based on that table structure we created a procedure named READ_PDF which you will reference below in the dads.conf file below:
    CREATE or REPLACE procedure read_pdf (p_id_document IN number)
    is
      view_file     blob;
    BEGIN
      select doc_blob
        into view_file
        from case_documents
       where id_document = p_id_document;
      OWA_UTIL.MIME_HEADER ('APPLICATION/PDF', FALSE);
      HTP.P ('CONTENT-LENGTH: ' || DBMS_LOB.GETLENGTH (view_file));
      OWA_UTIL.http_header_close;
      WPG_DOCLOAD.download_file (view_file);
    END;
    GRANT EXECUTE ON read_pdf TO financial_user_role  -- Name of role to execute
    /Basically, you are passing in one parameter and that is the primary key for your table. You are selecting the pdf stored in a BLOB for that primary key. The commands below that allow the pdf to open up so you can view it – we got this off some search we did a few years ago.
    Now, you need to add logic to your Oracle Form that will call the procedure above, but the URL is based on the dads.conf file that we will set up below… Anyway, we created a button on the form module with a label of "View". In the WHEN-BUTTON-PRESSED trigger the logic looks like this:
    -- The View logic uses the DAD (Database Access Descriptors) method to view a .pdf file from the form.
    -- The DAD was created on WebLogic Server  with the name findadgen.  This allows an http request be made
    -- to the database.
    declare
      v_file          varchar2(400);
      v_success       boolean;
      ret_val         number;
      v_http_link     varchar2(400);
    begin
      -- The format of the link is as follows: hostname:port/pls/DAD_name/procedure_name
      v_http_link := 'http://finas03:8888/pls/findadgen/read_pdf?p_id_document=' || :case_documents.id_document;
      web.show_document(v_http_link, '_BLANK');
    end;The name of our WebLogic Server is "finas03" so that is what is listed in the URL. The "findadgen" is the name of the <Location> in the dads.conf file below, the "read_pdf" is the name of the procedure we created above, the "p_id_document=" is the IN parameter listed in the READ_PDF procedure created above, and the ":case_documents.id_document" is the reference to the primary key in our Oracle Form.
    For WebLogic, you can either go through Enterprise Manager (directions below) or update the dads.conf file on the filesystem directly (if you update the dads.conf file directly then skip to step 4 and ignore step 5):
    1.     Enterprise Manager -> Web Tier -> ohs1
    2.     Oracle HTTP Server (pull-down) – Administration – Advance Configuration
    3.     Select File – dads.conf
    4.     Add something similar:
    # ============================================================================ 
    #                     mod_plsql DAD Configuration File                         
    # ============================================================================ 
    # 1. Please refer to dads.README for a description of this file                
    # ============================================================================  
    # Note: This file should typically be included in your plsql.conf file with 
    # the "include" directive. 
    # Hint: You can look at some sample DADs in the dads.README file 
    # ============================================================================
    <Location /pls/findadgen>
        SetHandler pls_handler
        Order allow,deny
        Allow from All
        AllowOverride None
        PlsqlDatabaseUsername financial
        PlsqlDatabasePassword sdo_3#d1
        PlsqlDatabaseConnectString ffindbTNSFormat
        PlsqlNLSLanguage AMERICAN_AMERICA.WE8ISO8859P1
        PlsqlAuthenticationMode Basic
        PlsqlDefaultPage read_pdf
    </Location>You are adding the <Location> section to your dads.conf file. The "finddadgen" is the name that you will reference in a change you fill make to your Oracle Form. The "financial" is the Schema, the "sdo_3#d1" is the password for that Schema, the "ffindb" is the database that the stored procedure is located on, and the "read_pdf" is a stored procedure you will have to create in order to read the pdf.
    5.     Press the "Apply" Button
    6.     Obfuscate the DAD password by running the dadTool.pl script located in $ORACLE_HOME/bin (This was done on Unix on our server with the following commands):
    $> LD_LIBRARY_PATH=$ORACLE_HOME/lib;export LD_LIBRARY_PATH
    $> cd $ORACLE_HOME/bin
    $> perl dadTool.pl -f /u01/app/oracle/middleware/asinst_1/config/OHS/ohs1/mod_plsql/dads.conf
    7.     Restart the Oracle HTTP Server using Fusion Middleware Control:
    Enterprise Manager -> Web Tier -> ohs1
    Oracle HTTP Server – Control – Shutdown
    Oracle HTTP Server – Control – Start Up
    If you followed the instructions above, you should have created a stored procedure, added logic to your Oracle form to reference that stored procedure, and created an entry in the dads.conf file. Once you move the form onto the server and you restart the HTTP Service, you should be able to view a pdf that is stored in a table directly from your Oracle Form.

  • Oracle forms 10g,multiple insert and update problem

    Hi,
    I have tabular form(4 records displayed) with one datablock(based on a view).
    After querying the form could not update all the records but only first record value can select from LOV.
    I called a procedure in in-insert and on-update
    The query is lik this
    PACKAGE BODY MAPPING IS
         PROCEDURE INSERT_ROW(EVENT_NAME IN VARCHAR2)
         IS
         BEGIN
              IF (EVENT_NAME = 'ON-INSERT') THEN
                   INSERT INTO XX_REC_MAPPING
                   (BRANCH_CODE,COLLECTION_ID,PAY_MODE_ID,RECEIPT_METHOD,CREATED_BY,
                   CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN)
                   VALUES
                   (     :XX_REC_MAPPING.OFFICE_CODE,
                        :XX_REC_MAPPING.COLLECTION_ID,
                        :XX_REC_MAPPING.PAY_MODE_ID,
                        :XX_REC_MAPPING.RECEIPT_METHOD,
                        :XX_REC_MAPPING.CREATED_BY,
                        :XX_REC_MAPPING.CREATION_DATE,
                        :XX_REC_MAPPING.LAST_UPDATED_BY,
                        :XX_REC_MAPPING.LAST_UPDATE_DATE,
                        :XX_REC_MAPPING.LAST_UPDATE_LOGIN);     
              ELSIF (EVENT_NAME = 'ON-UPDATE') THEN          
              UPDATE     XX_REC_MAPPING
              SET BRANCH_CODE=:XX_REC_MAPPING.OFFICE_CODE,
                        COLLECTION_ID=:XX_REC_MAPPING.COLLECTION_ID,
                        PAY_MODE_ID=:XX_REC_MAPPING.PAY_MODE_ID,
                        RECEIPT_METHOD=:XX_REC_MAPPING.RECEIPT_METHOD,
                        LAST_UPDATED_BY=:XX_REC_MAPPING.LAST_UPDATED_BY,
                        LAST_UPDATE_DATE=:XX_REC_MAPPING.LAST_UPDATE_DATE,
                        LAST_UPDATE_LOGIN=:XX_REC_MAPPING.LAST_UPDATE_LOGIN
                        WHERE ROWID=:XX_REC_MAPPING.ROW_ID;
              END IF;
         END INSERT_ROW;
    END MAPPING;
    Whether the table gets looked or sholud i use some other trigger or loops ?
    someone suggest me how to edit this query for multiple update.
    Thanks
    sat33

    I called a procedure in in-insert and on-updateWhy are you writing this code in the first place? If you have a block based on an updatable view, just let Forms do the inserts and updates.
    If it's not an updatable view, use instead of triggers on the view.
    See this current thread too:
    INSTEAD of Trigger View for an Oracle EBS New form development

  • Unable to do UPDATE in Oracle Form 10.1.2

    Hi,
    I am using an LOV to query data from a master-type table.
    -- WHEN-BUTTON-PRESSED in button Retrieve
    declare
      l_number number;
      a_value_chosen boolean;
    begin
      a_value_chosen := Show_LOV('LOV_CUSTOMER');
      if not a_value_chosen then
        message('No value selected');
        raise form_trigger_failure;
      end if;
    end;First, I choose a value from the LOV. The LOV showed the selected items in the Form.
    Next, I modified some values (not the Primary Key) in the Form text items.
    Finally, I tried to Save the modification into table, using
    -- WHEN-BUTTON-PRESSED in button Save
      commit_form;
      clear_form;Surprisely, it showed
    FRM-40508: ORACLE error, unable to INSERT record.
    BTW,
    Previuosly, I can do UPDATE if I use the Enter Query and Execute Query button.
    I did not attempt to do inserting, just updating.
    Could someone show where is the problem?
    Is the form status not changed by the query returned from LOV?
    Any help would be grateful.
    Many thanks,
    Imelda

    Hi,
    Glad I found all of you in this forum.
    Thanks for all of the explanations.
    I thought by using LOV would suppress the network traffic.
    If the use of LOV would give lots of drawbacks, then I should see the Enter_Query() Execute_Query() instead.
    BTW,
    I found the button Enter Query and Execute Query on the toolbar.
    (Seems that Oracle Form provides lots of help to simplify the programming)
    I have some sort of problems in using them :
    1. Well, they do the query and retrieve the records for a match query criteria.
    But it did not give any specific message if the record does not exist.
    The message bar (for unknown reason) is showing
    "Enter a query; press CTRL+F11 to execute, F4 to cancel."
    Can we change this behaviour?
    Perhaps, showing "No record(s) are retrieved for this query. Either change the query criteria; press CTRL+F11 to execute, F4 to cancel."
    2. I found the Count Hits from Query menu.
    Based on the documentation, the message line will show the records number returned based on query
    criteria, without actually retruning the records to the user.
    I am not sure whether this function has been removed for the Oracle Developer 10g (10.1.2), since
    there is nothing happen, and the message line keep showing
    "Enter a query; press CTRL+F11 to execute, F4 to cancel."
    Do we tho do some modification to the Forms to use Count Hits?
    3. I read on the documentation about Query Where dialog box.
    Query Where will be showed if user enter a colon ':' in a field in Enter Query mode for query criteria.
    Again, I am not sure whether this function has been removed too.
    the message line showed :
    FRM-40367: Invalid criteria in field <field_name> in example record.
    It happens if the criteria contains # or : or &
    Or is it done via another way?
    Any help would be grateful.
    Many thanks,
    Imelda.

  • Oracle Forms - need to update multi-record block - Help needed asap

    Hi,
    We are using Oracle apps release 11i - Oracle forms 6i.
    I have a field "project_start_date" in project_block in a custom form. There is another multi-record block called role_block in the same custom form and it has a field named start_date. Requirement is when ever I make change in the project_start_date in project_block, that should reflect in role_block.start_date. I tried different means and could update only the very first record of the multi-record block - role_block. I need to update all the records in the role_block with the same project_start_date. Used looping and several other methods. But could not achieve. Any help is really appreciated.
    Thanks
    Akil

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Application Development in PL/SQL » Forms which you can get more quick response
    Regard
    Helios

  • Problem using views containing xpath expressions with Oracle Forms

    Mark,
    Nice to see you back on the forum answering questions.
    This example is based on the standard purchaseorder schema.
    i registered the schema, created a relational table and then created
    a view using xpath.everything works well and i am able to select the data
    using sql*plus. Now this views is like any other view, when i describe the
    view, i can see the all the data types are valid for the columns and also the lengths.
    Now when i try to base a data block in oracle forms using this view, i get error
    "ORA-24324 - service handle not initialized."
    Whereas if i create another view on top of the first view and then base the data block on this view, it works for me. i described the second view from sql*plus and everything seems to be same for me.
    this is the same behaviour from database 9i r2 and it exists in 10g r1 also.
    Any hints as what might be the problem or you would like me to file a tar for this.
    create or replace view purchaseorder_header_xml
    as
    select  id
           ,extractvalue(xml_data, '/PurchaseOrder/Reference') reference
           ,extractvalue(xml_data, '/PurchaseOrder/Requestor') requestor
           ,extractvalue(xml_data, '/PurchaseOrder/User')      po_user
           ,extractvalue(xml_data, '/PurchaseOrder/CostCenter') costcenter
           ,extractvalue(xml_data, '/PurchaseOrder/SpecialInstructions') spl_instructions
    from tab_xmldata
    create or replace view purchaseorder_header
    as select * from purchaseorder_header_xml
    /Raghu

    Not used Forms for years. However I suspect that Forms is trying to poke around behind the view and not understanding what it sees. I expect you'll need to open a Forms Tar to get to the bottom of this. It also appears that you a workaround which is to create a view on the view by the sound of it..

Maybe you are looking for