Connecting a report region and a PL/SQL region

Hi,
I have created a report region whith pagination that only show 1 row at a time. I can then navigate backwards and forwards through this recordset. The first reportcolum in this recordset contains a number.
I have also, on the same page, created a PL/SQL procedure region. What I want is to use the number from the SQL region as an input to the PL/SQL region. So when I navigate through the report (Using the pagination arrows), the PL/SQL region is in sync with the record I'm currently seeing in the report.
Is this possible or do I have to try something different?
Regards
Trond

Hi Trond,
If you only want to show one record in your first region, it might be best to work with page items, retrieve one record at a time and use that data as the source for your page items. It's easier to implement and easier to reference those values in your second region. Reports are great if you have more then one record.
Having said that, there are ways to implement it the way you outlined it in your posting. Granted it's not very elegant but it serves its purpose. You could write your own PL/SQL package, use this to set a global to the current row's primary key value and reference that global in your second region.
Create your package as follows:
create or replace package md_sample as
g_pk_value number;
function set_value(p_value number) return number;
end;
create or replace package body md_sample as
function set_value(p_value in number) return number is
begin
g_pk_value := p_value;
return 1;
end;
end;
Now you need to make sure that your report calls this package appropriately. Calling this as part of your SQL statement won't work properly as it would also be called for records not currently shown on your page. A better way would be to use it for a PL/SQL expression within your report template definition. Pick a custom report template for your report and edit that template. Scroll down to the condition for the first column template and pick “Use Based on PL/SQL Expression”. Then type in the following expression (this is based on a select deptno, dname, loc from dept report):
md_sample.set_value(#DEPTNO#)=1
After that you'll be able to reference the global md_sample.g_pk_value. You could e.g. use this as the source for page items shown in your second region.
Hope this helps,
Marc

Similar Messages

  • Trying to Connect to Reports 6i/NT Developer to SQL Server 7 using ODBC

    I am trying to connect Reports 6i Developer on NT through ODBC to SQL Server 7 (on same NT machine), and get an error message:
    ORA00022: invalid session id; access denied.
    When I try connecting using SQL*Plus, I get the following message:
    SQL*Plus: Release 8.0.6.0.0 - Production on Thu Mar 15 09:57:48 2001
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    ORA-00022: invalid session id; access denied
    ORA-00022: invalid session id; access denied
    ORA-00022: invalid session id; access denied
    Error accessing PRODUCT_USER_PROFILE
    Warning: Product user profile information not loaded!
    You may need to run PUPBLD.SQL as SYSTEM
    Server not available or version too low for this feature
    ORA-00022: invalid session id; access denied
    I can run SQL queries only after I have run a DESC <table name> command once. Otherwise, I get the following error:
    SQL> select * from authors;
    SQL*Plus internal error state 2090, context 246:0:0
    Unsafe to proceed
    Even with a DESC command is run, I can connect, but with an error as follows:
    SQL> desc authors
    ORA-00022: invalid session id; access denied
    Name Null? Type
    AU_ID NOT NULL VARCHAR2(11)
    AU_LNAME NOT NULL VARCHAR2(40)...
    ODBC Drivers used: I get the same results in Reports 6i and SQL *Plus with the Intersolv/Merant or Microsoft ODBC drivers for SQL Server. (Merant Version 3.7 for 32-bit SQL Server 6, 12/1/00)
    Please HELP.

    harry,
    i am assuming you are using 6.0.8.8 of reports6i, which is base-release. there have been problems withthe OCA in this version. by using the latest patch you should solve this problem. for further details, please contact oracle support services.
    regards,
    the oracle reports team

  • KB for Reporting Services and IE11 on SQL 2008 R2

    We are beginning our IE 11 deployment, and we have identified that the CM reporting services site will only render certain reports when you click the 'Enterprise Mode' option.
    This is a known issue addressed by http://support2.microsoft.com/kb/2917531 for SQL 2012, but I cannot find any correlating SQL 2008 R2 patch.
    Can someone point me in the right direction?
    Will

    What version of SQL do you have installed? Is there any chance you have enterprise mode enabled by default, or for your reporting site?
    Will
    I'm behind your version. I'm base SP2 with the MS14-044 patch (10.50.4033). And no, I don't have enterprise mode enabled.
    I've been meaning to apply SP3, I'll see if there's a difference.
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • DB Connect- Cant see tables and views in SQL DB

    HI,
          I successfully managed to connect a MS-SQL DB using DB connect. I am able to connect to the system (Check Connection). When i try to see the Views and Tables available in the SQL DB, it says there are no tables or views available. The SQL DB has granted permission for the SAP User to access certain views and tables. Still it is not showing any. Any help would be appreciated
    Thank You

    hi,
    check things to be followed in oss note 512739
    ( pdf 'Transferring Data with DB Connect' https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2f0fea94-0501-0010-829c-d6b5c2ae5e40 )
    make sure ...
    1. You have to create a special login for the extraction.
    You should add this login to the db_ddladmin database role in the corresponding database. This generates a similar DB user at database level. The user you use must have the 'CREATE VIEW' authorization at least. This is contained in the mentioned role.
    2. For the extraction, you should only use DB views that were created under this DB user. (See also type conversion, naming convention, and so on).
    3. The selected user should be granted the required authorizations (SELECT at least) on the source tables, or on the columns of these tables.
    4. The especially created login is to be used in the logon information when you are setting up the DB source system in BW.
    hope this helps.

  • Oracle Reports 6i and the Dynamic SQL

    I use Oracle 8.1.7 and Oracle Reports 6i Builder;
    My problem is that I am trying to obtain dataset for the report via stored procedure (using ref cursor). As far as I understand I must specify strongly typed refcursor in my package (specify record type based of which the ref cursor will be created, not just ref cursor without any return specification). But when it comes to my stored procedure implementation, here I would like to use dynamically created SELECT statement and since it will be parsed and executed at runtime I forced to use only untyped ref cursor to return data from the stored procedure.
    TYPE my_refcur IS REF CURSOR;
    cv_tmp my_refcur;
    v_SQL VARCHAR2(2000);
    BEGIN
    -- here I set v_SQL ....
    OPEN cv_tmp
    FOR v_SQL;
    RETURN cv_tmp;
    END;
    But this way I somehow need to convert untyped ref cursor to strongly typed one. This is a problem I would like you to help me with.
    Thanks in advise.
    By the way, I am not familiar with Oracle Reports 9. Does it still require to return only strongly typed ref cursor from stored procedures?

    Hello Alexey,
    The reason Reports requires strongly typed ref cursors to be returned to it is that, with weak ref cursors the list of columns returned by the cursor cannot be determined at report design time. For a weak ref cursor, the data will be populated based on a query specified only at runtime. As a result, you will not be able to add any layout to your report, since the query group will be empty.
    Please take a look at the reply in the post below on the same topic, for a method to retrieve data from a stored procedure returning a weakly typed ref cursor:
    Re: Reports On Ref Cursor
    Thanks,
    Srivas.
    The Oracle Reports Team.

  • Crystal Reports 9 and SQL Server 2005 default parameter values

    We're using Crystal Reports 9 and upgraded from SQL Server 2000 to SQL Server 2005.
    I'm noticing a very weird problem which I wonder if anyone else has experienced (and hopefully found a resolution for). It appears that in using Crystal with SQL Server 2005 stored procedures, if we have default parameter values in the stored procedures, the default parameter values get completely ignored if you pass in a NULL value from Crystal!
    For example, if you have a stored procedure that begins like this:
    ALTER          Procedure [dbo].[StoredProcedure]
    @Param1 VarChar(200) = '',
    @Param2 VarChar(200) = ''
    AS ...
    both @Param1 and @Param2 have a default value of an empty string, and therefore should become empty strings if nothing (NULL values) gets passed in for them.
    But, like I said, what I'm finding is that with Crystal calling the stored procedure with NULL @Param1 and @Param2 values, they never become empty strings, but rather remain as NULLs.
    This was never a problem with SQL 2000.
    Very perplexing. Anyone else every experience this?
    Thank you.

    Please ignore my earlier post -- answered my own question.
    NULL parameter values do not get replaced by default values in SQL -- that is normal behavior in both SQL 2000 and SQL 2005. Just goes to show, that no many how many years programming experience you have, you can still get tripped up sometimes : (

  • How to correct close database connection after report generation

    Hello
    I have problem a with alive database connection after report creation and report  closing. How to properly to close connection to database?
    Best regards
    Edited by: punkers84 on Jun 17, 2011 10:38 AM

    that's what I am doing... after viewing the report, I call the close method on the window closing event of the container window. but the connection is still open. I had a lot of other issues with my jdbc driver but after downgrading to an older version those issues are resolved.Only this one is still there! Is there any other way to close the connection (like using dbcontroller or etc.)?

  • Reporting tools and SAP BW

    Dear Sirs,
    We have Business Objects BI 4.0 and SAP BW 7.3.
    Actually we are using Web Intelligence and BEx Query to reporting.
    We have not Business Layer (Universe) between BW and BO because BO it's not supported to create universe (unx) on BW. So we create document in WEBI using BEx Query.
    We want to use Xcelsius (Dashboard Design) 2011 and I was thinking that we can use query from universe to connect with BW (new functionality in version 2011). Can we? Or maybe we should to connect to BW using "Connecttion to SAP BW"?
    We want to use Explorer (on iPad and iPhone), but Explorer requires universe (unx).
    Is not possible to create universe (unx, because unv is not supported via Explorer) based on SAP BW, is it true?
    We should we do, when we want to use Explorer with SAP BW?
    Do I understand connection between reporting tools and SAP BW:
    Crystal Reports - can I use cubes or BEx queries
    Xcelsius - using "Connection to SAP BW"
    WEBI - BExqueries or universe (but only UNV - old version).
    Explorer - in my opinion is not possible
    Analysis for OLAP - drirect to cube in SAP BW
    Could you please comment.

    Hi
    With the current version of the BI 4.0 SP2 BI Platform, one cannot create a universe (.UNX format) against BW using the OLAP connection. However you can create a universe (.UNX format) using the Relational connection (see OSS note: 1656905 - How to create UNX universe based on Business Warehourse InfoCubes). One limitation is the use of hierarchies with the relational connection.
    Then you can create the Information spaces based on the universe (.UNX format) that the Explorer can use.
    BO Reporting tools:
    1. Crystal Reports for Enterprise = you can use the OLAP connection (BICS) directly against the BW InfoCubes or Queries, if queries already exist in the BW system then you can leverage these directly (less time spent recreating the entire query in Crystal)
    2. Xcelsius = you can use the BICS or Web Service or Universe to access the data
    3. Web Intelligence = you can use the OLAP Connection (BICS)
    4. Explorer = you can use a universe (.UNX format) via a Relational Connection
    5. Analysis for OLAP = you can use the OLAP connection (BICS) to either a query or InfoCube.
    It is hoped that in Feature Pack 3 which will be released later this year, that missing functionalities will be delivered for BI 4.0.
    Regards
    Derek

  • SQL Query (updateable report) Region - Conditionally Hide and Set Values

    SQL Query (updateable report) Region - Conditionally Hide and Set Values
    Outline of requirement :-
    Master / Detail page with Detail updated on same page using SQL Query (updateable report).
    The detail region has the following source
    SELECT item_id,
           contract_id,
           CASE WHEN hardware_id IS NOT NULL THEN
                   'HA'
                WHEN backup_dev_id IS NOT NULL THEN
                   'BD'
                WHEN hardware_os_id IS NOT NULL THEN
                   'HS'
           END item_type,
           hardware_id,
           backup_dev_id,
           hardware_os_id
    FROM   "#OWNER#".support_items
    WHERE  contract_id = :P26_CONTRACT_IDThe table support_items implements arced relationships and has the following columns
    CREATE TABLE SUPPORT_ITEMS
      ITEM_ID         NUMBER                        NOT NULL,
      CONTRACT_ID     NUMBER                        NOT NULL,
      HARDWARE_ID     NUMBER,
      BACKUP_DEV_ID   NUMBER,
      HARDWARE_OS_ID  NUMBER
    )A check type constaint on support_items ensures that only one of the fk's is present.
          (    hardware_id    IS NOT NULL
           AND backup_dev_id  IS NULL
           AND hardware_os_id IS NULL
    OR    (    hardware_id    IS NULL
           AND backup_dev_id  IS NOT NULL
           AND hardware_os_id IS NULL
    OR    (    hardware_id    IS NULL
           AND backup_dev_id  IS NULL
           AND hardware_os_id IS NOT NULL
          )    Hardware_Id is a FK to Hardware_Assets
    Backup_dev_id is a FK to Backup_Devices
    Hardware_os_id is a FK to Hardware_op_systems
    The Tabular Form Element based on item_type column of SQL query is Displayed As Select List (based on LOV) referencing a named list of values which have the following properties
    Display Value     Return Value
    Hardware Asset    HA
    Backup Device     BD
    Computer System   HSThe Tabular Form Elements for the report attributes for hardware_id, backup_dev_id and hardware_os_id are all Displayed As Select List (Based on LOV).
    What I want to do is only display the Select List for the FK depending on the value of the Select List on Item Type, e.g.
    Item_Type is 'HA' then display Select List for hardware_id, do not display and set to NULL the Select Lists for backup_dev_id and hardware_os_id.
    Item_Type is 'BB' then display Select List for backup_dev_id, do not display and set to NULL the Select Lists for hardware_id and hardware_os_id.
    Item_Type is 'HS' then display Select List for hardware_os_id, do not display and set to NULL the Select Lists backup_dev_id and hardware_id.
    There are properties on elements to conditionally display it but how do we reference the values of the SQL query Updateable region? they are not given a page item name?
    Also on the Tabular For Elements there is an Edit tick against a report item - however when you go to the Column Attributes there is not a property with which you can control the Edit setting.
    What's the best way of implementing this requirement in APEX 3.1?
    Thanks.

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user13515136".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    I have a multi-row region that displays values and allows entries in a number of fields.Provide exact details of how this has been implemented. (An example on apex.oracle.com is always a good way to do this.)
    I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done? Almost anything can be done, often in multiple ways. Which are appropriate may be dependent on a particular implementation, the skills available to implement it, and the effort you're willing to expend on it. Hence it's necessary to provide full details of what you've done so far...

  • Layout issue: sql report region and items derived from a different table

    Hi all,
    I have a report region whose source is a sql query. I am trying to display other items in the same region(These I added manually on the page and they come from another table in the schema). It works fine, except the items that I added manually in the region always appear at the top of the items that are derived from the query. I want the other way around if possible, where I want the items from report query to appear first and then the other items to appear below them. Can this be done? If so how?
    Thanks in advance
    sr

    sr,
    on the definition page of your region, set the property "Display Point" to "Page Template Body (1. items below region content).
    I think that's what you are looking for.
    Patrick
    *** New *** Oracle APEX Essentials *** http://essentials.oracleapex.info/
    My Blog, APEX Builder Plugin, ApexLib Framework: http://www.oracleapex.info/

  • Unable to connect to report server - on Win 8.1 and SQL Server 2014

    unable to connect to report server on  Win 8.1 and SQL Server 2014 version
    Microsoft SQL Server 2014 - 12.0.2000.8 (Intel X86)
        Feb 20 2014 19:20:46
        Copyright (c) Microsoft Corporation
        Express Edition on Windows NT 6.3 <X64> (Build 9600: ) (WOW64)
     Thanks

    Hi,
    I suggest you check out the following article for the steps of installing
    Database Engine Services and SQL Server Reporting Service.
    http://msdn.microsoft.com/en-us/library/ms143711.aspx
    Best Regards,
    Tracy
    Tracy Cai
    TechNet Community Support

  • Hierarchy indentation problem in the sql report region

    I've the following sql statement in sql report region. it works fine by bringing the all the users reporting to a manager correctly. In the sample user table below manager/id are in parent/child relationship.
    select id from user_table start with upper(id)=upper(:p332_person_short_id) connect by prior id = manager
    user1
    user2
    user3
    where user2 and user3 are reporting to user1.
    But I want to give some indentation between the user levels to show the hierarchy clearly in the report as below
    user1
    user2
    user3
    I tried with the following statment. It does indent the users correctly but in hierarchy is reversed.
    select LPAD(' ',6*(Level-1))|| id "User" from user_table start with upper(id)=upper(:p332_person_short_id) connect by prior id = manager
    the output is
    user2
    user3
    user1
    Any help is appreciated.

    I think padding with blanks will not work in HTML. You will have to pad with " ".
    So, something like this should work:
    select replace(lpad('@',6*(level-1),'@'),'@','&amp;nbsp;')||id "User" from ....
    Hope that helps
    Jochen

  • SQL Report Region

    Hi,
    I am using apex 4.0.1 and I have a page with several SQL Report regions. The user can edit the data in the report regions by clicking a column that uses a href link to open a DML page in a modal window. The user can then amend some data in the modal window, press save which closes the modal window and uses the partial page refresh process to refresh the SQL report region. (Using apex.event.trigger('#SOME_REGION'),'apexrefresh')).
    If I navigate through the report to show rows 31-45 and then click on a href to edit a record. On pressing save, the report is refreshed but the rows displayed goes back to 1-15.
    How can I get the report to stay showing the rows 31-45?
    Cheers
    Paul.

    I believe this answers my question
    http://monkeyonoracle.blogspot.com/2010/11/refresh-report-region-and-pagination.html
    Edited by: pjturley on Jan 10, 2012 1:14 PM

  • "Between NVL" - Works in SQL Command, not in APEX report region

    First, I realize I could use dynamic SQL (model 4), but I don't want to (too hard just yet).
    I have a select statement with a series of Where conditions that employ values, in bind variables, supplied by the user.
    I want the choice of parameters to be optional, so I am checking for and replacing nulls.
    Select emp_name from employee_table where
    emp_rating between nvl(:p7_rating_choice, 0) and nvl(:p7_rating_choice, 99)
    and
    emp_language_no between nvl(:p7_lang_choice, 0) and nvl(:p7_lang_choice, 99);
    (the binds should be numeric).
    The actual statement is quite a bit longer, but the point is that the BETWEEN NVL(:x, min) AND NVL(:x, max) piece does not seem to work when used in a report region.
    It works fine if ALL parameters are provided, but returns an error if one or more are null.
    In the SQL command window it works (with a pop-up) just fine.
    By the way, the :p7_lang_choice bind variable is chosen from a LOV list which works in all other cases.
    Also, if I disable nulls (choosing "no" in ITEM page), everything works fine. It seems that the substitution of the min and max values via the NVL returns the wrong data type.
    Any ideas what I have done wrong?

    Thanks Scott.
    Every day brings a little more understanding!
    I also noticed a simplified method in the APEX documentation (although there was no explanation of the code) as follows:
    Where
    (column = :p1_user_input_1 OR :p1_user_input_1 = [null substitution value])
    AND
    (column = :p1_user_input_2 OR :p1_user_input_2 = [null substitution value])
    AND
    etc...
    Using the value you provide in the LOV section for the null, the second part of the OR handles the null situation.
    For some reason I was so tied up with comparing to the column that I never thought to have an OR with a compare to something else.
    Oh well.
    Thanks,
    Norm

  • How to get the SQL Statement of a report region?

    For example: The SQL of report region such as "SELECT A,B,C FROM T1 WHERE A = :P10_A".
    I hope to get the converted statement (the variable has been replaced), like this:
    :P10_A = 'TOM', SQL: "SELECT A,B,C FROM T1 WHERE A = 'TOM'".
    THX.

    I agree with John with the usual caveat about using bind variables.
    In other words, you should use
    SELECT A,B,C FROM T1 WHERE A = :P10_Ainstead of SELECT A,B,C FROM T1 WHERE A = 'foo'so that the shared pool doesn't get clutterred with copies of the same (sharable) SQL.
    Even if you use the "PL/SQL function returning a SQL query", be sure to use bind variables in your SQL and not "glue in" session state by concatenating it into the query.
    Thanks.

Maybe you are looking for

  • Can't start mysql

    when I type "rc.d start mysqld" it displays busy for a while, then fails. At this point it does not generate an error message. I have changed the permissions of /var/lib/mysql recursively to 777. I have also created the mysqld directory in /var/run a

  • Any URL's that demo drill-down reports?

    Hi, Just took a new features in Oracle 10g class. The instructor mentioned that webpages could be created with JDeveloper that had a drill-down capability. Anyone know of any live examples on the web? Thanks,

  • String help needed.

    Hi guys column(below in the SQL) is a Varchar string column. COLUMN has values like ('312049D','312CF45','EDC0645','EDC5679'). Why does SQL2 take more than twice times it takes to return SQL1 . I am learning ways to tune SQL. Please provide your sugg

  • [Solved] Decrypt files securely inside lxc container.

    Hi, this is my first question, I've been using Arch for 5 years now, thanks for all your hard work! I'm trying to setup an lxc container to securely view encrypted files(gpg keys encrypted with cryptsetup and a loopback device), I've done so already

  • ATA vs. Solid State HD

    Hello, On the Apple Store site it says under MacBook Pro hard drive options "..Or you can choose a solid-state drive that offers greater durability." Is the only advantage of solid state durability? I can't imagine spending an additional $750 for mor