Creating an Automatic Row Fetch

Hello,
I'm trying to make an Automatic Row Fetch. The problem is that I have 3 values as a primary key in my table and I can fill in only two in the Row Fetch.
Does anyone have a solution to this?
Thanks in advance.

Hi "user573175",
I don't think APEX can do Automatic Row Fetch based on a pk of 3 values.
I always try to limit my pk to 1 or 2 columns (as APEX has this limit).
So my solution for you would be:
- Use a PK of 1 or 2 columns and use Automatic Row Fetch
- or Keep your 3 value PK and use a PLSQL function instead of the automatic row fetch
Dimitri

Similar Messages

  • ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate

    ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate a form.
    1) Created a FORM on EMP using the wizards. This creates an AUTOMATIC ROW FETCH
    TABLE NAME - EMP
    Item Containing PRIMARY KEY - P2099_EMPNO
    Primary key column - EMPNO
    By default the automatic fetch has a ‘Process Error Message’ of ‘Unable to fetch row.’
    2) Created a HTML region. Within this region add
    text item P2099_FIND_EMPNO
    Button GET_EMP to submit
    Branch Modified the conditional branch created during button creation to set P2099_EMPNO with &P2099_FIND_EMPNO.
    If I then run the page, enter an existing employee number into P2099_EMPNO and press the GET_EMP button the form is populated correctly. But if I enter an employee that does not exist then I get the oracle error ORA-01403: no data found and no form displayed but a message at the top of the page ‘Action Processed’.I was expecting a blank form to be displayed with the message ‘Unable to fetch row.’
    I can work around this by making the automated fetch conditional so that it checks the row exists first. Modify the Fetch row from EMP automated fetch so that it is conditional
    EXIST (SQL query returns at least one row)
    select 'x'
    from EMP
    where EMPNO = :P2099_EMPNO
    But this means that when the employee exists I must be fetching from the DB twice, once for the condition and then again for the actual row fetch.
    Rather than the above work around is there something I can change so I don’t get the Oracle error? I’m now wondering if the automatic row fetch is only supposed to be used when linking a report to a form and that I should be writing the fetch process manually. The reason I haven’t at the moment is I’m trying to stick with the automatic wizard generation as much as I can.
    Any ideas?
    Thanks Pete

    Hi Mike,
    I've tried doing that but it doesn't seem to make any difference. If I turn debug on it shows below.
    0.05: Computation point: AFTER_HEADER
    0.05: Processing point: AFTER_HEADER
    0.05: ...Process "Fetch Row from EMP": DML_FETCH_ROW (AFTER_HEADER) F|#OWNER#:EMP:P2099_EMPNO:EMPNO
    0.05: Show ERROR page...
    0.05: Performing rollback...
    0.05: Processing point: AFTER_ERROR_HEADER
    I don't really wan't the error page, either nothing with the form not being populated or a message at the top of the page.
    Thanks Pete

  • Automatic row fetch and items initialization

    Hi team,
    I was modifying a page and I came across the following situation:
    I had a form with MRU processing and automatic row fetch and I wanted to make SAVE and DELETE buttons conditional basing on a certain flag contained in the row being read.
    The flag is read into a hidden item having sequence number lower than any button, however I found out that the condition could not be reliably tested as the value in the session state was coming from a previous visit to the page. Some times the buttons were there, some not, at the beginning it was puzzling.
    So, I added a computation based on a SQL query where the hidden flag was computed before the header, basing on the primary key being passed from the calling page and the problem was gone, but for some reason I didn't feel satisfied, it was too cumbersome.
    I thought session state items would be assigned beforehand, but for some reason it looked like they were assigned at a later time, even if the automatic fetch process is supposed to run before the header.
    Then I noticed an "innocent" option in the fetch process definition saying "set memory cache on Fetch / set memory cache on Display".
    In my case was checked the former, but as soon as I checked the latter, I could remove the unnecessary SQL query computation.
    So, I started off posting a problem and ended up with the solution...
    Bye,
    Flavio

    Flavio,
    Thanks for the testimonial. That feature (new in 1.6) is for the very situation you described. When you create new row fetch processes they will have the "set memory cache on Fetch" option selected by default. For existing processes, the option must be manually changed.
    Scott

  • Automatic row fetch based on a select list

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i want to do automatic row fetch when the value of a select list changes ?
    but first i should ofcourse create a tabular form to fetch the data into it , but what i want is ,if i fetch 2 rows then the report contains only two rows , if i fetch 3 , the report contains only 3
    , if i fetch nothing , the report has nothing ?
    thanks

    Assuming all your page items are on separate rows, under your Page Attributes Header and Footer section, add the below function under Header Text:
    <script>
    function f_toggleNM() {
       // if P2_ATTACHMENT_TYPE value is D, then show row holding P2_CUSTOM_NAME and P2_CUSTOM_MSG. Else hide them
       $f_Show_On_Value_Item_Row('P2_ATTACHMENT_TYPE', [ 'P2_CUSTOM_NAME', 'P2_CUSTOM_MSG' ], 'C');
       // if P2_ATTACHMENT_TYPE value is C, then show row holding P2_DEFAULT_NAME and P2_DEFAULT_MSG. Else hide them
       $f_Show_On_Value_Item_Row('P2_ATTACHMENT_TYPE', [ 'P2_DEFAULT_NAME', 'P2_DEFAULT_MSG' ], 'D');
    </script>Under Footer Text, add the below:
    <script>
    f_toggleNM();
    </script>And on the P2_ATTACHMENT_TYPE item, Element tab, HTML Form Element Attributes, add below:
    onchange="f_toggleNM();"Hope this helps. Thanks!
    JMcG

  • Call a Automatic Row Fetch from a Dynamic Action

    Hi,
    can I execute the Automatic Row Fetch from a dynamic action?
    I only found this post (Dynamic Actions to call Automatic Row Processing (DML) but the link where the solution is does not work :(
    Thanks,
    Edited by: Elena.mtc on 09-nov-2012 5:46

    Elena.mtc wrote:
    I forgot to say, for several reasons, I don't want to submit the page. So that's where I find the complexity in calling the ARf.
    Thanks.You cannot fire the ARF because it is designed to run when the page is rendered and it cannot be called as a standalone
    Create a dynamic action as follows to fetch the form detials
    Action: Execute PL/SQL Code
    PL/SQL Code:
    begin
      select ename, job, mgr, hiredate, sal
        into :P4_ENAME, :P4_JOB, :P4_MGR, :P4_HIREDATE, :P4_SAL
        from emp
       where empno = :P4_EMPNO;
    exception
      when others then
        null;
    end;
    Page Items to Submit: P4_EMPNO
    Page Items to Return: P4_ENAME,P4_JOB,P4_MGR,P4_HIREDATE,P4_SAL
    See this working example: http://apex.oracle.com/pls/apex/f?p=32940:4
    Login as test/test
    If you want to make it more dynamic you can query the APEX metadata to find the form items on your current page
    select * from apex_application_page_db_items
    where page_id =:APP_PAGE_ID
    and application_id = :APP_ID;

  • Multiple Automatic Row Fetches

    Hello All,
    Is is possible to have two "Automatic Row Fetches" on a single page. Each fetch pointing to a separate table.
    For example, one fetch gets employee data (name, address, etc.), the other getting time-off details.
    Thanks
    -redapple

    Ok, then why can't I make this work?
    Region 1 is a form and already exists on the page. Fully functional.
    I need to add a region to get supporting data from another table.
    Using the new region wizard, I create a new form region. A new "Automatic Row fetch" is created as sequence 10 as a "After Header" process. The "item containing "and "primary key" column are set accordingly.
    Whenever I run the page I get a "no data found" error.
    However if I delete the region, and recreate it as a report region, the report displays the data!
    What am I missing?
    Any ideas?
    thsanks
    -redapple

  • How to use Automatic Row Fetch programmatically ?

    Hi
    I like to use Automatic Row Fetch (AFR) of APEX to populate data into a DML form page by clicking a button with a defined where_clause, and like to update the record accordingly as we did in Oracle forms execute_query procedure. I prefer Oracle provided facilities, don't want to do it manually. Any help ?....
    Hasan Al Mamun

    You will probably get a better answer if you ask this in the Apex - Oracle Application Express- forum.
    Sorry, I don't have an immediate answer for your question ;(

  • Bug Report: Automatic Row Fetch/Automatic Row Processing and invalid column

    Hi,
    if an invalid column name is specified for a page item of type "Database Column", no error is reported by the Automatic Row Fetch/Automatic Row Processing process. It's just ignored and nothing is returned!!! That makes it kind of hard to identify such an error.
    The problem can happen for example when a column is renamed or if there is a typo in the column name during creation.
    The problem seems to be related to the following query which doesn't use an outer join.
    SELECT C.COLUMN_NAME, C.DATA_TYPE, I.NAME, I.FORMAT_MASK, I.DISPLAY_AS
    FROM
    SYS.ALL_TAB_COLUMNS C, WWV_FLOW_STEP_ITEMS I WHERE C.OWNER = :B4 AND
      C.TABLE_NAME = :B3 AND I.SOURCE = C.COLUMN_NAME AND I.SOURCE_TYPE =
      'DB_COLUMN' AND I.FLOW_ID = :B2 AND I.FLOW_STEP_ID = :B1 AND (C.DATA_TYPE
      IN ('DATE','NUMBER','CLOB','LONG','FLOAT') OR C.DATA_TYPE LIKE 'NUMBER%' OR
      C.DATA_TYPE = 'CHAR' OR C.DATA_TYPE LIKE '%VARCHAR%' OR C.DATA_TYPE LIKE
      'TIMESTAMP%') ORDER BY C.COLUMN_IDBTW, if an invalid table/view name is specified for a Automatic Row Fetch/Automatic Row Processing process, the error message during runtime isn't very speaking.
    ORA-06550: line 1, column 17: PL/SQL: ORA-00936: missing expression ORA-06550: line 1, column 9: PL/SQL: SQL Statement ignoredMaybe that could be changed too.
    Thanks
    Patrick
    My APEX Blog: http://www.inside-oracle-apex.com
    The APEX Builder Plugin: http://builderplugin.oracleapex.info/
    The ApexLib Framework: http://apexlib.sourceforge.net/

    It says filed (with an L) not fixed (with an X). That means they have noted down the bug, but it may or may not have been fixed yet.

  • 2 automatic row fetches based on the same variable

    I have a select list with a submit that contains all products that are currently stored in the database. The select list reloads the page and passes the value of the product id selected in the list to P3_PRODUCT_ID.
    I then use this value (P3_PRODUCT_ID) for two process under page rendering. One to fetch the associated fields in the Product table for the P3_Product_Id as this is the primary key and One to fetch the associated filed's in the Nutrion table for the P3_product_Id.
    This works fine if i only do one fetch process but if i try to both of the process i get
    ORA-01403: no data found
    Error ORA-01403: no data found
    OK
    which seems strange to me as the processes work fine individually.
    Anyone have any ideas or point me in the way of some reading? Is this even possible to use two automatic row fetches or do i need to write my own PL\SQL block?
    Many Thanks
    Daniel Stead
    Message was edited by:
    Dan Stead

    Only one ARF per page is supported.
    Scott

  • No automatic row fetching (DML)

    All,
    I want to generate a process which fetches my rows automatically.
    I've done this before several times.
    But now my new process is not fetching rows.
    I don’t get an error message, the text fields are just empty.
    During creating the new process I see an empty LOV
    for field ‘Item Containing Primary Key Column Value’
    in section ‘Source: Automatic Row Processing (DML)’
    although there are about 7 items (text fields) at this page.
    Any help appreciated,
    lucio

    Lucio:
    I think you need to set the 'Source Type' attribute of the form fields to be 'Database Column' and in the 'Source value or Expression' field provide the database column to which the page item corresponds to.
    varad

  • Can we use the built-in Row fetch for Multiple reports in a page?

    I need to create a page with multiple report regions. Each of it is based on a table. Those tables are different. I somewhat remembered that we can NOT use the built in automatic row fetch process if there are multiple report regions, neither the built in DML process. You have to make your own fetch and insert/update/delete process if you intend to.
    Also if I write my own row fetch and update processes, do I have to consider lock mechnism? or just simply write select and insert/update?
    Any input is appreciated.

    I think I found the answer. Would Scott or other gurus take a look at the thread and confirm it, in case the limitation is not in 2.0?
    Re: automatic row fetch
    What I am concered about is that the locking mechanism. If I have to write my own process to fetch and insert/update, other than the regular select and insert/update statements, do I have to put commit by myself, or htmldb can handle it automatically? Is there an example for this?
    Thanks in advance.

  • Processing Static (via automatic row processing) & Dynmaic fields

    Hi,
    I have a page that has 2 sections. Section S is statically driven which I'd like to process via a Automatic Row Process DML. Section D is for dynamic fields which I process via a PL/SQL script.
    I need to process Section D (dynamic) first.
    Now they're 2 things that I'm noticing when I try this. Can someone please confirm.
    - After my process of Section D it seems to make a commit. I know this since I have a error in Section S, and the values from Section D are committed to the DB. I need to make sure a commit only occurs after all page processes have completed error free.
    - My Automatic Row Process DML for Section S doesn't seem to work at all. It can't seem to read the values at all. I know this since I have several columns which are "NOT NULL" and the appropriate error messages are being raised. The Automatic Row Fetch for Section S does work properly.
    For the time being the work around is writing a process for the entire page which includes both Section S and Section D. The thing is I thought that HTMLDB would be able to help me out a lot with Section S since it had static fields etc.

    Martin - I would try to debug these two processes separately. If the Auto DML process isn't firing, perhaps the button used to submit the page isn't setting the request to one of the standard values recognized by the Auto DML package ('INSERT','CREATE','CREATE_AGAIN','CREATEAGAIN' for inserts and 'SAVE','APPLY CHANGES','UPDATE','UPDATE ROW','CHANGE','APPLY' or like 'APPLY%CHANGES%' for update).
    A commit happens whenever session state is changed, so if your process saves an item value, that would do it. If you think that is not the cause of the commit, let me know the details of the process and I'll take a closer look. There is no way to prevent the commit when session state is updated.
    Scott

  • Problem with type conversion and primary key during row fetch

    [Note, this error occurs in Oracle XE, APEX 2.1.0.00.39]
    I have been having a problem with Automatic Row Fetch:
    ORA-01460: unimplemented or unreasonable conversion requested
    So in an effort to resolve this, I created a PL/SQL process with the query below and was able to isolate the same error. The problem seems to come from one of the primary keys being a "number" type (APP_ID). The error occurs on the line:
    where u.app_id=:P5_APP_ID
    I have tried the following variations on this line in an effort to resolve this, but all generate the same error:
    1) where to_char(u.app_id) = :P5_APP_ID
    2) where u.app_id = to_number(:P5_APP_ID)
    3) where to_char(u.app_id) = to_char(:P5_APP_ID)
    I've also tried the laternate syntax "&__." and "#__#", but these don't function in the Source field and show up as syntax errors.
    Any suggestions are welcome.
    begin
    for r in (
    select app_name, apptype, appcreator, appurl
    from application_users u, application_info i
    where u.app_id=:P5_APP_ID
    and i.app_id=u.app_id
    and u.username=:P5_USERNAME)
    loop
    begin
    :P5_APP_NAME := r.app_name;
    :P5_APPURL := r.appurl;
    exception
    when others then
    raise_application_error(-20000,'In Loop Failure',true);
    end;
    end loop;
    exception
    when others then
    raise_application_error(-20000,'Out of Loop Failure',true);
    end;
    Thanks in advance,
    Barney

    I found a prior post referencing a similar issue and it was solved by using the "v(__)" syntax. This did resolve my issue, however, I have a quick follow-on which I'm hoping someone can answer quickly...
    Since the "v(__)" syntax won't work for the Automatic Row Fetch (at least to the best of my knowledge), I have to do a manual process. However, the manual query as shown above doesn't actually populate any of the form values through the bind variables. They all remain at their cached values from prior data entry on the form.
    Is using the bind variables for assignment incorrect, or is there something that must be done to get the updates to show up in the form (ordering of processes, etc.).
    My manual process is running in the Load: Before Header state so I would have expected it to update all of the fields.
    Thanks in advance,
    Barney

  • Row Fetch on View doesn't work / Custom procedure needed???

    Hello guys!
    Again I have a problem. It seems like once I finish one problem I stumble into another one. :-(
    Would is breaking my neck is the following problem.
    I have a view based on a query that joins 3 tables including one via a database-link. I would like and need to use that view as the source for the automatic row fetch! However, when creating the automatic-fetch-row process, the items on my page do not get populated. However, If I change the cource for the fetch-row-process to a view made of only a single table it works like a charm. Could it be that the automatic fetch-row procedure doesn't work with joined views and db-links at all??? If so, could you please give me an example of a PL/SQL procedure that will populate items on page reload and load!
    It's extremely urgent and I appreciate every input!
    Thanks guys! I hope you some ideas and hints!
    Regards,
    Sebastian

    Ah, ok - I probably read too much into your update (still thinking that it was related to the "view" issue in your first post :) ) - so an INSTEAD OF trigger won't be needed if this is just a single table!
    There are a few ways that adding an extra column into a tabular form would stop it being updated. Typically, this could be if the new column forms part of the "Primary key" for the data. If this is the case, you need to ensure that the processes recognise this. It can also be that you have set the item to DISABLED or READONLY - these items are not submitted with the page, so even if you set the item's value somehow, that will never get back into the record (there are ways to take off the DISABLED or READONLY attributes immediately prior to the submit, if need be). That could also happen if you have set the item to be a Standard Report Column - this is just displayed text, so doesn't form part of the submitted data. You can get around that by having a hidden column with the actual data in there as well - if you have ever created a tabular form using the simple EMP table example, you'll see EMPNO and EMPNO_DISPLAY - both contain EMPNO but only the basic EMPNO hidden item is submitted. Another, perhaps rare, possibility is if you have used the APEX_ITEM package to create any of the output and have used an index number that has been automatically assigned to another column - for example, if you have APEX_ITEM.TEXT(1, ....), which gives each item a name value of "f01", then this is most likely going to double up with the index for the hidden primary key item (which is usually first in the list). If this is the case, just change the index of your APEX_ITEM item to some high number (anything up to 50).
    Finally, you say "INV_PT_ID_SUB is also bound to an item PTIDS" - what is PTIDS? The MRU processes need to understand what column to update and relies on the settings for primary keys and the column names in the SQL query.
    The MRU's only know about their own settings - the workspace, tablename and primary keys etc. They contain no details of individual columns as such, so adding in extra columns shouldn't be a problem. In fact, I've added/deleted so many columns from tabular forms, that I'd be really annoyed if I had to start from scratch every time!!
    Andy

  • Db link tables in processes and row fetch

    I have an application I developed in schema A that is referencing tables in schema B. I have been told that these tables need to be moved to another database for which I have created a database link. I know this database link is working because it tests ok and I can pull user names from a user table in an item.
    Also, on the first page I have a report that sources from the dblink:
    SELECT TRK_CALLS.ID, TRK_CALLS.USER_, TRK_CALLS.ASSIGNED_TO, TRK_CALLS.PROBLEM, TRK_CALLS.SOLUTION, TRK_CALLS.STATUS
    FROM TRK_CALLS@DBLINK_IM3
    WHERE
    ( STATUS = 'Open' and :P2_REPORT_SEARCH is null )
    or
    ( regexp_like( USER_ || '#' || ASSIGNED_TO || '#' || PROBLEM || '#' ||
    SOLUTION || '#' || STATUS, :P2_REPORT_SEARCH, 'i' ) )
    This is working correctly.
    I have edit buttons for the rows in the report that redirect to page 6. I get any error unable to fetch row.
    In the row source I placed
    trk_calls@DBLINK_IM3
    I only have one selection as table owner WEBB so this may be part of the problem but I am not sure how to fix this. I tried to create a new row fetch under the the owner GIS which is the right owner but it still diplays WEBB once created. Is this even part of the Solution?
    Is there a better way to do this? PL/SQL expression?
    I have many other processes that will have insert, apply changes, etc to the tables so if I can get this to work I may be on my way to making the db link work.
    Please help me in any way possible.
    Thanks,
    Kirk

    Kirk,
    you get this error because it is impossible to use the returning clause, probably because you are using a DB link.
    You can cicrumvent this by determing the primary key value in the PL/SQL before doing the insert and then including its value in the insert:
    Thanks alot for the info on creating the view. It is working to a certain point.
    I am getting a 'ORA-22816: unsupported feature with RETURNING clause' error now. I created the view and referenced the view in all of my pages. Simply put, wherever I had TRK_CALLS in a source or SQL expression I replaced it with TRK_CALLS_VIEW.
    The application didn't have the error before and the only thing I changed was this. What could be the problem?
    This is the expression that the error is referring to:
    declare
    l_CALL_ID number;
    begin
    /* determine CALL ID */
    i_call_id := get_call_id; /* some function returning new call id */
    insert into webb.TRK_CALLS_VIEW
    (+id+, USER_, ASSIGNED_TO, PROBLEM, SOLUTION, STATUS)
    values
    (+i_call_id+,:P3_USER_, :P3_ASSIGNED_TO, :P3_PROBLEM, :P3_SOLUTION, :P3_STATUS)
    good luck, DickDral

Maybe you are looking for

  • Value of planned delivery time in days not updating

    Hello Experts, i have created a material using BAPI_MATERIAL_SAVEDATA. IN Mrp2 VIEW PLANNED DELIVERY TIME IN DAys is not updating i have passed la_plantdata-plnd_delry =  P_PLND_DELRY. la_plantdatax-plnd_delry =  'x'. i have commited the work too but

  • Getting error in Migo_gr

    Hi EveryOne , I m getting error in Migo_gr that : "  Field Bus. Area is a required field for G/L account DMRC 141004 " . The bus arear is not visible in Migo_gr . thanks

  • Toplink Exception in BPEL process

    Hi All, We get the attached error while running a BPEL process which uses a DBAdapter (which uses Toplink under the covers). Can you provide any pointers on why this exception might be happening. Exception Description: java.sql.SQLException: invalid

  • IMac 24-inch 2.4 GHz (circa 2007) freezes, reboots after several hours

    Looked through all the other discussion topics and saw somewhat related issues, but my older system is acting very strange. Starting back in October 2010, the system starting slowing down (heard the HD writing (clicking away)). Seemed to happen when

  • Print subforms in different Order

    Hi, I have a template with several subforms lets say A,B,C and D and sometimes the field definition file will have the info for A and B subforms, or could have the info will have info for B,C and A subforms (in that order), when the info comes in the