Dynamic report with LOV SelectLists

I like to create a dynamic report with Select-Lists(LOV based).

My Source (according to PL/SQL returning SQL query) region:
declare
  q varchar2(4000);
begin
 
  q := 'SELECT R_ID, R_TSO_NO';

  For i in (SELECT * FROM USER_TAB_COLUMNS
  WHERE table_name = 'TAB_REPORTS'
  AND column_name like '2%')
  loop
    q := q || ', ';
    q := q || 'HTMLDB_ITEM.SELECT_LIST(1, ';
    q := q || i.column_name;
    q := q || ', ';
    q := q || chr(39);
    q := q || 'LOV_QER';
    q := q || chr(39);
    q := q || ', null, ';
    q := q || chr(39);
    q := q || 'Y';
    q := q || chr(39);
    q := q || ') "';
    q := q || i.column_name;
    q := q || '"';
  end loop;
   
  q := q || ' FROM TAB_REPORTS ';

  return q;

END;
This is the return value, which seems to be OK:
SELECT R_ID, 
R_TSO_NO, 
HTMLDB_ITEM.SELECT_LIST(1, 2008_05, 'LOV_QER', null, 'Y') "2008_05", 
HTMLDB_ITEM.SELECT_LIST(1, 2008_03, 'LOV_QER', null, 'Y') "2008_03", 
HTMLDB_ITEM.SELECT_LIST(1, 2008_08, 'LOV_QER', null, 'Y') "2008_08", 
HTMLDB_ITEM.SELECT_LIST(1, 2008_11, 'LOV_QER', null, 'Y') "2008_11", 
HTMLDB_ITEM.SELECT_LIST(1, 2009_02, 'LOV_QER', null, 'Y') "2009_02", 
HTMLDB_ITEM.SELECT_LIST(1, 2009_05, 'LOV_QER', null, 'Y') "2009_05", 
HTMLDB_ITEM.SELECT_LIST(1, 2009_08, 'LOV_QER', null, 'Y') "2009_08", 
HTMLDB_ITEM.SELECT_LIST(1, 2009_11, 'LOV_QER', null, 'Y') "2009_11", 
HTMLDB_ITEM.SELECT_LIST(1, 2010_02, 'LOV_QER', null, 'Y') "2010_02", 
HTMLDB_ITEM.SELECT_LIST(1, 2010_05, 'LOV_QER', null, 'Y') "2010_05", 
HTMLDB_ITEM.SELECT_LIST(1, 2010_08, 'LOV_QER', null, 'Y') "2010_08", 
HTMLDB_ITEM.SELECT_LIST(1, 2010_11, 'LOV_QER', null, 'Y') "2010_11" 
FROM TAB_REPORTS
And this is my error msg, I do not understand:

* Failed to parse the SQL query:
ORA-00911: invalid character *.

Where is this invalid character, please?

THX 4 help,
Chris

Hello

As part of HTMLDB_ITEM. This is a parameter of function - it should be a tank. In addition, if you use a recent version of the APEX, you should use the synonym APEX_ITEM reference HTMLDB_ITEM.

Here is the statement of HTMLDB_ITEM parameter. SELECT_LIST...

    p_idx         in number,
    p_value       in varchar2 default null,
    p_list_values in varchar2 default null,
    p_attributes  in varchar2 default null,
    p_show_null   in varchar2 default 'NO',
    p_null_value  in varchar2 default '%null%',
    p_null_text   in varchar2 default '%',
    p_item_id     in varchar2 default null,
    p_item_label  in varchar2 default null,
    p_show_extra  in varchar2 default 'YES'

You will see that it is a VARCHAR2 parameter.

See you soon

Ben

Tags: Database

Similar Questions

  • Use the dynamic report with BI Publisher parameters

    Are there tips for reports in BI Publisher? For example, I would use the same report for one person or many people. This would mean that where clause should be added when it is for the individual and is not necessary for the entire population. I don't see a way to dynamically build the report using "Report queries" in the shared components.
    It is easy to build a sql query based on various selection criteria in the Source to a pagethat of the region then gets displayedd on the page but I don't see a lot of flexibility in creating a report with BI Publisher at the Apex.

    How about from the collections?

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • Forming a dynamic report with the value of an element query

    Hi gurus,

    We wanted to create a report based on the value of an element in the page.

    For example

    There is a text box named p1_table according to the value of this element that should alter the query from the report

    (1) when p1_table = emp query report should be select * from EMP
    (2) when p1_table = dept query report should be select * from dept

    I tried to do this using

    Select * from: p1_table and select * from v('p1_table'), it does not work.

    Kindly help me in the fulfilment of the condition.

    Thank you and best regards,
    Vikas Krishna

    Hi Vikas,

    You should do this as a report based on a function that returns the query string. You generate the string dynamically in function.

    Concerning
    André

  • change the results of the report with the selection list using dynamic action

    This is one of those situations where if I could understand the appropriate search terms to use, someone else must have asked this question in the past.

    I have a report with a SQL query with a condition based on a list of selection on the same page. So I have a list of selection -: P177_FISCAL_YEAR

    My request for my report is:

    Select md_id, display_name, description
    of media_tbl
    where fiscal_year =: P177_FISCAL_YEAR

    When a person makes a selection on the selection list (: P177_FISCAL_YEAR), I would like to report up-to-date without having to submit the page. I was hoping that I could do something like this using a dynamic action but have not found a way to do it.

    Thanks in advance!

    John

    Create dynamic Action:

    When
    Event: change
    Selection type: product (s)
    Article (s): P177_FISCAL_YEAR
    Condition: - unconditionally.

    Real Actions (add 2 real actions)
    -the first is to load the value in session state so that the report can see.
    Sequence: 5
    Action: execute the PL/SQL Code
    Code PL/SQL: null;
    Items to submit page: P177_FISCAL_YEAR

    -the second to refresh the report
    Sequence: 10
    Action: Discount
    Selection type: region
    Region:

  • Dynamic report query table based on selected LOV

    Hello

    Need some suggestions and Tips how to query dynamically table via lov to report.

    Scenario:

    Table, TABLE_LIST, a tablename (table in DB) and filter (for where clause) column. The TABLENAME_LOVE is derived from the table TABLE_LIST.
    D SELECT TABLENAME TABLENAME TABLE_LIST R


    On Page 2, a select list item, page P2_TABLENAME use TABLENAME_LOV
    All data tables in the table_list has an identical structure (columns, triggers, primary key and so on).

    I want to have the query area of the report of the table based on selected LOV.

    Example,

    TableName Filter
    WBR
    CD2 ACTIVE = 'Y '.

    When select TB1, regin report ask TB1 on the base.
    When select CD2, will interview the report based on CD2 regin WHERE ACTIVE = 'Y '.


    Question:
    How can I query function & P2_TABLENAME. WHERE & P2_FILTER.
    As
    Select col1, col2 from P2_TABLENAME WHERE & P2FILTER

    Appreciate any suggestions and tips.

    Tigerwapa

    Hello
    You should always put your version of the Apex, version of DB and such other information as suggested in the FAQ.
    And now wherever you are referring to report, you need to answer if it's IR or classic.

    Regarding your query, have you explored the kind of statement "SQL Query (body of function from PL/SQL returning SQL query)"?
    This could be a good target for what you're trying to reach.

    Kind regards

  • Dynamic links in a report with confirmation popup and plsql appeal

    Hi all

    I have a table T1 with name, city, State.

    I create a report in a region of html with a request to get the name and the city and for each record with status = '5', a link with the label of 'Delete'.

    To generate the link I need to use a case so the link will be present only for some records (status = '5').

    I want to use a dynamic action with 'Confirm' to display a confirmation pop up, then a "Code of PL/SQL Execute" to delete the record with a simple delete the order.

    My question: How can I write the link in the instruction box to call dynamic action in my form?

    Thank you
    Massimo

    That you can use in your report:

    case when table_name.status = 5 then
    ''
                      || 'Remove'
                      || ''
    end col_name,
    

    This is the javascript function:

    function delete_val(v_id){
     var temp;
     document.getElementById('P51_ID').value = v_id;
     temp = confirm('Are you sure you want to delete?');
     if(temp == true){
       doSubmit('delete');
     }
    
    }
    

    You can see the javascript on doSubmit() function I am generating an application that you use to condition your through the process.

    Thank you
    Tauceef

    Published by: Tauceef on January 17, 2012 17:13

  • Dynamic action with refreshment area interactive report

    Hello!

    I use APEX 4.02

    I have a page with 2 regions.
    Region1 is a form (of entry)
    Region.2 is an interactive report on the same table as region 1

    When you enter values in the form I'm trying dynmically similar research records in the table with the interactive report.

    I made a dynamic action on the change of form fields that must refresh the interactive report region. I can see this one fires if I add an alert to debug if it fires.
    The dynamic report is based on a query with bind variable pointing to the fields in the form, for example
    where
    Field1 =: P2_FIELD1


    It works fine on the page loading, so no action is triggered, but I see the lines in the region of report are the ones I'm looking for.
    The updating of the report area does not work, but it is never nice and/or showing the correct data after a change of form fields, if it looks like the dynamic action "refresh the region" does not work on the interactive report.

    Any ideas why it can go wrong?
    I want to solve this problem using standard dynamic actions and preferably not via PL/SQL or JS, should be possible if I believe documentation... ;)

    See you soon
    Bottom

    Published by: bklerk on 26-apr-2011 03:07

    Hello

    Check this example application
    http://Apex.Oracle.com/pls/OTN/f?p=39830:38

    You can download and check the source

    Kind regards
    Jari

  • Interactive report with display of the icon to set the page element

    Hi all

    I am currently using Apex 4.2.4, I have an interactive report using icons, each icon has a link to another page but a few I want to set a value in a page hidden in the same page element which is then used as a variable for a classic report.

    I have this work via link href in the icon as f? p ='|| FA.page |': 1 :'|| : app_session |': P10_ID_ITEM :'|| FA.link_name without error.

    My problem is that I wanted to put the value of the element without using a link href that I could handle the clicked icon to change the background color so that the user can have a Visual representation, where it was clicked, then using the value of the page item appears the classic report in another region with a partial refresh.

    Any help is appreciated, thanks.

    Can you provide a detailed explanation of the purpose of this report and the logic used in the report query? What are the rules to control which icons appear in the IR, what icons link to the second report on the page of IR, and icons to link to separate pages?

    For me, the report query seems too complicated and inefficient by returning the data it does, and if another level of data is added to the hierarchy or more data is added to the second level, it fails with:

    ORA-01427: einreihig subquery returns multiple rows

    I'm guessing that the intent is that the IR displays only the icons at the top level of the hierarchy and icons for posting a link to a different page when they have no descendants, or to display the related lines in the secondary report below the IR when they do. I created a new page with the report query modified to a route of tree and keep the upper level lines. It is much more effective than the original query and simplifies the logic necessary for the verification of end-nodes. Instead of generating a URL link (which violates the separation of concerns), the query returns of the discrete values that can be used to implement the HTML link in the Icon View link Custom property:

    with icon_tree as (
          select
              ic.id_icon
            , ic.icon_name
            , ic.link_name
            , nullif(connect_by_isleaf, 1) is_parent
            , level depth
          from
              icons ic
                connect by
                    prior ic.link_name = ic.id_parent
                start with
                    ic.id_parent is null)
    select
        id_icon
      , icon_name
      , link_name
      , apex_util.get_blob_file_src('P10_ICON_IMAGE', id_icon) img_src
      , nvl2(is_parent, '586', link_name) target
      , nvl2(is_parent, 'P586_ID_PARENT', null) parent_item
      , nvl2(is_parent, link_name, null) parent_id
      , :app_id app_id
      , :app_session app_session
      , :debug debug
    from
        icon_tree
    where
        depth = 1
    

    In the interactive report, Use Custom Icon Link is set to Yes, and the custom link is:

    
      
      
    #ICON_NAME#

    Public static ID icons and results are applied to the IR and the regions second report respectively for use as selectors in action dynamics and CSS. The protected value property for the page P586_ID_PARENT element must be set to No for the value can be defined by a dynamic action.

    Dynamic action with several real actions is needed to bind alternatives click behavior to the links on the icons that have descendants (i.e. where the data-parent-id attribute has a value):

    Event: Click

    Selection type: jQuery Selector

    jQuery Selector:.apexir_WORKSHEET_ICONS a:not([data-parent-id=""])

    Real Actions

    Seq: 10

    Action: Delete the class

    Class:selected

    Selection type: jQuery Selector

    jQuery Selector:.apexir_WORKSHEET_ICONS a

    Seq: 20

    Action: Add the class

    Class:selected

    Selection type: trigger element

    Seq: 30

    Action: Set value

    Wait for result: Yes

    Type of value: Expression of JavaScript

    JavaScript expression:$(this.triggeringElement).attr('data-parent-id')

    Selection type: Agenda

    Point: P586_ID_PARENT

    Seq: 40

    Action: Discount

    Selection type: Region

    Region: results

    Seq:50

    Action: Show

    Selection type: Region

    Region: results

    Seq: 60

    Action: Cancel event

    Finally, add a style sheet to the Inline CSS property page. Initially, this hides the secondary report and select the parent clicked icon:

    #results {
      display: none;
    }
    #icons .apexir_WORKSHEET_ICONS a {
      border: 1px solid transparent;
      border-radius: 3px;
      padding: 0.8em 0 0.5em;
    }
      #icons .apexir_WORKSHEET_ICONS a.selected {
        border-color: #6a9cda;
        background-color: #bbd1ec;
        transition: 0.6s;
      }
    

    However, after all it is the question of why you use an interactive report here if you turned off all the features of the IR? A dynamic list with a custom template box seems to be more applicable?

  • Select the list with the list of dynamic values with more than 4000 tank of query

    Hello

    I have no application where users can store SQL queries in a CLOB column. This query is then used to populate the list, select a dynamic element through LOV. Following the code returns the query for dynamic LOV used to populate the select list. It works fine except when the length of the lv_sqlStatement becomes more than 4000 characters. Then application crashes with "ORA-06502: PL/SQL: digital or value error: character string buffer too small" when Select the list item rendering.

    Any ideas how to get around this problem? Any help is appreciated. Do not say to them to write shorter than 4000 queries because I can't (it's operational requirements).

    DECLARE
    lv_sqlStatement end_user_set.sql_statement%type;
    BEGIN
    lv_sqlStatement: =: P2_SQL_STATEMENT;
    return ' select the label, value of (' | lv_sql_statement | t ')
    To_char (t.value) if not in (select value from end_user_set_member eusm)
    where eusm. EUSRSET_ID = ' | : P2_EUSRSET_ID | ')';
    END;

    I just blogged about this problem and posted a solution. See this announcement:

    http://www.deneskubicek.blogspot.de/2013/03/select-list-with-dynamic-lov-and-Ora.html

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • dynamic action and LOVs

    Hello

    I'm having some trouble with the values defined in LOVs areas. I created a free workspace in Oracle APEX.

    I created a form with two fields of LOVs, EMP and DEPT, after that I created a dynamic action to set the value on the LOV Dept field. Then always when a new EMP is selected, the LOV Dept field must define the departament of the chosen MAP.

    Dynamic action has not worked with LOVs fields, always when I changed the field EMP LOV LOV DEPT field is canceled, but when I changed the DEPT LOV to SELECT LIST field, it's good work.

    dynamic action properties:

    event: change; *
    Select type: points; *
    point: EMP_LOV*.
    Condition: no condition; *
    Action: value; +
    setType: Sql statement+.
    Sql statement:+.

    Select DEPTNO+.
    from EMP+.
    where EMP. EMPNO =: EMP_LOV+.

    Assigned items: DEPT_LOV+.

    Brgds,
    André.

    Edited by: 969316 11/03/2012 07:36

    Edited by: 969316 11/03/2012 07:36

    Try sth like this:

    First create a hidden item, let's call it P1_DEPTHIDDEN then

    Create dynamic action:

        Event: Change
        Selection Type: Item
        Item: P1_EMPLOYEE
    

    Now for the first real action follow these steps:

        Action: Execute PL/SQL Code
    
        BEGIN
    
            SELECT DEPTNO INTO :P1_DEPARTMENT FROM EMP WHERE EMPNO = :P1_EMPLOYEE;
    
        END;
    
        Page Items to Submit: P1_EMPLOYEE
        Page Items to Return: P1_DEPARTMENT_HIDDEN -- This is return value, the value you will store in your database table (not the one you see on the screen)
    

    Now for the second True action follow these steps:

        Action: Execute PL/SQL Code
    
        BEGIN
    
            SELECT DNAME INTO :P1_DEPTHIDDEN FROM DEPT, EMP WHERE DEPT.DEPTNO = EMP.DEPTNO AND EMPNO = :P1_EMPLOYEE;
    
        END;
    
        Page Items to Submit: P1_EMPLOYEE
        Page Items to Return: P1_DEPTHIDDEN -- This is display value, the value you actually need to see in P1_DEPARTMENT item !
    

    Now for the third True action follow these steps:

        Action: Execute JavaScript Code
    
        $x('P1_DEPARTMENT').value = $x('P1_DEPTHIDDEN').value /* Now you set P1_DEPARTMENT value to be exactly what you need */
    

    I really hope that it works, it's probably more easy solution then this one.

    Mimi

  • Report with the items on the page

    Hi all

    I use APEX 4.0.3 and I would create a report where I could have editable page elements it contains. My goal was to have for example a variable number with its features displayed in the report and the power column choose a second from a selection list to associate with the first.

    In summary, I need to have a selection list in the report, and I need to know how to access the value of this element in each of the train.

    Thank you
    Mike

    You will need to loop.

    Find out "paintings of SEO, SEO of the values in a sequence to process" sections in the following documents.
    This should give you a fair idea.

    http://download.Oracle.com/docs/CD/E10513_01/doc/apirefs.310/e12855/apex_app.htm

    For example, if you have a report with the following query

    SELECT APEX_ITEM. Text(1,column_name) FROM myTable;

    and if you have 10 rows in the table, then 10 items of text will appear on your page.
    Given that we gave the ID (p_idx) as a 1, we can refer these elements of text using G_F01 picture. (If its 2 then G_F02 etc. we can have up to 50 dynamic element on one page)

    G_F01. COUNTY gives us "number of items".
    G_F01 (i) gives us the value of i ^ e ^ text value of the element.

    It may be useful

    Kind regards
    Hari

  • static and dynamic reports

    Hello

    I'm new to HFR. Can someone tell me what is static and dynamic statement and when we go to static and when we go for dynamic with scenarios in real time?

    Thanks in advance

    Static report is usually fixed, so that the reports do not change when the time and hierarchies are updated. For example, a static report can be useful for regulatory deposits etc. You do not want to change statutory reports according to the when they were run ;-)

    Dynamic reports has several levels:

    -Dynamics updated due to changes in current month/quarter/year;

    -Dynamic reports that automatically updated based on changes made to the hierarchy: contour moves, new members, etc.

    In an ideal world, you have to build relationships are dynamic as possible, that you do not have what to have to change them every month, quarter, year, based on the changes of the period.
    Or do you need to update when managers change their minds about what needs to be told (less maintenance and future audit)

    Building reports are dynamic as possible has some limitations, however, in this by establishing the report, it would be not as fast to run (you may have several rows/columns more) to make the reports 'dynamic '.

    HOEP this helps, Iain

  • Data model - dynamic query with parameters

    Hi friends, is it possible to dynamically call a query using the parameters of the data models?

    I try to have a BEEP report with data model something like that

    Data model
    Param1

    Q1 = Select * from table 1
    Q2 = Select * from table 2

    If Param1 = X then
    FinalQuery = Q1
    On the other
    FinalQuery = Q2
    End

    Any help is greately appreciated.

    Thank you
    SAI.

    Take a look at the following:

    http://www.Oracle.com/global/de/community/BIP/tipps/dynamische_queries/index_en.html

    http://blogs.Oracle.com/XmlPublisher/files/BIPublisher_dynamic_column%20Blog.PDF

    Thank you!

  • Refreshing a page from a link in a dynamic report column

    Hello

    I have a dynamic relationship with a column of link. I am trying to update another page with the values of the selected line. I have created a process that is called when the user clicks on the link in the column, but it does not work.
    The page called by this link is not updated. So my question is how can I refresh the values on a column of dynamic report of a page link?

    Thank you

    NP - you're welcome!

    Andy

  • ORA-01481 when we click on the report with link column.

    Request Express 3.1.0.00.32

    I have a sql on a form page report with a column that clickable allowing the end user to quickly change the values.
    I seem to have is because there is a mask of format on the column ($1234,56) I get the error
    ORA-01481: invalid number format model
    Unable to fetch row.
    Googling the error came up with "check your manual.

    Under format of date column / number, I'm using the following:
    FML999G999G999G999G990D00
    The column in the database is number (15.2)

    The only value I'm passing is the pk_id which is present in the case of the URL:
    http://...f?p=293:2:3616213833707847::NO::P2_PK_BUDGET_ID:1
    Anyone had this problem and if so found a work around?
    Thank you.

    Leland,

    The error was caused by apply you the mask of YYYY format a number field. I changed a switch of dates for a list of selection and gave you an LOV query that would give you the current year, the last 3 years and the next two years. You can adjust that, according to the needs. I also put the definition LOV to accept other values incase you had a value in the db that was not in the LOV I've defined.

Maybe you are looking for