Block based on a view

We have a block which is based on a view. When using Forms 6i 6.0.8.8.0 (no patch), querying from this block cause no problem. However, after applying patch 1 (6.0.8.10.3), the form crashes or take forever to retrieve the data.
Anyone has run into this problem ?
Is there a work-around other than installing a full patch ?
Is this a known bug ?
Thank you.

you create the view based on the tables first, then you use form design wizrad to create the form based on the view like a table.
If you want to allow user to edit the fields, then you may either to create a INSTEAD OF trigger on that view in database, or in form block, using ON-LOCK, ON-UPDATE/INSERT/DELETE triggers to do it.

Similar Messages

  • Is it possible to delete data from a block based on a view?

    I have a data block based on a view. I have set the delete allowed property to 'yes' using the object navigator, have set the database permission to allow delete, done a search through all the code to see where the delete_allowed property on the block may be reset in some trigger yet cannot delete records from the block.
    Any ideas?

    There are at least two/three ways to do this...
    Put an on-delete trigger on the block of the view with code something like this...
    delete from mytable where mytable_id = :myblock.mytable_id;
    ...or...
    dont do the above and add an instead of trigger to the view in the database. The instead of trigger intercepts the delete statement that would fail and executes code that you write in the trigger to go delete in mytable "instead of" the view.
    ... or...
    if you want to base a block on a procedure.. See this thread... Notice the metalink id in the thread..
    Re: Data block based on a procedure..
    Message was edited by:
    Mark Reichman

  • Lookup table with a block based on a view

    Hi!
    My form contain one module component based on a view, one of the items of my block is a libelle that exist in one
    of the tables queried by the view.
    my question is :
    how can I have a LOV on this item in order that the user select a value for a query???
    or, can I make a lookup table with a view ????
    Thanks!

    You said you copied an existing item in the block, and then copied an existing item in the layout editor - is it possible you actually created 2 separate items? Remove the one in the layout editor, and set the canvas of the one in the block so it is displayed in the layout editor. That could be the problem.

  • Problem updating data block based on a view

    Hi,
    I have a data block that is based on a fairly complex view, which I want to make update-able. The default Forms behavior, of course, is to not allow this.
    In an attempt to get around this, I defined an 'ON-LOCK' trigger, where I specified a single statement 'LOCK_RECORD;'. I also defined an ON-UPDATE trigger that will later call some stored PL/SQL procedures to effect the actual update (using INSTEAD-OF triggers and such). For now, I just display a message saying 'updation not currently supported'.
    However, a problem occurs when I make a change to an item in the data block, don't attempt to save it, yet try to navigate to the next record. The form simply hangs and the only thing I can do is kill the process.
    I'm deploying this form as within Oracle Apps 11i. I suspect this has something to do with the lock record but don't know how to get around this.
    Does any one have any suggestions?
    Thanks,
    Niranjan Ramakrishnan

    Your lock will be removed whenever the forms does a commit or rollback. In 'normal' forms processing the on-update trigger will fire as part of the commit form processing, which also includes a database commit which will remove any locks that have been taken out. Should the user clear the form a database rollback will be performed which will also remove any locks. You should not need to do any explicit removal of locks yourself.
    I would not recommend not having any kind of lock processing, as Sudha says, as this could easily lead to changes to record's being lost. As long as the locking of table(s) is always done in the same order deadlocking should not occur.
    You may make want to make the locking process a SELECT ... FOR UPDATE NOWAIT so if the record is already locked the user is informed and can try again later, rather than an unknown wait until the record becomes available.

  • 9i Forms Challenge! Query records from a data block based on this view

    According to Oracle Support, it is not unusual that complicated views like the one shown below fail to work in Forms. They recommend that I "try using a When-validate trigger" to solve the problem. I would be grateful if someone could show me how. It would also be helpful if someone could explain why Forms would have a problem querying such a view in the first place.
    Thanks very much!
    CREATE TABLE t (
    id NUMBER,
    property VARCHAR2(2),
    val NUMBER
    INSERT INTO t VALUES ( 1, 'A', 10 );
    INSERT INTO t VALUES ( 1, 'B', 11 );
    INSERT INTO t VALUES ( 2, 'A', 12 );
    INSERT INTO t VALUES ( 2, 'B', 13 );
    INSERT INTO t VALUES ( 3, 'A', 14 );
    || This view produces an ORA-01403 no data found error
    || in Oracle Forms 9i.
    CREATE OR REPLACE VIEW t_v
    AS
    SELECT id,
    MAX( DECODE( property, 'A', val, NULL ) ) AS a_val,
    MAX( DECODE( property, 'B', val, NULL ) ) AS b_val
    FROM t
    GROUP BY id;

    Steve,
    Your suggestion to put the view definition into the tablename field of the forms properties sheet was fruitful.
    Instead of the ORA-01403 error (No data found), I get ORA-24347 (Warning of a NULL column in an aggregate function). This error led me to discover bug 2457121, filed 11-Jul-2002, through Metalink. This bug is reported to only be a problem in Forms 9.0.2.7. It is reported to be fixed in Forms version 9.0.2.12.
    Thanks for your interest and help.
    - Doug

  • Inserting/updating data in control block based on view

    Hi!
    I`ve created a block based on a view to display data.
    I want this block to be insertable and updateable, that is I will use a on-insert/update trigger to call an insert/update procedure located in the database.
    When trying to change/insert a value in the block, the error message "Error: Can not insert into or update data in a view" pops up. I`ve tried to get rid of this error, without success.
    How can I make a data block based on a view insertable and updateable?
    My guess is that this have something to do with locking the records(there is no rowid in the view)... but I'm not sure.
    Pls advise!!

    Morten
    As well as on-update, on-insert, on-delete triggers you also need an on-lock,
    (even though it might just contain null;) otherwise the form will try to lock the view and fail.
    Actually your terminology is wrong, the block being based on a table or view is not a control block. A control block is not based on anything and has no default functionality for communicating with the database. If it was a control block, the on- triggers would not fire.

  • Block based on view ,enter query

    Hi,
    I have a block based on a view.One column of the view is
    substr(f_gt_marks(tcs23.idu_nr_dossr),1,128).
    When I enter 'PAPER%' for the above column and press execute query i get:
    PAPER
    PAPER1PAPER2
    When the form is in enter query mode and when I enter 'PAPER' and press execute query I get FRM 40301 query caused no rows to be retrieved.
    I want only paper to be retrieved.The form works only if I append % to the search criteria.
    Can you please advise me.
    I am working on forms 9i.
    Thanks and Regards

    Try to debug for form, and get the SQL Statement that is being executed, see if it's doing anything out of the ordinary and try to run in SQL*Plus and see the result.
    I think your SQL is trying use the SUBSTR function on the value you enter in ENTER-QUERY mode.
    SUBSTR(f_gt_marks('PAPER'),1,128)Anyway, best for you to see what the form's SQL statement is when issuing the query.
    Tony

  • One block based on two table when update/insert result in FRM-40654

    Hi,
    I ahve a multi line block based on two tables.
    Customers - AFCUSTOMER
    Maintenance - AFMAINT
    Some customers exist when maintenance doesnt so in my where clause i have
    AFCUSTOMER.CUSTID=AFMAINT.MAINT_CUSTID(+) AND AFCUSTOMER.CUSTBRANCHID=1 AND AFCUSTOMER.CUSTSTATUSID=2
    I have primary key set as the AFMAINT table primary key and have set DML data targetr name as AFMAINT.
    I am displaying customer name (from AFCUSTOMER) and type of payment (from AFMAINT) on screen and i want to change the type of payment which then uses pre update trigger to fil in the primary key of AFMAINT.
    Querying works fine and displays all records. But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another user. I have checked and block status is QUERY right before the list item is changed.
    Any ideas on where i am going wrong.

    But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another userWhen you start editing a record which is already stores in the database forms "rereads" the record from the database and check id all values in the database are the same as in the form. If there is some difference, forms assumes that someone else changed the record after you did the query.
    The main causes for that are:
    -Some database-trigger which changes the value of a column which is included in the form
    -numeric column with a higher precision in forms, than in the database
    -a block based on a view or "select from clause" which does not return the same values as inserted/updated through forms.
    I guess you run into the third issue. Check all the values in the forms-items after your dml and compare them to the values saved to the database, there will be some difference. If you find it, correct the error, if one, or re-read the data in the POST-UPDATE-trigger.

  • 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 create a block based on view

    We can create a block based on procedure...but whats the need to do so...please can anybody explain.

    create the block with the data block wizard. Use your View as Data-Source.
    After that set all items to QUERY-ONLY, when they are not updateable. E.g. if you create a view from EMP to DEPT. Then it is not allowed to update DNAME. DNAME is set to QUERY-ONLY.

  • Query based on a view

    Hello,
    Software: forms 10g
    problem: I have one block in my form based on a view. It works fine for my English language selection. However, when I switch to French I encounter an error.
    Example:
    Block name: REQUESTS_VIEW
    View_name: REQUESTS_VIEW
    Table: Requests
    Item_name: Office_id
    Column_name: Office_id
    Updatable/Queryable
    Item_name: Office_Name
    Column_name: Off_Eng_name
    Query only option selected
    LOV_OFFICE attached to item
    Office table contains the following columns:
    Office_id, Off_eng_name, Off_fre_name
    In my view I use a decode function for each variable that needs to be translated so that I select the correct column from my table. I did the same for the LOV attached to the office_name item.
    Problem: I cannot set the item_property column name to point to Off_fre_name when user selects French as a language, therefore, I get an error when I query. Oracle does not allow me to do that.
    Possible solution: To redesign each table and add a language column as follows:
    Office table
    Office_id, Office_name, language
    1, Head Office, 1
    1, Bureau Chef, 0
    language table
    language_id, language_name
    0, Français
    1, English
    However, this requires a redesign of my schema. Is there another way I can do this without changing the design structure?
    Thank you very much!
    Claudia

    As of 'I cannot set the item_property column name to point to Off_fre_name when user selects French as a language, therefore, I get an error when I query', I feel that you need to have two items-one for Off_Eng_name and another one for Off_fre_name on your form regardless of the language choice, but you need per language choice to hide the other language item. This way you don't have the above headache.

  • Form based on a view -  FRM-40654: Record has been updated by another user.

    Hi All,
    I am hoping that somebody can help me with this problem that is occurring only when I try an update a record in forms.
    I have a block based on a join-view, I can insert no problems, but I can only update certain records within the block. If I come across a second record that is similar to the first except for primary key and a couple of other values and try and update that record forms gives me the following message FRM-40654: Record has been updated by another user. Re-query to see change.
    The first record I have no problems in updating and I have followed a number of suggestions to get this to work, like setting the key-mode of the block to updateable/non-updateable and setting the primary key to 'yes' for some of the database items. I have also created procedures within the database that are called by triggers on-insert, on-update etc.
    If anybody has any ideas how I can solve this I would be happy to hear your suggestions.
    Thanks in Advance.
    Regards,
    Scott.

    Scott,
    beside of
    1) In the block properties change the Key Mode property of the block to be Non-Updatable Primary Key
    2) Mark one or more columns as Primary Key in the item Property Palette - in this instance you would set the property for Empno.
    Enforce Primary Key = no
    Key Mode = Unique
    Update Changed Columns Only = Yes
    I found a bug entry that is supposed to be fixed in Patch 9 of Forms 6i (assuming you are running 6i). So if you could try with a more recent Patch set (e.g. 14) then probably the problem will go away.
    Fran

  • Record Who information for a block based on procedure

    Hi All,
    I have a block whose query data source type property is set to procedure and query data source name is a procedure. When I hit Ctrl F11 on this block it shows me all the records. When I see the record who information , I see all the record who information except the Table Name. I understand that the table name is not coming as the query data source name is a procedure for this block. Is there a way to dynamically set this query data source name to a table or a view while still retaining the procedure based functionality. I tried set_block_property for this property but form won't allow.
    Thanks

    There are several recent posts on the topic with a lot of good help & documentation.
    The Metalink note: 66887.1
    Re: Form on a procedure
    If you can't access Metalink, search here on that note. Someone posted the full text a couple days ago.
    This is also very good reference:
    Block based on procedure
    Essentially, you have a procedure, returning a table-of-records type variable, called by the block "Query Data Source..." properties.
    Name = procedure name
    Arguments = procedure parameters (IN parameter(s) Value is :block.item)
    Source Columns = the record type columns for your table-of-records
    Datatypes & sizes must match all around.
    Start very simple & get it to work first, then expand.
    You must follow the documentation very carefully. If it doesn't work at first, go through everything to verify. Also, read the Tip & Issues at the end of the Metalink note.
    Have fun. It works awsome once you get the hang of it.

  • [Block based on From Query] On-Lock Trigger

    Hi,
    I have a block based on an Emp_Dept view.
    I manage updating and inserting with the On-Update and On-Insert triggers.
    I wonder if I have to code this in the On-Lock trigger:
    message( 'Oracle locks' );
    lock table emp in share row exclusive mode;
    If I want Oracle to prevent another user from updating the same row I'm updating.
    Thanks for your help.
    JBM

    This is the code we use to lock specific records in ON-LOCK:
    CURSOR crLock IS
      RESOURCE_BUSY EXCEPTION;
      PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -54);
      SELECT ID
        FROM THE_BASE_TABLE_OF_THE_VIEW
       WHERE ID=:BLOCK.ID FOR UPDATE OF ID NOWAIT;
      nDummy NUMBER;
    BEGIN
      OPEN crLock;
      FETCH crLock INTO nDummy;
      CLOSE crLock;
    EXCEPTION
      WHEN RESOURCE_BUSY THEN
        message('record cannot be locked');
        RAISE FORM_TRIGGER_FIALURE;
    END;

  • Updating a value of a text item in a multi record block based on a change

    Hi,
    I need to change the value of a text item in a multi record block based on a change to another item's value in the same block.
    Suppose there's a text item in a multi record block called dt1 which is of type date, which is changed in a particular record. I want to change the values of the another item in the same multi record block, for all other records by running a loop through all the records in multi record block. I dont want to do it on the press of a button, it should do automatically on change. Help me resolve this issue.

    Hi,
    I need to change the value of a text item in a multi record block based on a change to another item's value in the same block.
    Suppose there's a text item in a multi record block called dt1 which is of type date, which is changed in a particular record. I want to change the values of the another item in the same multi record block, for all other records by running a loop through all the records in multi record block. I dont want to do it on the press of a button, it should do automatically on change. Help me resolve this issue.

Maybe you are looking for

  • No database object is retrieved in SQL Developer 1.5

    Hi, The SQL Developer 1.5 that I have installed can connect to database but when I click on tables, packages or other type, nothing is retrieved. I'm very sure I have database objects in above categories as I have been using SQL Developer 1.2.1. What

  • Can any one implement Discrete wavelet transform in PDA module

    the attached vi does denoising based on dwt of waveform it works perfectly on computer but it shows some error when I try to run it as a pda module as I have used a dwt block from signal processing toolkit,could anyone suggest a solution or any other

  • Leopard Won't start, I messed with permissions.

    Hi! Ok, i have a Macbook Pro, the hard disk failed and i taken it to repair, a new hard disk was installed and they put all my old disk information in the new one. I was happy. I started to work and realized that every time I wanted to save a file in

  • I used to be able to use find my iPhone on my first gen phone.

    How do I set that up Find My iPhone on my first gen iPhone now that we've switched from Mobile Me to iCloud? Is looks like the only way to set that up is through the iCloud settings in the latest iOS but I don't think that'll run on this phone. Any a

  • Need help on netprice of material

    hi, how to get <u><i><b>netprice(not standerd price)</b></i></u>.please tell fm name(remote enabled). regards Guru