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 ;(

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

  • 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

  • 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.

  • 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

  • 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

  • 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;

  • Solved: Delete Using Automatic Row Processing

    See Scott's reply below for the answer.
    Hi there,
    I have an application built in APEX 3.0.1 that I would like to be able to use a button to delete a single row from an underlying database table (owned by the parsing schema).
    My APEX page has a 3 HTML regions on it:
    1. Only a Select List and Go button for User selection (of Debit Note)
    2. Ten display Items (Text Field, Disabled saves state) displaying further information about User selection
    3. Conditional Delete button (region with custom image) - only displays when P73_DEBITNOTEID is NOT NULL
    I'd like this button to be used to Delete the Selected Item and thought I'd be able to use a Data Manipulation Page Process - Automatic Row Processing (DML) page process to do this.
    However, when I go through the wizard the Select item containing primary key column value field has no values in the search list.
    My first question is why was there no values in the list?
    So I manually entered the Item I required (P73_DEBITNOTEID) but when I run the page and click the button I get a PL/SQL missing expression error.
    What is the best practice method to do DML actions on the underlying database tables. The tables are all owned by the parsing schema.
    Your help in resolving this matter would be greatly appreciated.
    Kind Regards,
    Gary.

    Gary,
    The DML processes (and the creation wizards for them) are for use with items having source type Database Column. If your page items don't use this source type, then neither the Automated Row Fetch nor the Automatic Row Processesing (DML) process types will work.
    Scott

  • Inserts using Automatic Row Processing (DML)  should not clear cache

    Hi,
    I am using APEX 4.0.1.00.03.
    I created a form on a table for inserts and updates.
    After I do an insert, the Automatic Row Processing (DML) clears cache for all items on the page.
    But the user wants to see the data he inserted without having to query. How can I achieve this?
    Thanks
    Chandra

    There isn't any "reset page" process on my page.
    --Chandra.                                                                                                                                                                                               

  • 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

  • How to use open Row set in sql server 2014

    Hello All,
    How to open the row set using sql server 2014 using link server connection.

    Hi  denyy,
    Are you referring to the OPENROWSET function in SQL Server 2014?
    The OPENROWSET method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. The examples below demonstrate how to use the OPENROWSET function:
    A. Using OPENROWSET with SELECT and the SQL Server Native Client OLE DB Provider
    SELECT a.*
    FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
    'SELECT GroupName, Name, DepartmentID
    FROM AdventureWorks2012.HumanResources.Department
    ORDER BY GroupName, Name') AS a;
    B. Using the Microsoft OLE DB Provider for Jet
    SELECT CustomerID, CompanyName
    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb';
    'admin';'',Customers);
    GO
    C. Using OPENROWSET to bulk insert file data into a varbinary(max) column
    USE AdventureWorks2012;
    GO
    CREATE TABLE myTable(FileName nvarchar(60),
    FileType nvarchar(60), Document varbinary(max));
    GO
    INSERT INTO myTable(FileName, FileType, Document)
    SELECT 'Text1.txt' AS FileName,
    '.txt' AS FileType,
    * FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document;
    GO
    D. Using the OPENROWSET BULK provider with a format file to retrieve rows from a text file
    SELECT a.* FROM OPENROWSET( BULK 'c:\test\values.txt',
    FORMATFILE = 'c:\test\values.fmt') AS a;
    Reference:
    OPENROWSET (Transact-SQL)
    Using the OPENROWSET function in SQL Server
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.

  • How to use CVS to fetch the repository

    hello.
    I want to use cvs to fetch some codes from j3d.org.
    When I do "cvs -d CVSROOT=:pserver:anonymous@cvs.
    j3d.org:/home/cvs/j3d/cvsroot checkout code " in
    cvs directory, I get error message "connection refused".
    what's wrong ? could some one help me?

    Thank you.
    however, i still can't connect with server by trying your
    kind suggests.
    i have too little knowledger of cvs.
    i attach a document from j3d.org about downloading the codes. You may get the right way after read it ,i suppose.
    please pardon my boring.
    From j3d.org
    J3D.org CVS Information
    This entire site is managed using CVS. It is possible to download everything to your machine to keep up to date. Warning - it's big! As we don't provide a convenient zipped form of the site, this is the only way to fetch it.
    Software
    If you do not know what CVS is, or you know but don't have any software, then you should pay a visit to the CVS Homepage. CVS allows you to do incrememental updates of files as they become available, as well as rollbacks to earlier versions. Thus, the files that you download from CVS may not always be in a compilable state, but they'll be the latest copy, pretty much whatever the developers are working on at the moment.
    Downloading
    Anonymous cvs read access can be had by using the following CVSROOT setting:
    CVSROOT=:pserver:[email protected]:/home/cvs/j3d/cvsroot
    There is no password required. (ie hit enter when asked).
    Of course, you need to know what to download once you have logged in. Here is a list of all modules in the system. A few of them are definitely work in progress and not pretty. Buyer beware!
    Module Description
    code The j3d.org code repository
    code_website The code.j3d.org repository website
    faq The raw contents of the FAQ. Text and XML files
    faq_code Java code used to generate the FAQ
    ftp The raw contents of the FTP site
    scripts Various scripts used to maintain cvs and the site
    setup Raw files, templates etc to get working
    website The core pages of the main website (www.j3d.org)
    jobs The nacent, yet uncomplete jobs area
    ps. my os is Win98.
    Your more hints are very valued.

  • Using Automatic Row Processing on an empty table

    I started with a blank form based on a table. I used the wizrd and now have a good looking form with all the fields. However, I get ORA-01403: no data found - Error Unable to fetch row. when the form runs against an empty table.
    How would I avoid that?
    Thx,
    Pete

    Pete - If you run the page by passing a PK value (into a form item) and that value does not locate a row, you'll get that error. Make sure the item's type is Database Column and that its Source Used attribute is "Always, ...".
    Scott

Maybe you are looking for

  • XSLT-problem with sequence attributes

    Hi, in my XSLT-program (i'm a real newbie!) i'm adding dynamically attributes and their values to a tag, by using the following code : <SUPPLIER>   <xsl:attribute name="FUNLOC">     <xsl:value-of select="SUPPLIER_FUNLOC" />   </xsl:attribute>   <xsl:

  • Installation errors for CS6

    Ipourchased and installed CS6 design and web premium after uninstalling the down loaded trial version. I am receiving the following errors: Display requirements not met Error 1310: error writing to file c:\config.msi DF012: File folder does not exist

  • Transient VO error when app module pooling shut off

    Hi, I am using JDev 10.1.3.3.0 to build an application with ADFBC and JSF. I am trying to test the application with the app module pooling turned off. There is one failure I am trying to focus on an solve. What I am trying to is to populate Transient

  • ALE Idoc s

    Hi sap experts I am working on ALE Idoc Interfaces.    -Client1 Sender    -Client2 Reciever I am able to send IDOCs MATMAS from Client1 to Client2. My requirement is to 1) Send an outbound IDOC data(MATMAS) to a flat file on client1(SENDER). 2) Uploa

  • Mail 4.6 unable to send outgoing mail (second gmail account and hotmail account)

    I am able to receive mails but I cannot send outgoing mails on my second gmail account and hotmail account.  Both smtp shows that it is "offline."