Function body PLSQL returning a sql report returns ORA-01403 no data found

I'm on APEX 3.1.2.00.02 and Oracle 10 g.

I develop a relationship with the type of SQL query (body of function from PL/SQL returning SQL query). But the performance of the report, I get

error report:
ORA-01403: no data found


Source of the region
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 improved later to add more month and year according to the user settings that I am running on this report.

I want to use specific query column names. I saw this suggestion from Scott in a number of threads to use / * select 1 double * / with the query, but does not not in my case.

Please can anyone suggest what I can do to make it work?

Kind regards

Amir

First of all, unit you have tested the procedure (namely, in the workshop of SQL, SQL * Plus, SQL Developer, etc, etc) to see if it produces the output in the first place right?

If you have, and the generated query string is valid, try to assign the output to a page element (allowing you to visualize in the session browser), or even through the procedure output window for debugging (using the wwv_flow.debug function). This might indicate a change of State or session that is causing it not to return. You might find this easier to achieve if you switch from one "procedure and output parameter ' combination 'function returning string' approach."

If not, try to re-create the report in a new region - sometimes I came across strange bugs with parts of the report which were solved in this way.

Tags: Database

Similar Questions

  • When I try to change the interactive report columns, then triggers the error: "unable to change column attributes. "ORA-01403: no data found. Pls tell me why?

    When I try to change the interactive report columns, then triggers the error: "unable to change column attributes. "ORA-01403: no data found. Pls tell me why?

    You use listener EA3 ADR?

  • Change the order of the columns does not cause any data found error report

    Hello. I have a weird problem (and I'm new to APEX). I have a subregion of report that shows the details of a master record based on the ID of the parent area. When I have everything first to change SQL for the query and apply the changes page works fine. When I go back and change the region > attributes report and use the arrows to change the order of the columns the region then returns:

    error report:
    ORA-01403: no data found

    I tried to change the query so that the columns found in the desired order and who has also not returned no data error. If I go back to my original query (which had 2 fewer columns) the page works again. Then I change to the new query (2 addtl columns), and then it works again, until I have change the order of the columns again. Don't know if it would be serious or not, but one of the columns is a 2 columns of the table concat.

    Any ideas would be appreciated, because I'm out of them.

    Thank you!

    use: Apex 4.0
    DB: 10g Exp

    "807428," Hi

    using 4.0 or 4.0.1? Can you reproduce the same problem on apex.oracle.com as well?

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • APEX 4.1 BUG: ORA-01403: when you try to remove column classic report

    Hello

    I have produced this on apex.oracle.com.

    Create classic example from query report
    select ename,
    empno,
    mgr,
    job,
    deptno
    from emp
    Change report attributes and add the derived column.
    Edit derived column, and place for the Expression of the column formatting HTML
    #ROWNUM#
    Will change the report query and delete the ename column of query.
    Press on apply changes and the result is error ORA-01403: no data found


    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0

    Published by: jarola on January 4, 2012 09:07

    Hi Jari,

    Thank you for reporting this issue, I filed bug 13738357 to follow it.

    Kind regards
    Marc

  • PL/SQL function body return query sql, no problem found data

    Hi all
    We are trying to build a dynamic report based on the selection of the item by the user. We use the SQL query (body of function from PL/SQL returning SQL query). However when a user change the item and submit the page. The following error is displayed.
    ORA-01403: no data is found.

    our request is simple
    declare
    l_query varchar2 (30000) default 'select id from chw.
    Start
    if(:P11_PARA=1) then
    l_query: = "select name from chw.
    end if;
    Return l_query;
    end;

    any quick help please.

    Hello

    I managed to recreate the error

    To remove the error to change the area and choose "use generic Column Names (analysis of query runtime only).

    Concerning

    Paul

  • No data found during execution of selection within a function

    Hello
    I have a select statement based on the USER_ROLE_PRIVS view for a specific granted_role and the user, if I run the statement in SQL/Plus I get the required result, however if I put the same selection in a function and run the function by the same user I get ora-00100 no data found. I run given to the public on the service. Is there a scholarship that I missed

    Any help would be great
    Tina

    If the execution of another schema, add a statement such as authid current_user

    create function f_authid_cu return number
      authid current_user
    as begin
      return 0;
    end f_authid_cu;
    /
    
  • No data found in sql

    OK, this should be simple, but I'm stuck

    I'm trying to display a value when no data is found in a sql querry. similar to a nvl
    but nvl does not work because no line is detected.

    I don't want to do any pl/sql or defined by the user of the functions.

    Thus, for example

    Select nvl (to_char (level), "no_data_found") lvl
    of the double
    where 1 = 1
    connect by level < 6

    Returns the value 1 to 6 as expected
    but I try to get the following statement to return the words no data found

    Select nvl (to_char (level), "no_data_found") lvl
    of the double
    where 1 <>1
    connect by level < 6

    I've been playing with some of the functions of the group, but I can't very well.
    I thought that something like that could be on the right track.

    Select case count (*) over() when 0 then "no_data_found" another to_char (level) end lvl
    of the double
    where 1 <>1
    connect by level < 6

    Use a left join to double.

    for example when he is observed data:

    with tab_a AS
    (
      select to_char(level) AS lvl
      from dual
      where 1 = 1
      connect by level < 6
    )
    select nvl(tab_a.lvl, 'no_data_dound') from dual left outer join tab_a on dual.dummy = 'X'
    /
    
    NVL(TAB_A.LVL,'NO_DATA_DOUND')
    ----------------------------------------
    1
    2
    3
    4
    5                                        
    
    5 rows selected
    

    .. .and where not found...

    with tab_a AS
    (
      select to_char(level) AS lvl
      from dual
      where 1 != 1
      connect by level < 6
    )
    select nvl(tab_a.lvl, 'no_data_dound') from dual left outer join tab_a on dual.dummy = 'X'
    /
    
    NVL(TAB_A.LVL,'NO_DATA_DOUND')
    ----------------------------------------
    no_data_dound                            
    
    1 rows selected
    
  • Query report back "No data found" with bind variables

    I put a simple query in the report query:

    Select "bluefish". 'name' as 'name',
    "bluefish". "" primary_flag "as"primary_flag. "
    "bluefish". "" status "than"status. "
    "bluefish". ' ' ID ' as 'ID' of "bluefish" "bluefish" where "bluefish". "" ID "=: P3_XPRINTID

    When I test the query, the data is returned. However, when I try to run the query using the "Test report" button, I get an error 01403 no data found. If I replace the link with an explicit value variable, the report runs.

    Anyone have any ideas as to what is causing this problem? I use the generic report layout, with different types of output. I'M editting the query and set the binding variable before test report (otherwise, the query is not executed).

    Charles

    In fact the report would go - unlike other products of Oracle who complain about a missing binding variable, Apex is not complaining but interprets as a null value. So if you hurt typed the name of your variable, you are never alerted to it.

    Check the Session window to make sure that it is a value - the most common questions are that you named the wrong variable in the query or your item has no value in session state again.

  • APEX 4.2 classic report when more data found message

    Hello

    Has anyone used report classic message "Times more data found" APEX 4.2?

    I did not get this message illustrated using any report model or any report parameter.

    Need to add a few report template substitution strings?

    It would be great if someone could share example how this message should be used.

    Kind regards
    Jari

    Hi kvlek,

    Thank you

    Could you please share steps how you did it in apex.oracle.com?

    Kind regards
    Jari

  • conditional view using body of the Pl/SQL function returning a Boolean

    I have problems with the conditional display of a report.

    I have to select list: p50_facility and p50_supervisor.

    I entered the Sub function body of pl/sql returning a Boolean

    Begin
    If (: p50_facility is null or)
    (: p50_supervisor is null) THEN
    Return False;
    On the other
    Return True;
    End if;
    End;

    No matter what values are my articles on (null, not null), the report shows.

    What I am doing wrong?

    Hello

    The list values will be null only until the first time that the page is sent. Subsequently, the value is likely to be "null %."

    You should do something like:

    BEGIN
     IF (:P50_FACILITY IS NULL OR :P50_FACILITY = '%' || 'null%' OR :P50_SUPERVISOR IS NULL OR :P50_SUPERVISOR = '%' || 'null%') THEN
      RETURN FALSE;
     ELSE
      RETURN TRUE;
     END IF;
    END;
    

    Andy

  • How to get the query of the region "PL/SQL function body returns the query string"?

    Hello

    is it possible to get the query string from the region of type "PL/SQL function body returns the query string"?

    I can get the definition of the region as a PL/SQL procedure, but I am interested in the returned query. I tried to write something like

    < pre > v_return_query: = «...» » ;
    : P49_QUERY: = v_return_query;
    Return v_return_query; < / pre >

    to save the return on hidden item P49_QUERY string, but it does not work. I get the error message: ERR-1002 cannot find the item for the "P49_QUERY" element ID in the application '4000 '.

    Kind regards
    Przemek

    If you need to make reference to a page element in the block then you can use this type of control to avoid having to use generic column names:

    if apex_application.get_current_flow_sgid(:APP_ID) = apex_application.get_sgid then-- runtime  :P9_SQL := vSQL;else-- design time  null;end if;
    

    But if all you want to do is capture the SQL debugging you can take all the references element in the block and use the insert statement (in a debug table) as I showed earlier.

    Scott

  • assign a value to a text element using the PL/SQL function body

    Hello

    I want to assign a value to a text element using PL/SQL function body option in the Source elements. But the below error when I try to apply it.

    Source code:

    declare
    name varchar2 (100);
    Start
    If v ("P3_CREHIDD") = 'Edit' then
    Select ename in the name of cpy_emp where empno = v('P3_EMPNO2');

    end if;
    end;


    ERR-1904 unable to calculate the default item: type = computation_type = function body declare name varchar2 (100); so start v ('P3_CREHIDD') = 'Edit' and then select ename in the name of cpy_emp where empno = v('P3_EMPNO2'); end if; end;.

    Thank you
    David.

    Hello

    Your body of the function doesn't return anything.
    Maybe it works

    declare
      l_name varchar2(100);
    begin
      if v('P3_CREHIDD') = 'Edit' then
        select ename
        into l_name
        from cpy_emp
        where empno = v('P3_EMPNO2');
      end if;
      RETURN l_name;
    end;
    

    BR, Jari

  • APEX shortcuts using the source of the body of the PL/SQL function

    Hi all

    Recently, I came across the feature of "Shortcuts" in the "Shared components" section of the APEX and thought great, somewhere to set the common/standard items once, then use these several times in different pages of my application.

    This seemed to work correctly when you use the 'Source' of "HTML Text" or "HTML text with special characters escaped", but then I wanted to explore the use of the "Body of the PL/SQL function" option to create a more dynamic shortcut/variable on the base.

    This is where I came across a particular problem in the APEX (Version 3.2.1.00.10 on GR 11, 2 on Oracle Enterprise Linux). When I set my shortcut, and then perform a reference to my shortcut (using "MY_SHORTCUT") in an area of a page, the value of shortcut is back, but is added with the reference variable (ie. the 'MY_SHORTCUT' chain).

    For simplicity, my example looks like this (of course, my real world example is a bit more complicated, but this example produces the same error):
    (a) I define my shortcut called "MY_SHORTCUT" and using the body of the PL/SQL function under "Source Type", define my procedure as "htp.p(:USER)."
    (b) I then create a new page (basic HTML page), and a new region of the 'type'-> 'HTML Text (with shortcuts).
    (c) in the "Source region", I define my shortcut like - "MY_SHORTCUT".
    (d) I apply changes and then run the page.

    I'll be back will be name of the current user with "MY_SHORTCUT" appended/added immediately after the user name - for example. the string:-' BRAD «MY_SHORTCUT»»

    Question is - how to stop the shortcut/reference text "MY_SHORTCUT" to be added to the variable you want to see the and thereafter on your page? I am just wanting the variable, NOT the reference for the shortcut.  I do something wrong using the HTP package, and if yes, what should I use?

    If "MY_SHORTCUT" is defined as "HTML text with special characters escaped" (where I can refer to elements of application using the syntax '& USER.') so that everything works correctly. My reason for using the PL/SQL is to generate a more dynamic output variable, based on elements of application throughout the entire application - and of course the use of shortcuts to minimize coding and duplication.


    Thanks in advance,
    Brad

    Hello

    The body of the PL/SQL function must RETURN a value.

    Try:

    RETURN :APP_USER;
    

    Andy

  • PL/SQL expreesion and body of the PL/SQL function

    Hi all

    Value of source of items, we have options like static text, DB columns like this.
    But I did not use PL/SQL and PL/SQL function body expressions when I try to use its not to validate.
    I know what format I can use?
    Complete program of PL/SQL or the body of the function.
    If possible provide two programs simple expression PL/SQL and PL/SQL function body

    Hello

    Or use ELSIF rather than ELSE IF

    Andy

  • Call the function browser plsql (403 error)

    Hello

    I m pl/sql developer and I m new in APEX. In fact, I have little trouble with Express application, authorization and call browser plsql. I found the pl/sql procedure to see the image (actually I don't like in pl/sql, I'll be happy if I calll Hello World of browser).

    My Info: Oracle 12.1 c, Windows 7, default APEX 4.2

    I found it is appeal possible function of the url in this way: http://localhost:8080/apex/APEX_040200.just_print and he return 403 for me, where:

    Just_print is defined as

    create or replace
    PROCEDURE JUST_PRINT AS
    BEGIN
    htp.p('HAF');
    END;
    

    Just_print, it's in the APEX_040200 scheme

    According to web articles that I give perform this function ANONYMOUS or APEX_PUBLIC_USER or PUBLIC. I don't like the safety (my local host, learning...) so I have him granted for all:

    grant execute on just_print to anonymous,apex_public_user,public;
    

    It must stop return 404 (not found) and start to return a 403 (forbidden) - it works (for anonymous scholarship, but I hold decided run grant for all accounts - just for sure)

    Now, according to web I must change the function wwv_flow_epg_include_mod_local (in the APEX_040200 schema) and add the name of function. I tried but doesn't work. Yes, there is first line of the procedure returns alwas FAKE and I remove it, I also added the procedure IN the list. And also modified function that simply returns TRUE. Nothing works, real version is:

    create or replace 
    function                                     wwv_flow_epg_include_mod_local(
        procedure_name in varchar2)
    return boolean
    is
    begin
        if upper(procedure_name) like '%PRINT%' or upper(procedure_name) like '%IMAGE%' then
            return TRUE;
        else
            return FALSE;
        end if;
    end wwv_flow_epg_include_mod_local;
    

    (u just removed comments to be the shortest).  Here it's like printing (the function) and image (feature first tried) and superior, also when I try this:

    begin
    if apex_040200.wwv_flow_epg_include_mod_local('just_print') then 
     dbms_output.put_line('OK'); 
     else dbms_output.put_line('FAIL');
     end if;
    end;
    

    It will print OK (and also for ctrl + c/ctrl + v in web broswer) and also for any changes - APEX_040200.JUST_PRINT etc so it should not be a typo error.

    When I call just_print or PL/SQL region show_image (create page - add plsql - region and add the code begin just_print; end ;) it works.)

    Also, I've run the instalation guide ACL policy (all).

    I not found any other step to must be done - so I don't have anything else.

    --

    Any suggestion what I am doing wrong? (except the whole life, but this is another story...) )

    THANK YOU VERY MUCH

    Hello

    I don't think it's your problem, but it's bad idea create procedures to the diagrams of the system as APEX_040200.

    Create procedure to the own schema and then create public synonym for it.

    Grant execute privilege to public for the procedure, just to test.

    And change 040200.wwv_flow_epg_include_mod_local function always returns true, just to test

    create or replace
    function wwv_flow_epg_include_mod_local(
        procedure_name in varchar2
    ) return boolean
    is
    begin
      return FALSE;
    end wwv_flow_epg_include_mod_local;
    

    Then try the URL http://localhost: 8080/apex/just_print

    Kind regards

    Jari

Maybe you are looking for

  • Tecra S11-166 - thermal management for Windows 7 64-bit

    Hello has obtained a new Tecra S11-166. The work of doesn´t thermal management tools.Toshiba has installed the old Power Saver Tools (like they're for Vista). But these aren´t not work at all. Where can I get a new working Version or is there someone

  • Welcoming place?

    Sorry for the stupid question (probably). Got a refurbished RAZR Maxx HD after my first a broken. It seems the European (?) value. When I turn it off and turn it back on, it still affects the date week starts on Monday. Also, I noticed that a few wor

  • How can I get more XP licenses?

    Need 35 Windows XP licenses altogether, running NT and computer equipment begins to fail, a custom software does not work on Vista or 7.

  • Replace the faulty processor on a Pavilion Ultimate d4995t

    Need to know if this quad-core processor on the link below to qualify as a replacement for the defective processor in my HP Pavilion Ultimate d4995t CTO desktop PC: http://www.tigerdirect.com/applications/searchtools/item-Details.asp?EdpNo=2983971

  • DisplayPort Alienware 15 problem

    I just had time to connect my 15 AW at my monitor and found that the DisplayPort is not working properly.  Connected via DisplayPort to mini-DisplayPort, the laptop screen falls to resolution 1024 x 768 and nothing appears on the monitor (ASUS VG248Q