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é

Tags: Database

Similar Questions

  • dynamic action sets the value of the element, but not save to DB on submit

    I'm working on a page where the value of several to show only the page elements are defined using a dynamic Action.  They are set when the user selects a value in a list of selection (and is based on the value of the selection list).  Dynamic action is triggered on a list selection change event and then runs the real action "set the value.  The selection list displays the names of sales representative.  The three fields dynamically filled are the org structure (that is, their chain management).

    For the action to set the value, I use a defined Type of SQL statement:

    Select VP, DIR, MGR

    of SALES_ORG where SSR =: P20_SSR

    In the affected elements, I have fixed Type of selection to the 'item (s)"and the value of the Item (s) for 'P20_GVP, P20_DIR, P20_MGR.

    Dynamic action works fine for the display of the page (that is, when I select a sales representative in the selection list dynamic action properly updated only display value fields three).  This page is a form in which the user submits information relating to the rep.  When the page is sent, all fields are filled in a new record of DB with the exception of three that were populated dynamically above.  These fields get the values NULL.

    When the dynamic action updates the values in the three fields is - it does not set the value of session?  Why these fields don't are not taken into account in the submit other ideas > process Page?

    I use 5 APEX with Chrome on Mac (Yosemite).

    Thanks for the note.  I didn't only display the items could not be used in this way.  I think I'll take a different approach with the design; given that the org structure is in another table that I can simply refer to that by rep when necessary rather than saving the information uploaded to the page of the form.  The reason why I have not fill the screen only the points of loading the page is because I don't know what the values should be until the user selects a sales representative in the selection list.

    I'll change the design to one of the following:

    1) change the display only items of standard text field.  NOTE: if I make the text read-only field that causes other problems when loading (I get the message "violation of protection Session state").

    OR

    2) do not include org structure in the download folder and just refer to table org Rep when necessary.

    Thank you!

    Steve

  • How to capture the time entry with the value 'default' as SYSDATE

    Hello

    I created "entry receipt" form by using wizard.

    Hidden CREATED_ON column is defined with the value 'default' as SYSDATE.

    However, it's only complete part of date, but time is not included when I discovered that in the report.

    Format under 'source' mask is defined as "MON-DD-YYYY HH24:MI:SS" during form entry.

    Under the column definition format mask is "HH24:MI:SS MON-DD-YYYY" under the report.

    Need help to fix this problem.

    I use APEX worm 4.2.6

    Thank you

    -Anand

    Is it viable to not include the column in the form of the APEX and have a default value to the column in the table?

    ALTER table my_table change created_on default sysdate;

  • 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

  • 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

  • A better way to treat the form as a table with the variable column type?

    I wanted to make a column to return according to the status of a flag column as readonly. I have a column defined as follows in the report query.

    Decode (sys_flag, 'Y', APEX_ITEM. DISPLAY_AND_SAVE 3, TYPE_CODE, APEX_ITEM. SELECT_LIST_FROM_LOV (3, TYPE_CODE, 'LOV_TYPE_CODE_LOV')) AS TYPE_CODE

    To get the SRM process noting that column, I had to put this 'band of HTML code' to 'No', then the column attributes, I put:
    "Expression HTML" to "#TYPE_CODE #
    ' Display under "to"text display (saves the State).

    And then it took me to get new lines of work:
    "Default of Type" to "Expression of PL/SQL.
    'Default' to APEX_ITEM. SELECT_LIST_FROM_LOV (3, NVL(:P18_TYPE_CODE,'LOV_TYPE'), NULL, 'LOV_TYPE_CODE_LOV', ' NO')

    This makes large, however submit that it seems that the checksum of line used by MRU included the raw HTML generated by the APEX_ITEM package and not just the value of the column. I worked around this by including an element hidden checksum and creating a process that replaces the checksum generated automatically with my custom.

    Is there a better way to intercept this checksum, preferably before it is rendered on the page? I now hide the sum of hidden HTML control in the output HTML of another column, so it's a bit ugly. If not, is there an easier way to achieve what I'm looking for? I tried several combinations, and it seems to work better. It's just a shame there's no way to have a standard hidden column included in the SRM process.

    Hello

    I tried different possibilities and seems to run the following:

    Create a report questioning in NORMAL SQL function to help:

    SELECT
    APEX_ITEM.HIDDEN(1,EMPNO) || APEX_ITEM.TEXT(2,ENAME) ename,
    CASE WHEN DEPTNO = 10 THEN
     APEX_ITEM.HIDDEN(3, SAL) || SAL
    ELSE
     APEX_ITEM.TEXT(3, SAL)
    END SAL,
    EMPNO,
    DEPTNO || APEX_ITEM.MD5_CHECKSUM(ENAME, SAL) DETPNO
    FROM EMP
    

    Do not specify something special for column definitions.

    Create a button that submits the page.

    Create a PL/SQL process that runs "On submit - after calculations" and Validations, triggered by this button and using the following code:

    BEGIN
    APEX_ITEM.MULTI_ROW_UPDATE('#OWNER#:EMP:EMPNO,1:,|ENAME,2:SAL,3');
    END;
    

    I've done here: http://htmldb.oracle.com/pls/otn/f?p=55041:35

    Any element with the value of DEPTNO 10 has the value SAL, read-only, as otherwise it's editable. This is done by creating a hidden input field for the actual value, followed by the text version OR by creating a single entry field. This ensures that we have the correct number of SAL elements on the page.

    APEX_ITEM. MULTI_ROW_UPDATE is the "manual" version of the MRU that you would normally get with a form of table and works for above normal as sql based query reports. The format of this very strict is that you must always allow for two primary keys. See the text of presentation here: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b32258/api.htm#CHDFDACC

    Andy

  • New reports with the Version 15.1

    With version 15.1, we have several new reports, including status report list grouping all individual status reports into a single report with the colors for the selected values of the keys.  It is an impressive report (as well as other added to 15.1).  Take the time to view the reports again.

    Where does he find one this version 15.1 report? I only find a project status report in global reports-> list of reports and there is no color as your example shows.

  • Is it possible CreateInsert with the value of the attribute of a backingBean method?

    Hello, I am using JDeveloper 11.1.2.3.0
    I want to create a new record in the database with an attribute in a backingBean method. I have therefore a method that returns a string and I want to use this value for one of the attributes when I fill out the form in the ADF. But I have a problem because the operation CreateInsert cleans all the fields of the form. Is it possible to only fill the other fields of the form and as a field to be filled in automatically with the value returned by the method? If this isn't the case, please give me an idea on how to achieve this.
    Thank you

    Ok

    For example, if you have a button to your form to create a new line.
    The button should be as below:

     
    

    And the code in your backing bean:

    public String onCreateRowClick() {
      OperationBinding op = getBindings().getOperationBinding("CreateInsert");
      Object result = op.execute();
      DCIteratorBinding yourIt= getBindings().findIteratorBinding("yourViewIterator");
      Row newRow = yourIt.getCurrentRow();
      newRow.setAttribute("aa", getAttributeValue());
      return null;
    }
    
    public DCBindingContainer getBindings() {
        DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        return bindings;
    }
    

    and of course, you should have the "CreateInsert" action in your page links.

    Do you need anything else?
    I'm not good enough with tutorials :).

  • Creation of ComboBox with the values of the fields

    Hey everyone, it's been a while since my last post.

    I spent some time trying to fill a ComboBox with the values of the 3 fields of different form of google and I was wondering if someone could tell me on common sense.

    Thanks a lot for any idea!

    the general idea would be something like this:

    Get added to a table field values

    var aItems = [];

    aItems.push (getField("Text1").valueAsString);

    aItems.push (getField("Text2").valueAsString);

    aItems.push (getField("Text3").valueAsString);

    Fill the drop-down list with the elements box

    getField("combo1").setItems (aItems);

    Replace domain names with real field names that you use.

    You can start the list with an element that is a single space (if it appears empty) or something like "- select -". You can also make sure you add all the duplicate entries, which would happen if all the field values are the same.

    When did you want this script to run?

  • I have a list of selection with the value yes and no

    I am 10 select list with the value yes or no

    I need to launch a dynamic action, and so I have a variable that indicates the number of selection selected list which has been chosen as Yes or no...

    How can I realize this is apex 4.2 db 11g...

    Thank you

    Published by: zycoz100 on March 4, 2013 12:05

    Brute force method:

    Dynamic Action using a PL/SQL block with something like:

    count := 0;
    Begin
    If :P1_Select_List_1 = 'yes'
      count := count + 1;
    End If;
    If :P1_Select_List_2 = 'yes'
      count := count + 1;
    End If;
    If :P1_Select_List_3 = 'yes'
      count := count + 1;
    End If;
    . . .
    End; 
    

    ???
    Howard

  • Dynamically update a numeric field as the sum of the values of page element.

    Hello

    I am updating a numeric field on a page of the apex by summing the values of several components of the page. I have tried to follow this tutorial http://st-curriculum.oracle.com/obe/db/apex/r40/apexdynactions/apexdynactions_ll.htm, especially the part "create a Set value dynamic Action with the help of PL/SQL'.

    In the example of the tutorial, they return a value of page element P3_SAL multiplied by a multiplier determined by the case of another page. What I want to do is much more simple that I just want to add multiple values page element and then display them in a numeric field at the bottom of the page.

    so the code I tried to use based on the tutorial is in the tab: Home > Application Builder > Application 103 > Page 3 > Dynamic Action change > create / edit Action

    Set type: PL/SQL function body

    PL/SQL function body:

    BEGIN
    return: P3_ITEM1 + P3_ITEM2 + P3_ITEM3;
    END;

    Page items to submit: P3_ITEM1, P3_ITEM2, P3_ITEM3

    But it gives me an error that I need to declare identifiers, and yet it works if I use only one article and I can perform arithmetic.

    That is to say.

    BEGIN
    return: P3_ITEM1 + 1000;
    END;

    Any help would be appreciated.

    PL/SQL function body:

    BEGIN
    return: P3_ITEM1 + P3_ITEM2 + P3_ITEM3;
    END;

    Page items to submit: P3_ITEM1, P3_ITEM2, P3_ITEM3

    But it gives me an error that I need to declare identifiers, and yet it works if I use only one article and I can perform arithmetic.

    In your code, it lacks the ":" for articles P3_ITEM2 and P3_ITEM3.
    Try this:

    BEGIN
    return :P3_ITEM1+:P3_ITEM2+:P3_ITEM3;
    END;
    
  • Turn off the text box with the value of the checkbox

    Hello people,

    I am trying to activate or disable the text box with the value of the CHECKBOX, I have got the same thing with the BOX of ELECTION, with the javascript as follows: -.

    HEADER HTML
    ----------------------
    < script type = "text/javascript" >
    function disableOnValue (o)
    {
    If (o.value == 'Y')
    {
    document.getElementById('P2_TEXT_BOX1').disabled = false;
    document.getElementById('P2_TEXT_BOX2').disabled = false;
    document.getElementById('P2_TEXT_BOX3').disabled = false;
    }
    on the other
    {
    document.getElementById('P2_TEXT_BOX1').disabled = true;
    document.getElementById('P2_TEXT_BOX2').disabled = true;
    document.getElementById('P2_TEXT_BOX3').disabled = true;
    }
    }
    < /script >
    ---------------------

    under region Source whose Point display is < b > before < /b > foot and sequence is the last sequence of the entire region
    ----------------
    < script type = "text/javascript" >
    If (document.getElementById('P2_RADIO_BUTTON_0').checked is true)
    {disableOnValue (document.getElementById('P2_RADIO_BUTTON_0')) ;}
    on the other
    {disableOnValue (document.getElementById('P2_RADIO_BUTTON_1')) ;}
    < /script >
    ----------------

    and finally, to the title of point RADIO_BUTTON, HTML Form element attributes: -.
    -----------
    OnChange = "JavaScript:disableOnValue (this); »
    ----------

    the thing above works very well with the help of the RADIOBUTTON, but I want to try same thing with the CHECK_BOX I also tried a few changes but did not have any success so if someone help out me even that will be great and appreciated!


    Thank you

    Kind regards
    Kumar

    I also have the following in the Footer region region:

    <script type="text/javascript">
    x($x('P12_CHECKBOX'));
    </script>
    

    This is just to make sure that the items are disabled when the page is loaded, because the checkbox is deactivated

    Andy

  • Siri in him sending text with the value 'NULL '.

    When I say, "Siri, text my wife, 'X', ' Siri responds correctly,"here is your message to Jill: 'X'. "" "  "Ready to send it?"  I say 'Yes' and sends the message.  As soon as I get a text from my carrier saying the recipient of the message was invalid.  100% of the time, I see that Siri has sent a text with the value NULL.

    I tried to restart my phone.  I tried to remove and re-add my contacts.  Anyone else having this problem?  Someone knows how to solve?

    If it's by the carrier, you should contact them and see what they receive in return for their side. Ive had Siri send messages for me and I have never seen this one IOS.

  • Fill an input array with the values from the worksheet

    Is it possible to fill an input array with the values to a text file or a spreadsheet? If so, how do you?

    Thanks to GerdW and all who responded. Fill a table control using a local variable with "The spreadsheet file read" as he entered works perfectly.

  • Show largest index in the array with the value 'True '.

    Hello

    Is it possible to show the maximum number of index with the value "true", as indicated under?

    I can show the value on what index series of 'real' ends with the function 'Table Max and Min', but when there
    a fake between these True, it shows that the index of the true left of the fake.

    I don't need to know the size of the table, because he must stay 8

    File is attached

    Hi Stef,

    Here you go:

Maybe you are looking for