Bind Variables and Shared Component Report Query

I have a query in a region report which I have replicated to a shared component report query.
Both queries reference page items as bind variables in the where clause.
The report region on screen shows the correct results but the report query shows "no data". This is the case when running "Test Query" and "Download XML data" from the shared component report query definition. If I hardcode the variable names I get rows returned, If I use bind variables - and specify the values for these variables I get no data. THe XML file contains the tags for each bind variable I have specified but has no data between the tags. I have Ticked the box to include application and session state but it appears that the bind variables are not being used.
When I use my report query in the application (URL tied to a button) I get the same problem, the binds are not being passed to the report query.
Can someone please clarify if this is a bug or not? And if not, how can I get it to work.
I am using Apex 4.0.2
Thanks
Kathryn

Hi
To confirm, yes I selected the bind variables. I used these in the report layout, but the xml file has them as empty i.e.
<P0_START_DATE><P0_START_DATE/> with nothing in between.
IN the Test Query section, if I put real values in the boxes for the bind variables, I get no data found. If I hardcode the values into the query, I get the data.
I've repeated the create report query many times and have created a report layout in RTF. I can use the layout with my region - in the print attributes and the layout works with the query but I need to create a PDF using 2 queries - ROWSET1 and ROWSET2. I can generate the XML but the values in the rows are all empty. When I use the layout with a report query instead of the region, I get no data even though I have used the same sql and have selected the bind variables. I was using variables from page items on page zero but have also tried using page items on the current page, the result is the same.
I need to use a report query and a report layout as I need data from 2 queries in the PDF.
I looked at your demo - what happens if you add a second sql query to the report query - is there any chance I can look at the back end (developer access?)
Thanks for your input
Kathryn

Similar Messages

  • Using bind variables in Shared Component Reports not working

    I've created a report query as a shared component in my APEX application. I'm calling the report on a page via a button. The query behind the report has bind variables for period and entity fields which are both defined on Page 0. I can run the query and return values just fine, but when you run the report from the page via the button, I get no values back. Does anyone know a trick to getting this to work? I've been working in APEX for about a month and I don't have much developer experience so any help is appreciated.
    Regards,
    -Steve

    Rohit,
    Thanks for your response. We are using APEX version 4.2.1.00.08. I do have Session State enabled and have put the required page items in the list. Here is my report query (highlighted lines contain the bind variables):
    SELECT TAX_DIVISION.DIVISION_CODE Division,
    TAX_ENTITY.ENTITY_CODE Entity_Code,
    DECODE(TAX_ADJUSTMENT.CATEGORY_DESC,'Net Income/(Loss)',1,'Permanent Adjustment',2,'Temporary Adjustment',3,4) Category_Desc,
    TAX_ADJUSTMENT.CLASSIFICATION Classification,
    TAX_ADJUSTMENT.ADJUSTMENT_CODE Adjustment_Code,
    SUM(NVL(NVL(TAX_ENTITY_ADJUSTMENT.OVERRIDE_AMT,TAX_ENTITY_ADJUSTMENT.ADJUSTMENT_AMT),0)) Tax_Amount
    FROM TAX_DIVISION,
    TAX_ENTITY,
    TAX_ENTITY_ADJUSTMENT,
    TAX_ADJUSTMENT,
    TAX_PERIOD
    WHERE TAX_DIVISION.DIVISION_ID = TAX_ENTITY.DIVISION_ID
    AND TAX_ENTITY.ENTITY_ID = TAX_ENTITY_ADJUSTMENT.ENTITY_ID
    AND TAX_ENTITY_ADJUSTMENT.ADJUSTMENT_ID = TAX_ADJUSTMENT.ADJUSTMENT_ID
    AND  TAX_ENTITY_ADJUSTMENT.PERIOD_ID = :P0_PERIOD_ID
    AND  TAX_ENTITY_ADJUSTMENT.YEAR_ID = :P0_YEAR_ID
    AND  TAX_ENTITY.DIVISION_ID = :P0_DIVISION_ID
    AND TAX_ADJUSTMENT.ADJUSTMENT_CODE = 'IBIT'
    GROUP BY TAX_DIVISION.DIVISION_CODE ,
    TAX_ENTITY.ENTITY_CODE ,
    DECODE(TAX_ADJUSTMENT.CATEGORY_DESC,'Net Income/(Loss)',1,'Permanent Adjustment',2,'Temporary Adjustment',3,4),
    TAX_ADJUSTMENT.CLASSIFICATION ,
    TAX_ADJUSTMENT.ADJUSTMENT_CODE
    HAVING SUM(NVL(NVL(TAX_ENTITY_ADJUSTMENT.OVERRIDE_AMT,TAX_ENTITY_ADJUSTMENT.ADJUSTMENT_AMT),0)) !=0
    ORDER BY DIVISION_CODE, DECODE(TAX_ADJUSTMENT.CATEGORY_DESC,'Net Income/(Loss)',1,'Permanent Adjustment',2,'Temporary Adjustment',3,4), CLASSIFICATION, ENTITY_CODE, ADJUSTMENT_CODE
    The query returns data when I set the bind variables and test in the report queries screen. When I assign the report query URL to the button in the application and run from there, I get no results.

  • Setting a bind variable in a Shared Component Report Query

    I have defined a Shared Component Report Query in APEX using a bind variable similar to below
    Select name, id , ....
    from asset
    where id = :id
    I have also created a Report Region that displays a table where one of the columns contains a value I would like to be a link column that can launch the Report Query and pass its value to the bind parameter :id in the report query. This in turn would generate a pdf report for the details associated with that column. I am having problems setting the :id bind parameter. How do I do this?
    Can anyone help?
    Thanks

    The bind values are set from session state. So if try something like this:
    Select name, id , ....
    from asset
    where id = :P1_ID
    With P1_ID being a page item, for which you set the session state / value before generating the PDF file. So assuming you already have a page with a report and a page item, and that page item is already used in your report, then you could just create a button to download the PDF, make sure the button is a submit button, and create a branch pointing to the report query URL (or in 3.1 use the create button wizard, to do this declaratively.)
    Regards,
    Marc

  • Can I put a SQL query into a bind variable and then use it to output report

    Hi,
    Can I put a SQL query into a bind variable and then use it to output report?
    I want to create a report and an item "text area" (say P1_TEXT) which can let user to input a SQL query(they are all technical users and knows SQL very well). Then, I use a bind variable (that text area) to store the SQL statement. Then, I add a submit button and I want to use the following to output the report:
    select * from (:P1_TEXT);
    Do you think it is possible to do that? Any known limitations for APEX in this area?
    Thanks a lot,
    Angela

    You can, but make sure it's what you really want to do. Make sure you are VERY familiar with SQL Injection. Most people who know what it is, go out of their way to prevent SQL Injection. You're going out of your way to allow it.
    You can try using &P1_TEXT. instead of bind variable syntax. Bind variables are one of the best ways to prevent SQL Injection, which is why it's not working for you.
    Once again, I strongly urge you to consider the implications of your app, but this suggestion should get it working.
    Tyler

  • Using Bind variables in SQL PLUS Report

    using Bind variables in SQL PLUS Report. This report gets the arguments from the application concurrent program. Now my need is to convert the start_date and end_date to bind Variables to improve the performance. I have commented the original code in 'prompt List of Unapproved Adjustments' and used my Bind Variable but it is giving an error
    error: Bind Variable "ENDING_DATE" not declared
    Report Date and Time:
    26-OCT-2010 15:44:13
    List of Unapproved Adjustments
    Bind Variable 'ENDING_DATE" not declared
    Please see below the code for the sql plus report:
    define p_org_id           = '&1'
    define p_fy_begin_date = '&2'
    define p_start_date = '&3'
    define p_end_date = '&4'
    define p_conversion = '&5'
    declare
    variable begin_date date;
    exec :begin_date := p_start_date;
    variable ending_date date;
    exec :ending_date := p_end_date;
    /* Begin
    :begin_date := to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS');
    :ending_date := to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS');
    End; */
    set newpage none
    set termout off
    set pagesize 55
    set linesize 180
    set heading on
    set feedback off
    set wrap off
    set space 1
    set heading on
    begin
    dbms_application_info.set_client_info('&p_org_id');
    end;
    prompt
    prompt Report Date and Time:
    prompt ----------------------
    select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')
    from dual ;
    prompt
    prompt List of Unapproved Adjustments
    prompt -------------------------------
    select b.trx_number,
    a.adjustment_number,
    f.user_name created_by
    from apps.ar_adjustments a,
    apps.ra_customer_trx b,
    apps.fnd_user f
    where a.customer_trx_id = b.customer_trx_id
    and a.status <> 'A'
    and a.created_by = f.user_id
    and a.creation_date between :begin_date
    and :ending_date
    -- and a.creation_Date between to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS')
    -- and to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS')
    order by
    b.trx_number ;

    Hi
    Please go to customization part of the report and verify..You have set a default value out there ..And also verify your lov and look at the values ..If it is again giving you the problem ..pl delete the report and develop it again from the scratch it will be solved...
    vishnu
    null

  • Bind variables in User Defined Reports

    SQL Developer 1.0.0.11 / Windows XP / Oracle 9.2.0.5
    Thanks for adding the capability for bind variables in user defined reports. However, if there is more than one instance of the same bind variable in the report, the "Enter Bind Values" prompt lists all instances and requires the value be input for all instances. This is unlike the SQL worksheet which only lists the bind variable once. Please change the report behavior to prompt only once per unique bind variable.

    Just spoke with the developer of this - you will be prompted for each instance of a bind. That will not change any time soon so I wanted to let you know -
    -- Sharon

  • Variables and Structure in Existing query

    Hi,
    Where can i see the Variables and Structure in Existing query.
    Thanks
    Priyanka

    Open the Query from Query designer.
    Click on 'Query properties' in tool bar.
    You can see the variables under 'sequence of variables' window.There you can change the Sequence of variables also.
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a569ae09411d2acb90000e829fbfe/content.htm

  • What is the sharable SQL except  bind varables and shared cursors?

    What is sharable SQL except bind varables and shared cursors?
    Specification: The value of CURSOR_SHARING parameter must be EXACT

    You haven't given much of the elaboration but whatever you have given, based on that shareable sql is that one which won't change. So if you have ran select * from emp for the first time and than would run it again, for you its a shareable sql.
    HTH
    Aman....

  • Af:query with bind variables and Saved Search

    I have a VO and view criteria(VC).
    VC has a criteria item ObsoleteDate with range specified as bindVariables "dateFrm" and "dateTo" I dragged & dropped the named criteria as af:Query with table. Table toolbar has 2 buttons in which I set & clear the bind variables. Data is fetched as per as expected based on the VC & bind variables.
    The problem is,
    If I save my search with bind variables set and swap between the saved searches , all works fine. But the moment I clear bind variables & swap between searches.. "dateFrm" is populated and "dateTo" is null and I get an Exception oracle.jbo.AttrValException: JBO-27035: Attribute Obsolete Date: is required.
    Why is this happening?? Saved search is supposed to save the VC with all the bind values set while saving and clearing bind variables shouldn't affect the saved search, right?? Or I have understood it wrong?
    I am using JDeveloper 11.1.2.3.0
    Thanks

    Try
    like ? || '%'

  • Query With Bind Variables and %

    Hi,
    Quick question. I am using ADF BC on Jdev 11 with a MySQL Database.
    I've used Bind Variables in the past (I have to use a Question Mark [?]) and have had no problem.
    Now I want to do something like this in my where clause:
    SELECT TempTable.ABC FROM TempTable
    WHERE ABC LIKE ?%
    When I try and create the View Object with that query it is complaining about the %.
    Am I required to append the % in my bind variable? Any examples I have seen of this, people are doing something like :p_id = 'Jo%'

    Try
    like ? || '%'

  • Query regarding bind variables and LOVs

    HI,
    I am new to ADF.Last day I learnt about LOVS,View Criteria and bind variables.Now, I was trying to develop a sample application.I created some EOs,VOs and an AM.
    I also defined a view criteria which takes a bind variable as parameter and resolves the condition at runtime.Then I created a query panel based on my view criteria.In that Query Panel,when I enter a student's name in an input box(which is bound to the bind variable I guess), the info about the student is displayed in a table.Now, instead of an input box, I want a choice list based on a model driven LOV which will contain all the student names available.Is it possible in ADF 11g?
    Thanks in advance

    You need to open the VO , you are using , go to the Overview section and in overview section go to the Attributes section.
    In attributes section select the attribute by which you are searching or doing your operation, click the add button of List of values: Attribute name
    Select the vo object to populate the value.
    You will get the data in bind variable you have created in view criteria.
    For detailed reference you can follow the bolg
    http://saumoinak.blogspot.com/2011/02/showing-data-based-on-list-of-values.html

  • How to pass a bind variable from one SQL Report to Another

    Hello~
    I've created a link on one SQL Report page (Page 1). I would like a value from Page 1 used in the SQL on Page 2 to determine the result set. The Where Clause in SQL Query containing the bind variable is as follows:
    AND hp.party_name     = ':District_Account'
    When I run Page 1 and click on the link to execute Page 2, I get 'No Data Found'. The setup of the link is as follows:
    Column_Name = District_Account
    Link Text = #District_Account#
    Target = Page in this application
    Page = 2
    I'm a rookie working in V1.6...any help would be greatly appreciated!
    Thanks,
    Becky

    I don't see any parameter being passed in that URL. A little sample: http://htmldb.oracle.com/pls/otn/f?p=33203:4<br>
    when you click on the edit link the URL looks like this:<br>http://htmldb.oracle.com/pls/otn/f?p=33203:5:16073998852455071705::NO:5:P5_TABLE_NAME,P5_OWNER:PRESIDENTS_THEMES%2CBLUETEST<br><br>
    where P5_TABLE_NAME and P5_OWNER are the items and PRESIDENTS_THEMES and CBLUETEST are the values.<br><br>
    The SQL on the filtered report looks like:<br>
    SELECT *
    FROM all_tab_cols
    WHERE table_name = :P5_TABLE_NAME
      AND owner = :P5_OWNER<BR><BR>

  • 3.0 Shared Component - Report Format - all PDF

    Greetings,
    Details
    I have been working with the REPORTS - REPORT QUERIES section of APEX 3.0
    The testing I have been doing is very simple, but I am running into a bit of a stumper.
    I have created 4 report queries on the EMP table (SELECT * FROM EMP) that all use the same REPORT LAYOUT. The RTF file which is the template is a very simple - show all columns and rows for the EMP table (14 rows).
    I have set each of the 4 report layouts to a different format.
    1 - PDF
    1 - EXCEL
    1 - WORD
    1 - HTML
    I am NOT using the ITEM to dynamically set the format.
    I can TEST each of the reports in the shared component area, and they test OK with a success rate of 75%.
    The EXCEL format does not export correctly. (using Excel 2002 on the client) It is a bit of a mess. (Works in the XML publisher template builder on the client.. so the format is not the issue.)
    More curious is the behavior when I put this application. I have created a LIST of the 4 report formats. All 4 return the PDF format when used.
    To see the Application:
    http://apex.oracle.com/pls/otn/f?p=34096
    Question Summary:
    1 - Has anyone run with and tested the RTF style report layouts out to Excel?
    2 - The approach described usees 4 report queries against 1 layout. Is this a VALID use of the report functionality?
    3 - Why would all the reports try to use PDF when they test in the correct formats?
    Best Regards and Thank You.
    -- Tim

    Tim,
    The Excel output is not strictly XLS, it's actually HTML formatted in a way that Excel understands and through setting the MIME-types we make it open in Excel. I have to try reproducing your specific problem with Excel 2002. If you could send me your RTF layout and the end-result ([email protected]), I can take a look.
    Your approach using 4 different queries with the same layout is perfectly fine. Ideally of course, you would not have to replicate them same query four times, so we are considering a shared query concept for future version of Application Express.
    You specific problem with the output format being PDF at runtime appears to be a bug, I'll investigate further. Meanwhile one work-around would be to use a report region instead. If you're using the same SQL query as the source, you can associate the same report layout (on the report print attributes page). You could also create a "container" page for that report region, that's never actually called by the end user, and then have a button pointing to the URL below for printing. It would then work just like your report queries, only that you now would get the requested format:
    f?p=&APP_ID.:[REPORT PAGE ID]:&SESSION.:FLOW_XMLP_OUTPUT_R[REPORT REGION ID]
    so if your app ID is 34096 and your "container" page e.g. 99, and on page 99 your report region ID would be 1234567890, then use this URL as the button target:
    f?p=&APP_ID.:99:&SESSION.:FLOW_XMLP_OUTPUT_R1234567890
    Hope this helps,
    Marc

  • Stuck with showDetails, View Bind Variable and I18N

    Hi all,
    I have a very weird situation.
    I am creating a view object with a bind variable.
    I then create a JSF page, and drag a table based on the view to the screen.
    I now drag the "ExecuteWithParam" action to the screen, and create it as a parameterized form.
    This works fine - english or hebrew (in my case).
    I know surround the parameter form with a showDetails component.
    I enter values to the parameter, and click on the hide link. I click on the show link - all I get is a list of ? marks for hebrew characters, but the correct characters for english characters.
    Everything works fine if the showDetails component contains regular input texts, or input texts that show/edit values from the view objects (but not bind variables).
    If I put the bind variable on the screen (outside the showDetails), in addition to putting the form inside the showDetails component, then the following occurs:
    1. Changes in the param form are ignored if I click on the show/hide link.
    2. Hebrew works when I edit the input text that is outside the showDetails. This updates the value in the show details, and it displays hebrew correctly.
    Very odd. Any tips?

    First of all i would like to thank you for replying to my thread.
    Secondly, i would like to inform you that the example that i have provided is just for REPRODUCTION purposes.
    The real scenario has to do with setting the where clause with the authenticated user so that the view will query for data only associated with the authenticated user.
    The only way to overcome this behaviour is to include a view action (namedWhereClause in the page definition)
    However, this is not how i want to implement this. This was working properly in 10g

  • Using Bind Variables in Parameter Form's Query

    I want to use bind variables in the query of Parameter form. But
    it does not allows. What is the other way out. The structure of
    my Parameter form is as under:
    State:
    Customer:
    Now I want that I want to list only those customer in the
    Customer LOV which belongs to the selected state.
    Thanks.
    Muhammad Nadeem

    Can we just link to an oracle form using a url still as we can with reports? I've built a report that requires the user to select from a dynamic list as well, and I know how to do this through forms, but can I simply call the form from a webpage?

Maybe you are looking for