PLSQL function body returning an sql report returns ORA-01403 No Data Found

I am on APEX 3.1.2.00.02 and Oracle 10g.
I am developing a report with SQL Query (PL/SQL function body returning SQL query) type. But on running the report I am getting
report error:
ORA-01403: no data found
Region Source
declare
  qry varchar2(32767);
begin
  --Procedure call
  my_pkg.get_query(qry);
  htp.p(qry);
  return /*select 1 from dual */ qry;
end;
Procedure
PROCEDURE get_query (V_QRY OUT VARCHAR2)
IS
  qry varchar2(32767);
begin
  qry := ' select name
     , max(decode(to_char(service_date,''Mon-YY''), ''Jan-09'', value, null)) as "Jan-09"
     , max(decode(to_char(service_date,''Mon-YY''), ''Jan-09'', value, null)) as "Feb-09"
     from MY_TABLE
     group by name ';
  V_QRY := qry;
end;
The query will be enhanced later to add more months and year based on user parameters once I am successfull in running report on this.
I wish to use Query Specific Column names. I have seen this suggestion from Scott in a number of threads to use /*select 1 from dual */ with query but not working in my case.
Can someone please suggest what can I do to make it working?
Regards,
Amir

Firstly, have you unit tested the procedure (namely, within the SQL Workshop, SQL*Plus, SQL Developer,etc, etc.) to see if it produces the right output in the first place?
If you have, and the query string generated is valid, try assigning the output to a page item (thus allowing you to view it in the session browser) or even pass the procedure output into the debug window (with the use of the wwv_flow.debug function). This might reveal some state or session change which is causing it not to return.You might find this easier to achieve if you change from a 'procedure and out parameter' combination to a 'function returning string' approach.
Alternatively, try re-creating the report in a new region - occasionally I've come across weird bugs with report regions which resolved themselves in this manner.

Similar Messages

  • PL/SQL function body returning SQL - report error:ORA-01403: no data found

    Hi,
    I am working on Application Express 4.0.2.00.06, and 11G database.
    I have a problem with classic report area of type - PL/SQL function body returning SQL query. Query works if I define region area as - Use Generic Column Names (parse query at runtime only), and does not when I define it - Use Query-Specific Column Names and Validate Query.
    I am getting error:
    report error:ORA-01403: no data found
    This is my query that is returned from function, and displayed with htp.p, and it works ok and returns data in SQL Developer and SQL Workshop (in Apex).
    <code>
    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA
    </code>
    As you can see, I even tried with workaround that I found on the previous post on the forum, and that is to put /* select 1 from dual */ to start query.
    Any help would be appriciated.

    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA

  • Report error: ORA-01403: no data found.

    Hi,
    I was getting a following error and not able to figure it out.
    Here what I have:
    I have a page where I have 3 regions and out of them, there are 2 Html conditional regions
    and one SQL updatable report. Also, I have a validation to validate a field on the tabular form
    based on one field on the HTML region. The validation works fine but it also throws following error :
    report error: ORA-01403: no data found.
    Code:
    Declare
    v_office_id number;
    Begin
    SELECT count(id) into v_office_id from dar_asd.asd_office;
    if (:P299_ROLE_TYPE_ID = 1 and apex_application.g_f30.COUNT = v_office_id ) or
    (:P299_ROLE_TYPE_ID = 2 and (apex_application.g_f30.COUNT < v_office_id
    and apex_application.g_f30.COUNT >= 1) ) then
    return null;
    else
    RETURN 'Error: '||'Not a valid office selection.';
    end if;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN 'Error: '||SQLERRM;
    end;
    Thanks.

    Marc,
    Thanks for the reply.
    It is derived columns i.e. Use Query-Specific Column Names and Validate Query. The select statement returned by the stored procedure function will allways have all list of columns in select list. But the report displays allways some fixed number of columns in the secod region and remaining will be dependent on the check boxes and lov items selected in the first region. For e.g. if the select has 20 columns. Out of this, let's say 8 will allways displayed and remaining 12 will be displayed depending on the check box and lov items defined for them in the first region. I mean if 3 check boxes are checked and if the user selected some value from lov for the corresponding check box items, then the report will display 8+3 = total 11 colums. And the lov values selected will be used in the where condition of the SQL.
    How can I go to the report attributes? I can go to page definition, but I am not finding report attributes here. Please let me know...
    Thanks,
    Srini

  • REP-1401:'cf_1formula': Fatal PL/SQL error occured, ORA-01403: no data fou

    hi,
    my report is giving error REP-1401:'cf_1formula': Fatal PL/SQL error occured,
    ORA-01403: no data found
    There are two table emp1 and emp2 created from employees table from HR schema
    I have deleted some records from table emp2 where department id is 110
    main query is
    select employee_id, first_name, department_id from emp1
    now i created a foumula column
    function CF_1Formula return Number is
    dept number;
    begin
    select department_id into dept from emp2 where employee_id = :employee_id;
    return(dept);
    end;
    the above error is given when report is run. i tried
    exception
    when_no_data_found then
    dept:=000
    but problem is not solved
    i want to disply any number in this foumula column if the record is not found

    M. Khurram Khurshid wrote:
    exception
    when_no_data_found then
    dept:=000try this code in formula
    function CF_1Formula return Number is
    dept number;
    begin
    select department_id into dept from emp2 where employee_id = :employee_id;
    if dept is not null then
    return(dept);
    else
    return 0;
    end if;
    end; Hope this will help you...
    If someone response is helpful or correct please, mark is accordingly.

  • Forms application returns "ORA-01403 no data found" exception on Windows 7

    Hi everyone,
    I am currently involved in an application compatibility project for an O/S migration from Windows XP to Windows 7.
    We have a legacy Oracle Dev6i P18 Forms application that has been working perfectly on Windows XP for the last decade or so. When we installed the same application on Windows 7, it returned a pop-up error message with the text: "ORA-01403 no data found" when performing a certain operation (clicking on a Submit button in a specific form). The same operation works successfully on Windows XP displaying the message "Submit has been successful".
    This error is well documented and the solution involves adding an exception handler to the faulting SQL statement(s) in order to handle the ORA-01403 exception. Unfortunately, the application is composed of compiled forms (.FMX) and we no longer have the source code so I can't implement this solution.
    I ran a file comparison utility (WinDiff from the Windows SDK) and confirmed that all the files in the application folder and the Oracle Dev6i P18 folder are identical on both the Windows XP and Windows 7 systems.
    I enabled tracing in SQLNet.ORA by configuring TRACE_LEVEL_CLIENT=SUPPORT (I know, too verbose) and other related settings on both systems and have uploaded the traces to my SkyDrive for public viewing:
    http://sdrv.ms/10BNYtI
    The traces show that the "ORA-01403" exception occurs many times on both Windows XP and Windows 7 systems as a result of various SQL statements being executed, for instance:
    SELECT TASK_ID,TASK_DETAIL_STATUS,ASSIGNED_DATE FROM TASK_DETAILS WHERE TASK_ID = :b1 AND TASK_DETAIL_STATUS = (SELECT ID FROM V_TASK_STATUS WHERE ABBREVIATION = 'PLANNED' ) FOR UPDATE OF TASK_DETAIL_STATUS,ASSIGNED_DATE
    UPDATE TASK_DETAILS SET ASSIGNED_DATE=NTMS_UTIL.GET_SERVER_DATE,TASK_DETAIL_STATUS=(SELECT ID FROM V_TASK_STATUS WHERE ABBREVIATION = 'ASSIGNED' ) WHERE ROWID = :b1
    ORA-01403: no data found.
    So the same error happens on both Windows XP and Windows 7.
    On Windows XP, the error is somehow handled, and does not cause the "Submit" operation to fail.
    On Windows 7, however, the error bubbles to the surface and is displayed to the user, thus halting the "Submit" operation.

    Thank you. I'm well aware that adding an exception handler is the classic solution to the ORA-01403 error. However, like I mentioned in my original post, I don't have the source code. All I have are the compiled .FMX forms so I can't implement such a solution:
    From my original post:
    This error is well documented and the solution involves adding an exception handler to the faulting SQL statement(s) in order to handle the ORA-01403 exception. Unfortunately, the application is composed of compiled forms (.FMX) and we no longer have the source code so I can't implement this solution.

  • REP-1401: Fatal PL/SQL error occurred. ORA-01403: no data found

    Hi guys,
    I am getting error 'REP-1401: Fatal PL/SQL error occurred. ORA-01403: no data found ' when run the report
    and i m also use formula column in my report.
    can any body help me why it's coming.
    following code is used in formula column plz check and verify:
    function CF_3Formula return Char is
    T1 VARCHAR2(100);
    begin
    SELECT
         VAT_REG_NO INTO T1
    FROM
         JA_IN_HR_ORGANIZATION_UNITS JIHOU,
         HR_LOCATIONS HL--,
         --MTL_TXN_REQUEST_HEADERS MTLH
    WHERE
    JIHOU.ORGANIZATION_ID=HL.INVENTORY_ORGANIZATION_ID AND
    JIHOU.LOCATION_ID=HL.LOCATION_ID AND
    --Jihou.ORGANIZATION_ID = Mtlh.Organization_Id AND
    -- Hl.INVENTORY_ORGANIZATION_ID =Mtlh.Organization_Id AND
    -- MTLH.ATTRIBUTE10=SUBSTR(HL.LOCATION_CODE,1,3) AND
    SUBSTR(HL.LOCATION_CODE,1,3)= :TO_ORG1 ;
    RETURN (T1);
    end;
    plz help me out.

    Hi;
    What is EBS version? Is it custom report or not?
    See below which is mention similar errors
    Autoinvoice Error: ORA-1403: no data found [ID 1209403.1]
    APXIIMPT - Payable Open Interface Import Fails on "REP-1401: 'cf_source_nameformula': Fatal PL/SQL error occurred. ORA-01403: no data found" [ID 222058.1]
    Regard
    Helios

  • Failed to parse SQL query: ORA-01403: no data found

    I'm going to post and answer my own question in the hope that others will not have to struggle with this error.
    Using a report of the type PL/SQL Function Body Returning SQL and using generic columns you may run into this error
    failed to parse SQL query:
    ORA-01403: no data found
    The SQL will run stand alone but the report fails.
    There is a setting just below the source you should check:
    "Maximum number of generic report columns"
    In my case the number of columns was dynamic and when it exceeded the number set as the maximium number of generic columns I received the 1403 error.
    Hope this helps someone.
    Greg

    Thanks for much for the pointer. For anyone else struggling with this too, I found that my generic columns had unordered themselves. Reordering them solved the problem for me.
    Edited by: user11096971 on Jul 22, 2010 3:19 AM

  • Strange problem: ORA-01403: no data found when report has a sort

    Hi,
    I have a report which behaves very strangely but only for one particular user. The report runs fine when no columns are set as sort-by in the report attributes. As soon as I try and set a column to sort (any column, it doesn't matter) this user gets the error message:
    failed to parse SQL query:
    ORA-01403: no data found
    appear where the report should be on the page. The rest of the page displays OK. No other users are affected. If I remove the sort then the report is OK for this user (unsorted though!)
    The report is a structured query with custom column headings, nothing unusual, quite basic. I have tried exporting and reimporting the page but it doesn't fix it. Same behaviour for this particular page in our test system as well.
    I could rebuild the page but I'd rather know what is wrong in case it happens to some other region.
    Thanks,
    Steve

    Steve,
    The reports engine stores the sort settings in the user preferences. This is done so that when you return to a report, it maintains the earlier sort settings. Like in your response to the HTML DB studio posting, you would keep your report sorted by "Created On" descending or ascending even when you come back another time. It's save to remove those preferences; all that's going to happen is that your users will see the report using the report's default settings the next time they go to that page. I will try to investigate this problem further, whatever additional information you can provide, will be helpful,
    Marc

  • Oracle error 1403:java.sql.SQLException: ORA-01403: no data found ORA-06512

    My customer has an issue, and error message as below:
    <PRE>Oracle error 1403: java.sql.SQLException: ORA-01403: no data found ORA-06512:
    at line 1 has been detected in FND_SESSION_MANAGEMENT.CHECK_SESSION. Your
    session is no longer valid.</PRE>
    Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
    And customer’s statement is: Upgrade from EBS 11.5.10 to 12.1.3. Login the EBS, open any forms and put it in idle. Then refresh the form, error happens
    Then, I checked ISP, and found two notes:
    Note 1284094.1: Web ADI Journal Upload Errors With ORA-01403 No Data Found ORA-06512 At Line Has Been Detected In FND_SESSION_MANAGEMENT.CHECK_SESSION.Your Session Is No Longer Valid (Doc ID 1284094.1)
    Note 1319380.1: Webadi Gl Journal Posting Errors After Atg R12.1.3 (Doc ID 1319380.1)
    But these two notes are both WebADI.
    Following is the data collection from customer:
    1. Run UNIX command to check .class file version:
    strings $JAVA_TOP/oracle/apps/bne/utilities/BneViewerUtils.class | grep Header--> S$Header: BneViewerUtils.java 120.33.12010000.17 2010/11/21 22:19:58 amgonzal s$
    2. Run SQL to check you patch level:
    SELECT * FROM fnd_product_installations WHERE patch_level LIKE '%BNE%';--> R12.BNE.B.3
    3. Run SQL to check patch '9940148' applied or not:
    SELECT * FROM ad_bugs ad WHERE ad.bug_number = '9940148';--> No Rows returned
    4. Run SQL to check patch '9785477' applied or not:
    SELECT * FROM ad_bugs WHERE bug_number in ('9785477');-->
    BUG_ID APPLICATION_SHORT_NAME BUG_NUMBER CREATION_DATE ARU_RELEASE_NAME CREATED_BY LAST_UPDATE_DATE LAST_UPDATED_BY TRACKABLE_ENTITY_ABBR BASELINE_NAME GENERIC_PATCH LANGUAGE
    576982 11839583 2011/8/7 上午 08:20:36 R12 5 2011/8/7 上午 08:20:36 5 pjt B n US
    516492 9785477 2011/6/12 上午 11:42:45 R12 5 2011/6/12 上午 11:42:45 5 bne B n US
    546109 9785477 2011/6/12 下午 01:17:41 R12 5 2011/6/12 下午 01:17:41 5 bne B n ZHT
    5. Run SQL to check the status of object ‘FND_SESSION_MANAGEMENT’
    SELECT * FROM dba_objects do WHERE do.object_name = 'FND_SESSION_MANAGEMENT';-->
    OWNER OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS TEMPORARY GENERATED SECONDARY NAMESPACE EDITION_NAME
    APPS FND_SESSION_MANAGEMENT 219425 PACKAGE 2004/10/30 下午 01:52:35 2011/8/7 上午 08:18:39 2011-08-07:08:18:26 VALID N N N 1
    APPS FND_SESSION_MANAGEMENT 226815 PACKAGE BODY 2004/10/31 上午 01:05:40 2011/8/7 上午 08:18:54 2011-08-07:08:18:27 VALID N N N 2
    So, my question is: Customer’s BneViewerUtils.java version is already 120.33.12010000.17, which greater than 120.33.12010000.14. Is there any others solutions for this issue? Does customer still need to apply patch '9940148' based on action plan of
    Note 1284094.1: Web ADI Journal Upload Errors With ORA-01403 No Data Found ORA-06512 At Line Has Been Detected In FND_SESSION_MANAGEMENT.CHECK_SESSION.Your Session Is No Longer Valid?
    Customer's EBS version is 12.1.3; OS is HP-UX PA-RISC (64-bit); DB is 11.2.0.2.
    Thanks,
    Jackie

    And customer’s statement is: Upgrade from EBS 11.5.10 to 12.1.3. Login the EBS, open any forms and put it in idle. Then refresh the form, error happens
    Idle for how long? Is the issue with all sessions?
    Please see these docs/links
    User Sessions Get Timed Out Before Idle Time Parameter Values Are Reached [ID 1306678.1]
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Timeout+AND+R12&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Then, I checked ISP, and found two notes:
    Note 1284094.1: Web ADI Journal Upload Errors With ORA-01403 No Data Found ORA-06512 At Line Has Been Detected In FND_SESSION_MANAGEMENT.CHECK_SESSION.Your Session Is No Longer Valid (Doc ID 1284094.1)
    Note 1319380.1: Webadi Gl Journal Posting Errors After Atg R12.1.3 (Doc ID 1319380.1)
    But these two notes are both WebADI.Can you find any details about the error in Apache log files and in the application.log file?
    Any errors in the database log file?
    So, my question is: Customer’s BneViewerUtils.java version is already 120.33.12010000.17, which greater than 120.33.12010000.14. Is there any others solutions for this issue? No.
    Does customer still need to apply patch '9940148' based on action plan ofIf the issue not with Web ADI, then ignore this patch. However, if you use Web ADI you could query AD_BUGS table and verify if you have the patch applied.
    Note 1284094.1: Web ADI Journal Upload Errors With ORA-01403 No Data Found ORA-06512 At Line Has Been Detected In FND_SESSION_MANAGEMENT.CHECK_SESSION.Your Session Is No Longer Valid?
    Customer's EBS version is 12.1.3; OS is HP-UX PA-RISC (64-bit); DB is 11.2.0.2.If you could not find any details in the logs, please enable debug as per (R12, 12.1 - How To Enable and Collect Debug for HTTP, OC4J and OPMN [ID 422419.1]).
    Thanks,
    Hussein

  • Problem with new DB app, report+form, report works great, form says ORA-01403: no data found

    I have a new table, the PK is a varchar2(5) column, when I allow the default query in the report to do its work, I get all the expected data.  when I click on the edit icon (pencil), I get an error screen indicating ORA-01403: no data found.  I'm hosed!  This was generated by the app!  no changes were made to anything in the app, except to turn off tabs at create time.  I even left the default name.
    My ARF is hitting the right table with the PK column, but finds nothing.  I have the "success" message showing me the PK value.  What could be going on here, and how can it be addressed?  Today is the 1st time I have seen this matter.
    I'm running 4.22 as the workspace admin, I have other apps that work fine (to expectation), my browser is FF22, though I plan a downgrade to 18.  Our DB is 11.1.0.7.

    Jorge, thanks for your attention to my problem, I appreciate any insights, although there is a little clarification I can offer.  Also, if you can, please remind me the tags to use in my text that would properly set off the code snippets or prior message content?
    [you wrote]
    You said you have a "success" message showing you the PK value. Can you elaborate on this?
    The form page, under the ARF, allows for the display of a "success" message and a "failure" message.  I have seen my "success" message appear, but it didn't show my key field as a brought-back value (which I told it to include), and I think now this is not relevant any longer.  I found that there was a link on the report attributes page between #ROWID# and a P2_ROWID that was incorrect (probably from an earlier stage of dev in the app), and I changed this to my key field, and this altered the outcome of the ARF action.  This leads to ....
    [you wrote]
    Can you see the correct PK value in the URL? Does the item parameter match what you expect (correct page item and value)? Perhaps share that full URL here?
    I have expected values in my URL.  The URL does show my key value (tail end of URL underlined here):
    ../apex/f?p=120:2:7519563874482::NO::P2_VCODE:RB15
    [you wrote]
    Debug the page and see which process, item or step is actually failing. You could be running some other process on the form page and that could be what actually fails.  Treat it as if the ARF works correctly and see what else could be happening.
    I can add the detail that my 1st message was based on testing with a table where I set the PK as data type VARCHAR2, but in more testing on the actual app (whose URL piece is above) I am using a PK which is CHAR.
    The result of the debug effort is that APEX has built its own query for pulling back the row in the ARF, and it is joining on my PK field to an APEX item P_ROWID which I don't think I created.  Nor does it appear to offer me any avenue for correcting it.    debug snippet:    where "VCODE" = :p_rowid; end;

  • ORA-01403: no data found Error in PLSQL code raised during plug-in processing.

    Hello OTN community,
    We are having the access to APEX problem. a New user was setup to access the APEX application. When I test to login as a new user, I get the message "ORA-01403: no data found Error in PLSQL code raised during plug-in processing.". When click OK to the disply message, the application will take me out of the sstem. I need help to even understand what is happening. I didn't develop the application, there is no documentation for this application, I am just supporting the application whenever there is a problem and I am new to APEX. As you can see I need help to figure this thing out. Your help is dearly appreciated.
    Thank you OTN

    Try to check the query that is executed and check if there is data or not

  • From pl/sql table getting error - "ORA-01403: no data found"

    Hi All,
    i habe written package, and the spce define as -
    type F761RecType is RECORD (
    type F761TabType is TABLE of F761RecType INDEX BY BINARY_INTEGER;
    l_F761_table F761TabType;
    PROCEDURE modification1
    p_F761_table IN F761TabType,
    From button click of form i passed -
    DECLARE
    l_f761_table I743_PUC_MAPS_TREE_PKG.F761TabType;
    l_counter number;
    BEGIN
              LOOP
         l_counter :=l_counter+1;
              l_f761_table(l_counter).P_TABLE := :MAPS.P_table;
         EXIT WHEN      :SYSTEM.LAST_RECORD = 'TRUE' ;
    next_record;
    end loop;
    i743_puc_maps_tree_pkg.modification1(
                                            p_F761_table => l_f761_table,
    END;
    Now when I take table count (l_f761_table.count) in button click in form level I am getting value; but when I try to get the count in sid the package, it giving error "ORA-01403: no data found".
    Pls tell me where I am wrong ..!!
    BR,
    Subir

    Thaks all, probls has been solved..

  • Nested exception is java.sql.SQLException: ORA-01403: no data found

    i am using oracle9.1 and use odbc.
    any help is appreciated.
    Thanks,
    kk

    It will be great if you provide some more basic details like:
    What activity you was doing??
    How you are doing?
    Did you get this error earlier also??
    Where did you get this error?
    It looks like you are using some sort of cursor and not handling the exception properly.
    Daljit Singh
    Message was edited by:
    Daljit

  • Error ERR-9131 Error in PLSQL function body for item default code, item=P24

    Hi All,
    Am getting the below error in my page 24
    ORA-01403: no data found
    Error ERR-9131 Error in PLSQL function body for item default code, item=P24_REQ_BY_ID
    OK
    I dont know what to do?:(
    Suddenly am getting this error in the page.
    Can anyone help me to understand why this error is coming?
    Thanks & Regards,
    Ramya
    Edited by: 901942 on Jan 29, 2012 10:16 PM

    Data stored in these tables is different. If Oracle says that there's no record that satisfies the WHERE condition, why do you think that it lies? It is too stupid to do that.
    Therefore, you need to handle the exception. There are several ways to do it. Here are some of them.
    The first one is the most obvious - EXCEPTION handling section.
    DECLARE
      default_value VARCHAR2(100);
    BEGIN
      SELECT ISID INTO default_value
        FROM USER_TBL
        WHERE UPPER(ISID) = UPPER(:APP_USER);
      RETURN default_value;
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        RETURN (null);  -- or whatever you find appropriate
    END;Another one is to use aggregate function (MAX is a good choice) as it won't return NO-DATA-FOUND, but NULL:
    DECLARE
      default_value VARCHAR2(100);
    BEGIN
      SELECT MAX(ISID) INTO default_value
        FROM USER_TBL
        WHERE UPPER(ISID) = UPPER(:APP_USER);
      RETURN default_value;
    END;

  • Error (ORA-01403) saveing data form a report with apex_item items

    Hi all,
    I've a problem saveing data that's inserted into a report which I created using apex_item items. Reproducing the exact issue on apex.oracle.com will take me a lot of time, and I don't know if I really can reproduce this matter... So I hope I can explain my problem clearly enough, here...
    The global story of the application is that its an application used for measureing objects. For these objects there are templates, with default properties. When measureing an object, the user must fill in those properties for the object. The report is build dynamicly, becouse each object has different properties and each property could be of an other kind (number, text, list, counter [=number field with add and substract buttons], and date). Depending on the type of the property, the report has to show an other item to fill.
    The query for constructing this report is like this:
    select defprop.proptyp_id,
    apex_item.hidden(41,defprop.id) defprop_id,
    defprop.nam,
    decode(proptyp.id,
                    1, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'' ,p_attributes=>'class=case5_num'),
                    2, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||''),
                    3, apex_item.select_list_from_query(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'', p_query=> 'select wrd, id from property_typewrd where proptyp_id = ' || proptyp.id ||' order by vlgnum', p_show_null=> 'NO'),
                    4, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'',p_attributes=>'class=case5_num')
                    || '<a name="add_f02" href="#"><img alt="add" src="#WORKSPACE_IMAGES#plusBig.gif"/></a>    '
                    || '<a name="sub_f02" href="#"><img alt="sub" src="#WORKSPACE_IMAGES#minusBig.gif"/></a>',
                    5, apex_item.date_popup(p_idx=>42, p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||''),
                    oms
                ) waarde
    from default_property defprop,
    object_instance obj,
    property_type proptyp
    where defprop.stdobjver_id = obj.stdobjver_id
    and defprop.proptyp_id = proptyp.id
    and obj.id = :P2200_ID_INVThis report works fine. Depending on the type of the property it shows a numberic field, text field, selectlist (with right values), counter field or date field.
    If the default property is set to a 'CONSTANT' value, the last known value is filled in.
    With a javascript I check the numberic field value and achieve the counterfield to add or substract values when 'plus' or 'minus' is clicked.
    This javascript is placed in the field 'Execute when Page Loads' in the page properties in APEX. Here is the code:
    /*Execute when page loads*/
    /*Allow only numbers */
    number_elem = $('input[name=f42].case5_num');
    number_elem.keypress(function(event) {
      if (event.which && (event.which < 46 || event.which > 57 || event.which == 47) && event.keyCode != 8) {
          event.preventDefault();
      if (event.which == 46 && $(this).val().indexOf('.') != -1) {
          event.preventDefault();
    //for mouse events, remove any non numeric characters
    number_elem.bind('mouseup mousedown mouseleave', function(event) {
       this.value = this.value.replace(/[^0-9]/g, '');
    /* Subtract Button */
    $('a[name="sub_f42"]').click( function() {
      number_elem = $(this).siblings('input[name=f42].case5_num');
      currVal = number_elem.val();
    if ( isNaN( currVal) ){
       elemVal = 0;
    else {
       elemVal = Number(currVal);
    if (elemVal > 0)
         number_elem.val(elemVal-1);
    else
    { elemVal = 0; }
    /* Add Button */
    $('a[name="add_f02"]').click( function() {
      number_elem = $(this).siblings('input[name=f42].case5_num');
      currVal = number_elem.val();
    if ( isNaN( currVal) ){
       elemVal = 0;
    else {
       elemVal = Number(currVal);
    number_elem.val(elemVal+1);
    });Those two codes makes my report works fine. So far I'm happy. But now I want the data, which the user fills in the items, to be saved.
    So I created a process that should do this for me (it wil run after the user hits a button), here is the code:
    declare
         v_objmet_id number := 0;     
    begin
         select measurment_seq.nextval
         into v_objmet_id
         from dual;
         insert into measurment
         ( id
         , obj_id
         , dat
         values
         ( v_objmet_id
         , :P2200_ID_INV
         , :P2200_METDAT_INV
         /*Loop trough the values (g_f42 holds the value of the property)*/     
         for i in 1 .. apex_application.g_f42.count loop
              /*g_f41 holds the key to the default property*/
              if apex_application.g_f41(i) is not null and
                   apex_application.g_f41(i) > 0 then
                   insert into measurment_prop
                   ( measrument_id
                   , defprop_id
                   , wrd)
                   values
                   ( v_objmet_id
                   , apex_application.g_f41(i)
                   , apex_application.g_f42(i)
              end if;
         end loop;
    end;After running this process, the application branches back to the page, clearing the cache and set some items I use for filtering an other report with their own values.
    Both the process and the branche have a 'when button pressed' condition, where the same button is filled in. The branche fires on submit: after processing.
    When I hit the button to save the data, I get an error: ORA-01403: no data found
    In the debug info I can find there is encountered an unhandeled exception in the process, but I don't know what's going wrong...
    I thought it could be something with the date field, I want to save, so I put it in a to_date() with the right format, but I still got the error...
    I've also checked if the query which fetches the nextval of the sequence is correct, and it is, no typeing error in the sequence name, or something.
    I'm using APEX 4.0.2
    Edited by: Mir on 28-jun-2011 10:25
    Changed some code of the javascript, it directed to the wrong item ID, now its correct

    My problem is solved. The error occured when application item g_f41 was accessed, so my application couldn't find the data, the user putted in there. I now pasted this part of the sql, to the other apex_item field, so it became one field and now it works correctly:
    select [...]
    apex_item.hidden(41,defprop.id) ||
    decode(proptyp.id,
                    1, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
    [... etc ...]

Maybe you are looking for