Call the procedure to set the context before interactive report refreshes the data

Hi guys,.

I have a question mind an interactive report which takes the data in a view.

The problem is that whenever I take the data from the database I need to define a context (user name and password) before running the query so the view will be taken into account the context and return only the lines that I have access.

Everything works fine when I'm first loading of the page: I have first to define the context, then load all the data I need on the page, including the IR. But when I try to apply IR filters, or even don't go to the next page no data is returned. I believe this happens because the context is not defined before the execution of the query to load the data and I don't seem to find a way to put it.

I tried to add a dynamic action on some events on IR (change, clicking, etc.) that executes the procedure to set the context, but without success - even if the event is raised, the report still doesn't return any data.

Can someone help me with this issue please?

Florin

Use the attributes of application security Code PL/SQL of the initialization/cleanup of the database Session to do this: http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/bldr_attr.htm#HTMDB28929

Tags: Database

Similar Questions

  • Interactive report returns misleading data because of the limit ROWNUM

    Hi, we have relied on the internal decision-making interactive reports widespread in our society, and they have been very popular. However, a user has found an inconsistency of data when sorting to a report because the ROWNUM limit: APXWS_MAX_ROW_CNT is applied before the user requested the ORDER BY clause. We run Apex version 3.2.0.00.27 on a 10.2.0.4 database.

    Request quotes from our application IR returns citing custom and the number of lines by default is 100 (and is editable by the user). The user wants to see the most recent citations, so he chose the column heading "Date of creation" and simply applied a descending filter. The last quote returned was dated last week. However, if he has applied an additional filter of "date of creation last week", he sees today date and for most of the current quotation lines.

    When I ran on its IR application debugging, I see that the ROWNUM limit is applied first, followed in ORDER BY. This means that the database retrieves the x first lines that match the provided parameters and then orders the result set. However, this isn't what the user meant, he wanted the first lines of an ordered set.

    This is the result of the query to debug (deleted community because it is long):
    select 
           "QUOTE_NUMBER",
           "CUSTOMER",
           "CUST_CONTACT",
           "QUOTE_STATUS",
           "TOTAL_PRICE",
           "TOTAL_WEIGHT",
           "WHSE",
           "SHIP_DATE",
           "PO_NUMBER",
           "ORACLE_REFERENCE",
           "INSIDE_SALESREP",
           "OUTSIDE_SALESREP",
           "CREATION_DATE",
           "ID",
           "ORA_CUST_ID",
           "CUST_CONTACT_ID",
           count(*) over () as apxws_row_cnt
     from (
    select  *  from (
    SELECT 
      kh.id,
      kh.ora_cust_id,
      kh.quote_number quote_number ,
      kh.cust_contact_id,
      k2_customers_pkg.get_contact(cust_contact_id) cust_contact ,
      k2_customers_pkg.get_cust_name(kh.ora_cust_id)customer,
      k2_customers_pkg.get_cust_number(ora_cust_id)
    
     ( ......... more sql goes here )
    
    AND k2_customers_pkg.get_outside_salesrep_number(kh.ora_site_id)||'%' LIKE :P64_OUTSIDE_SALES||'%'
    AND kh.whse_code like :P64_WAREHOUSES||'%'
    AND ((1=
        CASE WHEN :P64_ITEM_ID IS NULL THEN
            1
        ELSE
            (SELECT 1
               FROM k2_quote_lines kl
               JOIN k2_ingredients ki
                 ON ki.quote_line_id=kl.id
              WHERE (1=1
                AND kh.id=kl.quote_id
                AND ki.ora_item_id=:P64_ITEM_ID AND ROWNUM=1))
        END)
        OR 1=(
            SELECT 1 FROM k2_quote_lines kl WHERE kl.quote_id=kh.id AND kl.part_id=:P64_ITEM_ID AND ROWNUM=1
        ))
    )  r
    ) r where rownum <= to_number(:APXWS_MAX_ROW_CNT) 
     order by "CREATION_DATE" DESC,"QUOTE_NUMBER" DESC
    However, what the user must have the ORDER BY applied first, then the limit. I realize performance can be affected, but users are now alarmed that they cannot trust these reports. I'm tempted to connect a SR with Oracle on it.

    Any ideas on that? What is this problem fixed in 4.0?

    Thank you, Moritz Wolf

    Hi Wolf,

    I don't think that the problem is with the number of rows displayed. I think that it is a function of the attribute of the ratio "number of lines". And as assistance at the level of the elements of this attribute indicates "defines the maximum number of rows in the query. Note that this attribute impact on performance. Get fewer lines can improve performance and get thousands of lines can adversely affect performance. »

    You can set the maximum number of rows to an artificially high - greater number that we'll never be your total number of lines. But this does not alter the fact that the ORDER BY still apply on the outer part of your query.

    Joel

  • Sort the results of interactive report in no data found message

    Hello

    I have an interactive report that returns results based on the: bind variable QUERY - I have a list of navigation on the side where all the elements to link to the current page with different values of request. The IR works fine until I try to sort the columns by clicking on the heading and selecting increasing / decreasing, how it returns no data available.

    It starts to work again if I change the last line of GOLD: REQUEST IS NOT NULL but this breaks the functionality of the report, I would like to return only selected articles or all if no query variable is present. I'm guessing that sort sets: ASK something temporarily and divides. My query is below, any ideas?
    SELECT   id,
             job_number,
             appt_start,
             domain,
             pwa,
             status,
             tstamp_created 
      FROM   fail_jobs 
      WHERE  (status = 'NEW' AND userid_created != 'SYSTEM' AND :REQUEST = 'ARD') 
         OR  (status = 'ATR' AND :REQUEST = 'ATR')
         OR  (status IN ('ERR','REV') AND :REQUEST = 'REV')
         OR  (status = 'COM' AND :REQUEST = 'COM')
         OR  (status IN ('PCD','PCA') AND :REQUEST = 'PCD')
         OR  :REQUEST IS NULL
    Thank you

    There are problems with interactive reports referencing known: DEMAND value, probably due to an internal logic that manages also simultaneously - potentially cause a malfunction or blockages.

    A workaround that I learned is to create a calculation to assign: APPLICATION to a temporary element (a PXX_REQUEST, for example) and reference it in the query, instead of: ASK. This has worked well for me in my experience.

    I would like to know if this helps - pls sign the thread as 'Useful' or 'Correct' if so, so more people can benefit.

    TKS,
    Kléber

  • Interactive Reporting does not open in the workspace of Hyperion

    Hello

    I installed Hyperion Foundation Services 11.1.1.1.0 and IR 11.1.1.1.0

    I'm trying to access IR through the workspace

    I could see the procedure as file-> new-> Document_ > document interactive report.

    Then, I chose a .oce file to establish the connection. but I'm not able to progress to the next window.

    After selecting the file .oce a new pop up is to filled. Then it closes automatically in a fraction of a second...

    I don't know what the problem is.

    Kindly help.

    Thank you.

    Concerning

    GATHATHARAN K

    --------------------------------------

    Hi all

    I tried the same thing with the Mozilla browser.

    Here I am ablwe to open a page saying

    Checking status of interactive Web Client - Reporting Hyperion...

    then another a new win dow becomes opend.

    In this window, he was asked for the

    "Press the"Begin"button to start the installation."

    asked for confirmation.

    I HAV rush Begin then comes an error

    "Firefox could not install the file at.

    http://10.23.7.6:45000/InsightInstaller/insight.xpi?-L0009

    because: download error
    -228 "


    Please help me

    Thank you.

    Regards
    GATHATHARAN K

    Published by: gatha_vdm on March 23, 2009 08:25

    Published by: gatha_vdm on March 23, 2009 08:37

    Hi GATHATHARAN,

    I think that webclient is not installed on your machine. In fact it should settle automatically from the server. If this isn't the case, you can install it manually. In the location of your Hyperion C:\Hyperion\products\Foundation\workspace\InstallableApps\zeroadmin\component\Insight server, you must run the setupie.bat file and install it.

    If you want to install the webclient service in another computer, then copy the folder zeroadmin on the desired machine and you can install it.

    Once the installation is successful, you will be able to progress.

    Let me know if you have any questions.

    Thank you
    BIGOT

  • Question of character set of interactive report

    Hello

    Our system must be configured to use the character set, however in an interactive report if you enter £ in the search bar, that it returns no row as it seems to get a multi byte chacater the becoames £ A £ Western Europe

    Text line contains ' A £»

    Only simular discussion I've met said it could be "The DAD character Set Configuration in the Apex workspace" but I don't know where we can check this.

    Any ideas where we look at.


    Thanks Andy

    Thank you. This line:

    PlsqlNLSLanguage AMERICAN_AMERICA. WE8ISO8859P1

    .. .needs to be replaced by:

    PlsqlNLSLanguage AMERICAN_AMERICA. AL32UTF8

    .. .in order for some ajax operations work properly.

    Scott

  • Call the procedure before any operation of DB

    Hi all

    I currently have an application configured to use a data source JDBC for all its transactions in database. I was wondering if it is possible to call a db procedure every time a new database connection is created for use.

    My scenario:

    All users are authenticated through an LDAP service and I store the user name and other relevant information on the success.

    The DB is a procedure established to a user name for the database user as long as the parameter passed in view (s). This is necessary for all our inherited audit information on all the relevant tables to be filled.

    So basically I have to call this procedure before any other transaction of db is called.

    I have successfully deployed the dynamic JDBC example in the past, but I was wondering if anyone knew another way with the given scenario.

    Any help is appreciated.

    Thank you!

    Maybe this can help http://blogs.oracle.com/jheadstart/entry/row_level_security_using_vpd_a

  • Call the stored procedure to support bean w / table setting dimensional bi

    Hi all, I use jdeveloper 11g

    I have a requirement where instead of calling several times a "insert into" statement rather call a stored procedure, a table shipping two-dimensional bi as a parameter.

    The table must have size [n] [4] and [0] [0] = string and others must have numbers.

    This is because users will be inserting thousands of records at a time, remote sites, so the load of sending of a should be avoided.

    Any suggestions?

    Thank you.

    Miguel,
    If you use ADFbc (VO and EO sense), you can use batch insert for this archive.
    However, he must think about the user interface and how to transfer data from the client to the server taking the place of the insert.

    How you accumulate the data to insert into the DB?
    Are able to collect you say 1000 records a time and transfer them in a single segment on the server?
    How about data validation and exception handling while inserting into the db?

    I'm sure you can use a pl/sql procedure to do the Insert, but the questions above should always be answered.

    Timo

  • Call the stored procedure, and bind parameters by name

    Hello

    I use the Oracle ODBC 12 c driver to pass values from one Interface to our database Oracle 11.2. The Interface software collects data from modbus protocoll and calls a stored procedure. Right now my syntax to call the stored procedure looks like this:

    CALL procedure-name ('STRING', 'Timestamp as String', numValue1);

    It works very well. Now, I have to add a default setting to my procedure. To stay flexible to make other changes, I want to call the procedure and bind the parameters by name. Release 10.2.0.1.0 ISC ODBC Notes:

    Added support for the named parameter, binding the parameters by name. ODBC Oracle driver now allows the application to specify the parameters of a stored procedure by name, in the procedure call. Named parameters are to be used in calls to stored procedures and should not be used in other SQL statements.

    So, it shouldn't be a problem to use named notation, but how do I do this in ODBC? I tried like this, but oracle returns an ora-00936 error of missing expression:

    call procedure-name (paramName1 = > 'STRING',= paramName2 > 'Timestamp as String',paramName3 = > numValue1).


    Thank you for your help.

    Finally, I was able to find the error. The syntax of the statement was very good. The problem was caused by another declaration that I edited before and the error has not attracted Attention immediately.

    Thanks for reading and looking for an answer.

  • Avoid calling the procedure in the cursor loop

    Hi all

    The following example of procedure the procedure written in cursor loop, is called each time until the end of the cursor loop...
    procedure proc_main is
    DECLARE
     cursor c1 is 
        select e.empno empno
               ,e.ename ename
               ,d.dname dname
               ,d.loc   loc
        from emp e,dept d
        where e.deptno = d.deptno ;
     
    BEGIN
      for i in c1 LOOP
       proc_test(i.empno,i.ename,i.dname,i.loc) ;
       end loop;
    END;
    -----------
    
    PROCEDURE proc_test (p_empno,p_ename,p_dname,p_loc) is
    ---
    ---
    begin
     select * into v1,v2,v3 ..
      from temp_tab
       where col1 =p_empno
        ----
        ----
    
    end;
    What would be the alternative methods to write the procedure above instead to call the procedure inside the cursor for loop
    My idea is to use collections... could you give me the code example using collections to meet the above criteria

    Thank you

    Published by: smile on February 28, 2012 15:45

    The ideal would be to collect all SQL logic and put as much of it in a single SQL statement as possible. It would be also great to determine what is the final outcome of the process and use it as a starting point for your SQL. For example, if the desired result is to upgrade the salaries of the employees where they have an entry in table x, you might find that you can avoid needing to separate the logic between multiple, i.e. instead of procedures

    procedure proc_main is
    DECLARE
     cursor c1 is
        select e.empno empno
               ,e.ename ename
               ,d.dname dname
               ,d.loc   loc
        from emp e,dept d
        where e.deptno = d.deptno ;
    
    BEGIN
      for i in c1 LOOP
       proc_test(i.empno,i.ename,i.dname,i.loc) ;
       end loop;
    END;
    -----------
    
    PROCEDURE proc_test (p_empno,p_ename,p_dname,p_loc) is
    ---
    ---
    begin
     select * into v1,v2,v3 ..
      from temp_tab
       where col1 =p_empno
        ----
        ----
    
        UPDATE
            emp e
        SET
            sal = v2
        WHERE
            e.empno = p_Empno;
    
    end;
    

    You may simply have

    procedure proc_main is
    BEGIN
    
        UPDATE
            emp e
        SET
            sal = ( SELECT
                        t.new_sal
                    FROM
                        temp_tab t
                    WHERE
                        t.empno = e.empno
                   )
        WHERE
            EXISTS
                (   SELECT
                        NULL
                    FROM
                        temp_tab t
                    WHERE
                        t.empno = e.empno
                );
    
    END;
    

    Even if your logic is more complex, you are likely to find that you can merge several of the statements that you could be running in a loop and replace that loop with a join.

    Given the particular structure of what you posted if, instead of calling the procedure in a loop, you can simply move the cursor c1 as a parameter to proc_test that is

    procedure proc_main is
    
        lc_c1   sys_refcursor;
    
    BEGIN
    
        OPEN lc_c1 FOR
        select e.empno empno
               ,e.ename ename
               ,d.dname dname
               ,d.loc   loc
        from emp e,dept d
        where e.deptno = d.deptno ;
    
       proc_test(c1) ;
    
    END;
    -----------
    
    PROCEDURE proc_test (p_Cursor sys_refcursor) is
    
    begin
    
        LOOP
            FETCH ....
    
            ...DO SOMETHING...
    
            EXIT WHEN p_Cursor%NOTFOUND;
    
        END LOOP;
    
        CLOSE p_Cursor;
    END;
    

    But I highly recommend that you consider trying to merge as much of your SQL before considering the approach of cursor.

    HTH

    David

  • Calling stored procedures with parameters with the database connectivity Toolkit

    Hi all

    I'm new to the forum and struggling to find a solution to a particular problem I have in this respect, using the LabVIEW Database Connectivity Toolkit on a project, I am currently working on my work.  I have a database in which I tables and stored procedures with parameters.  Some of these stored procedures have input, output and return parameters.

    I tried to follow this example, but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument

    Such a stored procedure I am working on the implementation is named "dbo.getAllowablePNs", running "SELECT * from DeviceType" (DeviceType is the table).  In this case, it requires no input parameter, it has an output parameter that generates the table [cluster] and has a return parameter that returns an integer value (status code for execution) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int not null), PN (nvarchar ((15), null) and NumMACAddresses (int, null).)  I have surpassed many examples and I talk to the support OR try to implement this and similar procedures stored in LabVIEW but have not been successful.  I am able to connect to the database with the VI of open connection without error, but spin in some confusion as a result of this step.  I then try to use the VI of parameter query create to call the stored procedure and set the parameters.  I guess I would then use the Set parameter value for each parameter that is connected to the entry of parameters on the previous query with parameters VI VI?  I am also having some confusion during and after these steps as well.  I would greatly appreciate advice or suggestions that anyone could have in this situation because I am not a SQL expert.  Also, I would be happy to provide more information that might be useful.

    Kind regards

    Jon

    Here's what I use to do this.  I think I had to change him create parameterized query VI for him to work.  There is a post on the forum about this somewhere.

  • How to call the setting menu of the BIOS on HP DV4 1540us netbook?

    Hi all

    How to call the setting menu of the BIOS on HP DV4 1540us netbook?

    F2 does NOT an on-screen BIOS setting.

    Is there another trick?  Or, perhaps, defining the procedure step by step to start the BIOS?

    TIA

    Power on the laptop and all logo HP being displayed, press F10.

  • No access to the data in a database linked when calling procedures in the APEX 5

    Hello

    I use

    • APEX 5.0.3
    • APEX DB: Oracle DB 12 c
    • DB related: Oracle DB 11 g

    When you call procedures and packages of APEX-side on the related DB, I can't access the data with a "select...". "in the tables on the DB related.

    Is it because of the different versions of DB?

    Is there a general setting in my APEX 5.0.3 I need to access the data in the tables on the DB related?

    Any help appreciated.

    Thanks in advance.

    Concerning

    Norbert

    Hello

    Thanks for the reply.

    But at least we do the upgrade again.

    ... when editing a dblink and recompile the schema it all works.

    Concerning

    Norbert

  • call a procedure of package DB type complicated if the type defined in the package itself

    Hello world

    I use jdev 11.1.1.7.0

    I defined a package of data with a procedure and internal two types as follows:

    Create Or Replace Package Db_Package As 
    
    Type rec Is Record(Rec_Type Varchar2(10), Rec_Desc varchar2(10) );                        
    Type recordList Is Table Of rec;
    
    Procedure Test_Procedure(p_out out recordList);
    END db_package;
    
    
    

    evil

    I want to call this procedure in the module of the application. I know how to call a procedure or function db AM,

    but in this case that I've defined two types in the package itself and I use one of these types as to the procedure output parameter, I had a problem.

    below is the example of code to call the db procedure, but it does not work because the plsqlBlock.registerOutParameter () setting will not

            CallableStatement plsqlBlock = null;
            String statement = "Begin DB_PACKAGE.Test_Procedure(:1); END;";
            try {
                plsqlBlock = getDBTransaction().createCallableStatement(statement, 0);
                plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY);// it doesn't work
                plsqlBlock.executeUpdate();
                Object object = plsqlBlock.getObject(1);      
    
    
            } catch (Exception e) {
                e.printStackTrace();
            }
    
    
    
    

    I know that if I set the types of packets (rec, recordList) as types of oracle (instead of setting in the packaging itself) so I can call the procedure with success, in this case I should use below:

    plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY,"Recordlist");
    

    but I wonder how you can call a procedure from the package if the types defined in the package itself.

    Kind regards

    Habib

    JDBC supports the types of oracle level package only from 12 c database and jdbc driver ojdbc7 (which requires java 7).

    Dario

  • Apex 5, call a modal page, set page elements, in values referenced title page elements are not the same (correct) than the item itself

    Hello

    Apex 5.

    IR (departments) on page 2 I want to open a modal page 3 (classic report) with the detail data (from emp) for a Masters depno via a link on depno column.
    In Page 3, I created two elements P3_DEPNO and P3_DNAME. These elements are defined in modal page 3 of page 2.
    When I do these two visible elements on page 3 I can see, the values are set correct according to the value in column (depno) link on page 2.
    However, I would like to place these element values in the page title of page 3
    Title: PGE for DepNo: & P3_DEPNO., DepName: & P3_DNAME.

    It happens that the values mentioned in the title of the page are not the same (good) as in the items himself.
    Initially, they are NULL. Only when I refresh page 2 the values change but remain the same (last called depno) as long as I'm doing a new refresh of page 2.

    I wonder how I can run to display the values of the correct point in the title of the page corresponding to the values of the correct page element (that I have hidden).

    Y at - it something more to do, or it could be a small bug?

    I've created a little demo app on
    https://Apex.Oracle.com/pls/Apex/f?p=75955:2

    WS: AMLWS001

    Demo/demo (developer is)

    Please see the report 1.

    Thank you in advance!

    André

    Hi andremi,

    andreml wrote:

    Hello

    Apex 5.

    IR (departments) on page 2 I want to open a modal page 3 (classic report) with the detail data (from emp) for a Masters depno via a link on depno column.
    In Page 3, I created two elements P3_DEPNO and P3_DNAME. These elements are defined in modal page 3 of page 2.
    When I do these two visible elements on page 3 I can see, the values are set correct according to the value in column (depno) link on page 2.
    However, I would like to place these element values in the page title of page 3
    Title: PGE for DepNo: & P3_DEPNO, DepName: & P3_DNAME.

    It happens that the values mentioned in the title of the page are not the same (good) as in the items himself.
    Initially, they are NULL. Only when I refresh page 2 the values change but remain the same (last called depno) as long as I'm doing a new refresh of page 2.

    I wonder how I can make it work to display the values of the correct point in the title of the page corresponding to the values point right page (what I have hidden).

    Y at - it something more to do, or it could be a small bug?

    Page title is rendered before the page elements, that is why is not highlighted in your title.

    I don't think directly, we can use the page as a page element value.

    Creates a copy of yours and made the change it new App id - 45390

    There, I created a static area without a model before your report area and put your article into that.

    then displayed title PGE for DepNo: & P3_DEPNO, DepName: & P3_DNAME. for the area of your report.

    Kind regards

    Jitendra

  • How to call the procedure type table

    Hi I have the below requirement

    Created in the sub table type

    CREATE or REPLACE the TYPE char_type IS the TABLE OF VARCHAR2 (4000);

    create or replace procedure test_proc_type (p_type char_type) is

    Start

    I'm looping 1.p_type.count

    dbms_output.put_line (p_type (i));

    end loop;

    end;

    How to call the procedure with parameter as a type!

    SQL> create or replace type  char_type as table of varchar2(4000)
      2  /
    
    Type created.
    
    SQL> create or replace procedure test_proc_type (p_type char_type)
      2  is
      3  begin
      4    for i in 1..p_type.count loop
      5      dbms_output.put_line (p_type(i) ) ;
      6    end loop;
      7  end;
      8  /
    
    Procedure created.
    
    SQL> set serveroutput on
    SQL>
    SQL> exec test_proc_type(char_type('A','B','C','D','E'))
    A
    B
    C
    D
    E
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

Maybe you are looking for