Report based on query w / input variable

Hello

How can I do a report on APEX sql with a variable input (: P1).

In my tests, I created a sql report then added a text box to the page with the name (P1).

When I run the report it gives me the text box, and then I insert the value, press enter and it gives me the result no data found. If I activate the debug I can see: P1 = P1 = "xpto", then the text box works very well, but why the report is not generated or display?

Thank you in advance

Ricky:

The code is no more than what I posted in my previous post.

CITY

Tags: Database

Similar Questions

  • Conditional display of interactive report based on the different SQL query

    Hello

    I have two drop-down list at the top of my page and below I have an interactive report.
    Based on the selection of the user from the drop-down list values, interactive report should change based on different SQL queries.

    Is it possible to have different SQL queries based on the drop-down list values and generate interactive report based on that?

    Thank you

    Hello

    You can't have IR based on function returning the query as you can have classic report

    But here is a workaround
    http://www.oracleapplicationexpress.com/tutorials/71

    Kind regards
    Jari

  • Report based on the result of the sorting function?

    Dear all,

    I will make this issue in general terms:

    We have a report based on a query that reads data from a single table (P). It will take to provide a field more (X) in the report which is obtained using more than two tables (E, 1 m approx).

    I wrote a function that produces this extra field based on a join of tables E and P1. Please note that this function depends on the report query variables. This output is correct and provides all the necessary information, but it is necessary to sort the report based on the result of this function, i.e. the value of field X.

    Is this possible?

    I appreciate your comments.

    Note: I've tried incorporating pictures E, P1 in the request report (I can then sort on the required field) but gets reduced the number of lines in the report. This is because the join between the tables, P, E and P1 reduces the number of lines (which is not the correct result).

    Yes, it is possible. If you have ended up above a formula column.

    Create the formula column. For example, CF_SALARY_TOTAL. Place a level to the top of the query and set your desired sort (Asc/Desc)

    Hope this helps

    Hamid

    Move or

  • Generate reports based on two conditions

    Dear all,
    I generate reports based on satisfactory conditions in two columns in a table.

    For example.
    I have a table test1 with columns A, B, C, D, E
    Now, I want to create reports based on the research of two columns A and b. What is the preferred method to do?

    Thanks in advance.

    What is the preferred method to do?

    Write the appropriate query:

    select a,b,c,d,e
    from test1
    where a = 
    and b = 
    

    In reports, the State may be a user input parameter:

    select a,b,c,d,e
    from test1
    where a = :parameter1
    and b = :parameter2
    
  • Input variables

    Hi guys, I'm new to Teststand and I'm learning.

    Well, I made a request a step like that fixed.

    I'm a little confused on how to set the input variables. I want that taststand ask me to.

    Another question is how I can see my test result in the final report? I want to see the result of the sum and the product. Can you help me?

    Thank you

    Look at the changes I made to your VI and sequence.  -What are you trying to achieve?

  • Updated interactive report based on shuttle Page

    I am trying to create an interactive report based on the selected items in a shuttle service.  On the page there is a page entitled P2_ITEMS element which is a shuttle service.  It displays a list of items for the user to choose and returns the item_id, the primary key of the main table.  I then an interactive report on the same page that displays data for the item_ids selected in the shuttle.  I use the sql query below in my interactive report, but nothing shows up in my report.  How can I get the interactive report to be updated when items are selected in the shuttle?

    Select

    a.date_loaded,

    b.item_type,

    c.Item,

    a.info

    point a, item_type_lookup b, item_name_lookup c,.

    where instr (': ' |: P251_ITEMS |': ',' :'|| a.item_id |': ') > 0

    and a.item_type_id = b.item_type_id

    and a.item_name_id = c.item_name_id;

    Hello

    Please, install application example sample Dynamic Actions. There are exactly what you are looking for (side Server-online shuttle refresh).

    Kind regards

    Pavel

  • interactive report based on an existing table

    Many people, it is the next step in the construction of my app.  I watched a tutorial of utube produced from a worksheet a table in a database and a set of pages to enter data and to display and edit data in the table.  I already have the table and I would like to make the pages I've seen.  a spreadsheet as a table which allows the edition of each row and a button create on top.  I guess I was also able to delete a line if necessary. I think I need to creata a page, select report and interactive report.  Continues in this way, I get a request for a sql statement that will likely tell the page generator that he needs to create the report.  I need to make the report based on a table in another table space.  At this page, I entered in the query designer and my table space is not listed, only the current APEX of table space is available.  I went in a different direction to create a form for a table and to the bottom of the sequence, he also requested information in the table.  My table db space is listed as available and I am able to create the registration in a satisfactory manner.

    Then, why I can see and interact with my db table space when you create a form for a table but can not find the db table space when you generate an interactive report?

    Also, I'm heading down the correct path for the interactive report, that I need?

    "HustlingHare" alright, get ready to be the hero.  "" "You're almost there. '"

    (1) Firstly, nuke has report page IR that you just created.  You don't need it.

    (2) then go back and run the wizard to create a Page.  Choose 'Form', then 'form on a Table with the report '.  Because your DBUSER1 has privileges discrete objects on the table in the schema DBUSER2, DBUSER2 must appear in the select list of "Table / view owner" in this wizard.

    Follow the steps in the wizard to create the interactive report and form, and you're done!

    Joel

  • CANNOT CREATE A REPORT WITH A QUERY PAGE

    Hello everyone,

    I have this query with a self-join:

    \

    Select flight_id, f.pilot_id, last_name, f.pla_id, pla_desc, city_dep, d.city_name, city_arr, a.city_name, dep_time, arr_time

    pilots of flight f, p, pl, city, city of the plane a

    where f.pilot_id = p.pilot_id

    and f.pla_id = pl.pla_id

    and city_dep = d.city_id

    and city_arr = a.city_id

    order of flight_id;

    \

    I've created a classic report based on a table, first of all, then I'm trying to modify the SQL query to the above and I get this error:

    Error in saving of the column's settings.

    ORA-20001: your query contains alias duplicate names, the queries used for reports require unique alias names.


    What I am doing wrong? How can I build a rapport with a form based on a request like this?


    Thank you!

    The column Francisco appears twice - you'll need to use aliases for columns, for example:

    d.city_name as dep_name

    a.city_name as arr_name

  • Interactive report based on a Collection

    Hi guys

    Using Apex 3.2

    I have a classic report based on a collection, which works very well.
    I am now trying to create an interactive report based on the same query (collection), but no data is returned.
    I there something special I need to do an interactive report.

    See you soon


    Gus

    Hello Gus,

    First time when you create a report based on the collection ir, it does not include the columns in the display (don't know why)

    pls select the correct answer to help others

    Thank you

  • Refresh the report based on the select list item

    Hello world

    Someone has the answer to refresh a report based on an element that I select in a select list? I currently have the item in the list of selection and a report under him I wrote a sql that fills with data. If I choose an article in my select list, I want to change the data in my report. What I have to write separate sqls for each item to be fired or write some type of process. Can someone help me?

    Thank you
    Ryan

    Write directly in the SQL report. Your select list item will be the variable in the SQL.

  • report based on elements are mutually exclusive:

    Hi guys,.
    I am creating a parameterized report based on elements are mutually exclusive:

    I have a list select 'P1_Property_type' element that has these values (office, apartment)
    If you choose "desktop" then the report should ONLY the value of the selection list element 'P1_beds '.
    If you choose 'apartment' then the report should be considered AS the value of the selection list "P1_size."
    ----------
    I used this query, but it does not seem to contribute:
    Select * from realestate where
    unit_type = decode (: P1_PROPERTY_TYPE, 'null', unit_type,: P1_property_type)
    and
    (br = decode (: P1_beds, "null", br,: P1_beds) or size = decode (: P1_size, 'null', size,: P1_size))
    ----------------
    I hope my question is clear

    Kind regards
    Fateh

    Assuming you are using the literal string "null" instead of NULL.

    "it doesn't seem to work" because of this:

    (br = decode (: P1_beds, "null", br,: P1_beds) or size = decode (: P1_size, 'null', size,: P1_size))

    Assuming you choose 'office' and: has the value p1_beds and: p1_size is "null", you end up with a statement that is the equivalent of:

    select * from realesate
    where unit_type = 'office'
    and (br = :p1_beds
    or size=size)    <--------------problem
    

    and your: p1_beds restriction is so inefficient.

    I'm not a fan of decode for this logic.
    I prefer a clear statement of the exclusive predicates that the optimizer can sometimes deal more effectively.

    for example, assuming that it is irrelevant, if you choose office or apartment because the relevant parameter: p1_beds or: p1_size will have the appropriate value:

    select * from realestate
    where
          (:p1.property_type is null / = 'null'
    or    (:p1.property_type is not null / != 'null'
    and    unit_type          = :p1_property_type))
    and   (:p1_beds          is null / = 'null'
    or    (:p1_beds          is not null / != 'null'
    and    br                 = :p1_beds))
    and   (:p1_size          is null / = 'null'
    or    (:p1_size          is not null / != 'null'
    and    size               = :p1_size))
    

    Note that I have provided alternatives depending on whether you are actually the NULL or a magic string.

  • How to create a report based on the selection of a node of a tree

    Hello

    I am new to Oracle Apex and tried to build a tree and also an interactive report based on column empno from emp table.

    I created a tree based on the emp table. Now, I want to see the records in the employee selected in the tree.

    This is the query of the tree:

    Select case when connect_by_isleaf = 1 then 0
    When level = 1 then 1
    of another-1
    end the status,
    level,
    'ENAME' as the title,
    NULL as an icon,
    'EMPNO' as value,
    NULL as ToolTip,
    NULL as link
    of ' #OWNER # '. " EMP.
    Start by "MGR" is nothing
    connect prior "EMPNO" = "MGR".
    siblings arrested by 'ENAME '.

    Can someone tell me step by step how to go from here?

    I tried to follow the thread Re: question of tree but could not understand a lot of it.

    The approach to reload the page and display the report is fairly simple.

  • You start by creating a new page element that will be used to store the selected node ID, for example. P100_SELECTED_NODE (you can do atext element and change hidden once everything works as expected)
  • Change the query of the tree and the link column in the SQL of tree definition to a link to the same
    for example if your page is 100, you'd do the tree node a link to the same page but the value of the P100SELECTED_NODE with id_ of the node selected
    This is done here
    {message: id = 4410987}
    In this case, it would be

    ' f ? p = & APP_ID.: 100 :'|| : APP_SESSION |': P100_SELECTED_NODE :'|| EMPNO as link

    Now when you click on a link to tree node, it would be back to the same page, but set the P100_SELECTED_NODE with the empno of the clicked node.

  • All that's left to do, change your report so that it refers to the new point inorder to filter records for this employee empno i.e

    SELECT ...
      ..
    WHERE empno= :P100_SELECTED_NODE
    
  • defining the results of a query to a variable

    Hi all

    I'm having a problem affecting the results of a query to a variable. What I'm trying to do, is to do an AJAX call to a .cfc file and pass back the results of the function. The main problem is, I'm again moving a block of HTML (resulting from a cfquery in a cfoutput) stored in a variable. My code is something like...

    < name cffunction = "getText" access = "remote" returntype = 'Cancel' >

    < datasource = "" #request.dsn # cfquery "name ="queryTable">"
    SELECT kort, infoB

    Of infoTable

    < / cfquery >


    < cfset result = ' <!-this is the part I'm stuck, I want the table go here. -> ">"

    < table >
    < cfoutput query = "tablequery" >
    < b >
    < td > #infoA # < table > < td > #infoB # < table >
    < /tr >
    < / cfoutput >
    < /table >


    < cfwddx action = "cfml2js" input = "" # result # ' toplevelvariable 'o' = > "

    < / cffunction >

    It is a simplified version of what I want to do, but you get the idea...

    Is it still the right way to go about this?  Thank you

    That's what I get for trying the E-mail response feature!  Are you not happy, that I double checked my post.

    You could do a lot of string concatenation here to do stuff like"& Kort &""& infoB &""> time and time again."  But in reality the tags is so much easier to use.



      

        
      

    #infoA #.#infoB #.

  • Report with the query with union and parameters

    Hello

    We have an obligation to create a report with the request, which is the union and parameters.

    I intend to create a database for the report based on a query. But the problem here is that the way to pass parameters in the query.

    Request is something like that

    Select x.a, x.b, x.c
    x
    where x.year =: para1
    and x.status = 'A '.
    Union of all the
    Select x.a, x.b, x.c
    x
    where x.year =: para1 - 1
    and (x.status = 'c' and x.date =: para2 or x.status = 'I' and x.date < =: para2)

    Here x.year in the first select statement must be equal to: para1 and second select statement, it should be: para - 1.

    How this requirement can be achieved?

    Client don't want to separate worksheet, a parameter and another for the actual data that I tried with sys_context and it worked. But the client wants the result in a single sheet only... So I need to change their approach.

    Help, please.

    Thank you

    Hello
    Another option is to convert the request so that you will have the items from the selection
    for example on the query you provided that you can use:

    Select 'Curr' rec_type, x.a, x.b, x.c, x.year, x.date, x.status
    x
    where x.status = "A".
    Union of all the
    Select 'Prev' rec_type, x.a, x.b, x.c, x.year, x.date, x.status
    x
    where x.status in ('c', 'I')

    then, in the workbook, you will be able to create conditions such as:
    rec_type = 'Curr' and year =: para1

    rec_type = 'Prev' and year =: para1-1
    rec_type = 'Prev' and (status = 'c' and date =: para2 or status = 'I' and date)<=>

    Tamir

  • Produce reports based on dynamic queries

    Hi all
    I have a basic question that I found no answer after a search through topics BI.
    I want to produce our reports based on dynamic queries, so that the final query could be transferred by application of the ADF. Is there an idea tho this? Use other tools to integrate with BI Publisher?

    Thank you for your attention,
    Nasser

    Using Datatemplate, we can do it very dynamic reports.

    I worked on usign dynamic reports very very complex, these

Maybe you are looking for