Value of the item as column name to select

Hello

I have a problem with the selection of the columns in the query using elements. For example: I have a request:
Select column_a table; or select table column_b;

and I want to do something like this:
n ' any item where I choose the column name
-query: select column_from_item from the tale of

Is this possible?
My version of the apex: 4.0.2.00.07
My version of db oracle: oracle 11g

Hello

Create a report... type... as a function returning the SQL statement...

and then you source should be something like

declare
   my_sql_statement varchar2(1000);
begin
   my_sql_statement := 'select ' || :p1_x || ' from table';
   return my_sql_statement;
end;

Kind regards
Shijesh

Tags: Database

Similar Questions

  • My requirement is, if we click on the POP UP LOV element so I want the dependent value of this item in column of the text element in a table.

    My requirement is

    If we click on the POP UP dot LOV button then I want the dependent value of this item in column of the text element in a table.

    How do I get this as a table?

    Hi Dan,.

    I have a table, in the first column is popup LOV.and second column key is text element.

    So my question is if we click contextual key lov and select employee name, then I want to show the email address of this employee in the second column of tabular presentation.

    This can be done with AJAX. Write a JavaScript function on the onchange event of popup LOV item (Employee) key and pass the number of the employee selected to your AJAX call, go get the employee email and assign it to your entry corresponding to the key LOV popup text has changed.

    As your dealing with Form (Wizard Based/APEX_ITEM Based-not specified) in a table, you take insofar as each column is the table of elements mapped to APEX_APPLICATION input. G_FXX tables and therefore to write JavaScript to locate the item to update.

    I hope this helps!

    Kind regards

    Kiran

  • passing the value of the item to another page

    Hello!

    I have a few questions while passing the value of the item to another presentation page and page refreshes.

    I have a page (page n ° 2) with more areas where users can fill data in some articles (text box, popups,...), then I have a region report report and button to enter a new item. When users, click the button is it redirects to another page (page no. 21), where the user enters the values to other elements (popup, text box,...) then I have 3 buttons on this page ('Cancel', "create one", "create an and create another") and now I don't know how to handle the button ' create a. Action for the button "create one" I want is that when button "create one" is clicked in a table (in my DB) should be inserted some values of page 2 and certain values on page 21, then users should be redirected to page 2, where you can see everything that you see before the user has clicked 'enter a new element button' (so all the values in the elements of the page 2 must be visible) + in this report in the region must be updated (so you can see the inserted elements on page 21)

    I hope you understand what I mean and you can help me. And sorry again for my English.

    Kind regards
    Dragan

    You can create a collection and use it in this way:

    IF apex_collection.collection_exists ("YOUR_COLLECTION") = TRUE THEN
    apex_collection.delete_collection (p_collection_name-online 'YOUR_COLLECTION');
    END IF;
                             
    apex_collection.create_collection (p_collection_name-online 'YOUR_COLLECTION');

    -Value added to the collection
    apex_collection.add_member ("p_collection_name-online 'YOUR_COLLECTION', p_c001 => ' value to save");

    -get the value of collection
    Select C001 in apex_collections where collection_name = "YOUR_COLLECTION";

    Go through this link to learn more about the collections http://docs.oracle.com/cd/E17556_01/doc/apirefs.40/e15519/apex_collection.htm

    OR

    as you say if its only id you want to perform, then simply create an item hidden in your page 2 =>: P2_ID_SO, then capture the value in your 2 page deal and use it in page 21.

    -Manu

  • The value of the cell in column

    Hello

    We report with a number of columns and columns of cells have value with a lot of characters (more than 100). We want to adjust the value of the cell in this column for example 20 characters and all characters of the value of the cell in column value of title HTML TD as "flag". Something like this:

    < code >
    "< td #ALIGNMENT headers # =" "#COLUMN_HEADER_NAME #" title = "#FULL_COLUMN_VALUE #" class = "data" > #TRIMED_COLUMN_VALUE # < table >
    < code >

    We can do as a model? You have an idea?

    I have an idea that uses JavaScript and the value of the total column in the hidden column, but I thing that there could be a better way to do this :-)

    Regarding.

    David

    Published by: user4893970 on November 23, 2010 16:11

    While I don't think that there is a way to do it with a normal report

    If it's a standard and not interactive report, then it can be done using the column Expression of HTML:

    #TRIMMED_COLUMN_VALUE#
    
  • How to pass the value of the item Application Javascript function.

    Hello

    I have the JavaScript in the properties attribute of the HTML Form element

    I'm on page 1 and passing the value of the item page P1_DEPT_NO. It is perferctly working very well and I am able to get the exact value of the element on the page
    onchange="javascript:function1($x('P1_DEPT_NO').value);"
    I'm on page 1 and passing the value G_DEPT_NO of the Application element .
    The problem here is, I don't get the point of Application inside the javascript function value.
    I tried to use alert(); and it gives me the undefined value
    onchange="javascript:function1($x('G_DEPT_NO').value);"
    I just want to know, How to pass the value of the Application in Javascript element.

    Thank you
    Deepak

    Deepak,

    I'm not a Javascript expert, but the suggestin I did was because the javascript is a case-sensitive... language and thats why onChange is not the same thing as onchange.
    Not sure if this is causing the problem.

    Application elements not associated with a page and have therefore no properties user interface.
    So, as mentioned in another post, the rendering would not work for the elements of the application.
    If it is for a single item, used only on this page, you might create a hidden page element and use it fo your goal

    If you want to keep watching objects application and AJAX, this page contains examples of using AJAX to solve problems like the one you mentioned.
    http://www.Oracle.com/technology/OBE/hol08/apexweb20/ajax_otn.htm#T1B

    Thank you
    Rajesh.

  • Why can't I just show the value of the reference variable on name full column

    Hello everyone,

    I want to display the value of the reference variable as column name for one of my analysis on OBIEE. However, when I write, it does not show the value, it shows just as text;

    VALUEOF ("rv_yesterday")

    How can I show the value of it?

    Can you help me please.

    Kind regards

    Dilek

    Raja,

    What is a date or a related data type in any variable of RPD - session or repository - will become a datetime. That's a given and you can play as much as you want with to_date, trunc, DATE (the way of the RPD), but will it be a datetime value. Period.

    Only when she is cast to a string rather than one of the 'date' data types can get rid of the component "hour".

    Edit: Sorry, I forgot to add: < dilek,="" that="" response="" is="" your="" answer="" as="" well,="" sorry.="" no="" "date="" without="" time="" component="" in="" proper="" data="" types."=""> >

  • Copy the value of the item to another page of the apex in a field

    I have a main table and adds a new button.

    In my master table, there is a client code.

    If I press this button again, I will be referred to another form on another page where I can create log files.

    For the moment, I have to insert the client code in this form.

    How is it possible to copy the customer ID, if I press the new button in the main table, if this customer code (value) will be copied

    in another article on my other page?

    Hello

    What version of APEX are you using?

    Solution for this should be simple.

    Just edit the button element. Assign it "Action when the button is clicked" "redirect to the page of this application.

    "Then set: Set on these elements ' with the name of the target element and the 'with these values" with the name of the source element.

    The same works also for reports. But instead of the nom_element, you must add the column name as: #COLUMN_NAME # for 'with these values.

    Concerning

    J

  • The values for the items in the list of the other data blocks appear not when running.

    Hello

    I have a new problem again.

    I'm a new form in which there is about 8 blocks. All blocks have their tables in the oracle database.

    Each block has 18 columns with the same column and the column names. But the values in these columns are different and do not match.

    The problem is while I sign the form, it fills only the first data block. Other blocks do not display or fill in the values.

    I can't create a master relationship because all column values are different.

    How show or fill in the values of all the tables?

    Please help me. Thank you.

    Hello

    If your form has really separated tables, then you can simply use a trigger key-exeqry at the level of forms of travel in each block in turn and perform a built-in query execute, eventually returned the starting block.

    That is to say

    go_block('..');

    execute_query;

    go_block('..');

    execute_query;

    etc.

    go_item (...);

    In this case, you would use the block where clause to constrain each table for the game proper.

    If, however, the database has no relationship between the tables, but the content of the data has a correlation, then you could create a relationship of forms manually.

    see you soon

    Stem

  • Display the values of the 2D stacked column chart

    Hello

    I use the following sql which shows the percententage of errors in a month
    SELECT NULL
    ,      TO_CHAR(MA.DATE_LOGG,'Mon'),
    sum(decode(el.error_type,'On',1,0)) "Ons", 
    sum(decode(el.error_type,'Pa',1,0)) "Prt",
    sum(decode(el.error_type,'No D',1,0)) "No D",
    sum(decode(el.error_type,'Sys',1,0)) "Sys",
    sum(decode(el.error_type,'Oth',1,0)) "Oth"
    FROM
           table1 MA, table2 EL, table3 CR
           WHERE
                     MA.ERROR = EL.ERROR
           AND       MA.ERROR IS NOT NULL
           AND       MA.COUNTRY = CR.COUNTRY_CODE         
          AND       TO_CHAR(DATE_LOGG,'YYYY') = nvl(:P5_FILTER,to_char(sysdate,'YYYY'))
          AND       CR.REGION_CODE = NVL(:P5_REGION,CR.REGION_CODE)
    GROUP BY TO_CHAR(MA.DATE_LOGG,'Mon'),  trunc(ma.date_logg, 'Month')
    ORDER BY  trunc(ma.date_logg, 'Month')
    Now the values are displayed correctly, however, the stacked bar displays the real percentage value, for example 60% on stacked bar. When we mouse over the bar it shows "No D", Sys, Oth. Is there a way to display permanently type Decode and percentages?

    Apex 4.1 / 11g

    Thank you
    Sun

    Hi Sun,.

    If you would like to add the series name in the values displayed in the bar of the items themselves, then you will need to customize the XML graph and update the tag to embed {% SeriesName}. I've added an example for my sample application, indicating where the XML code must be changed: http://apex.oracle.com/pls/apex/f?p=36648:90. For a complete list of available AnyChart keywords, such as % SeriesName, please see the AnyChart online documentation: http://anychart.com/products/anychart/docs/users-guide/label-text-formatting.html?fromtree.

    I hope this helps.
    Kind regards
    Hilary

  • IN parameter is the string of column names I want to SELECT delimited

    Hi guys,.

    Please bare with me. Not a pro at writing stored procedures.

    What I try to do is to pass a parameter of 'IN' to the proc. The setting is a varchar2 which is a comma-delimited string.
    I want to put this string in the SELECT statement.

    This setting is called "P_SelectFields".

    The value in the passage in the proc is like:
    P_SelectFields = ' CUSTOMERS SUM (CLI_SERVED) AS SUM (EI_INTC) + SUM (NEI_INTC) AS INTERVENTIONS,
    SUM (TOT_EMPRTN) AS EMP_RETURN, SUM (TOTAL_RTS) AS SCHOOL_RETURN
    "


    That's what I've got and I know that it works, if I put the string instead of the parameter it works. !

    PROCEDURE GET_NATIONAL_TOTAL_RESULTS (P_SelectFields IN varchar2, P_AGREEMENT_TYPE_IND AGREEMENT_TYPE.agreement_type_ind%TYPE, io_cursor in SYS_REFCURSOR)
    IS
    BEGIN
    OPEN FOR Io_cursor

    SELECT year_desc,
    P_SelectFields - that's where I want my partameter go.

    OF SPF_RESULT_VW
    WHERE r_num = 1 - FILTER for the LAST PERIOD for EACH YEAR
    and agreement_type_ind = P_AGREEMENT_TYPE_IND - desired FILTER FOR Agreement_type_ind
    GROUP BY year_desc
    ORDER BY year_desc
    ;

    END GET_NATIONAL_TOTAL_RESULTS;


    That's what I'm after you run the proc.

    YEAR_DESC = 2011-2012
    : B2 = SUM (CLI_SERVED) ACE, SUM (EI_INTC) CUSTOMERS + EMP_RETURN SUM (NEI_INTC) AS OF THE INTERVENTIONS, SUCH AS SUM (TOT_EMPRTN), SUM (TOTAL_RTS) SCHOOL_RETURN

    Where is ': B2 = "come from?".

    What can I do to make my parameter is "picked up" by the proc?

    Thank you

    Firstly: in relational databases, there is no distinction between 'fields '. Tables is not 'fields', they have columns.
    It is my experience that that call columns 'fields' basically treats the database as a flat file system. It's a very bad idea!

    If you want to pass as a parameter column names, you need dynamic SQL.
    However, PL/SQL was invented to reduce the analysis and using of the dynamic SQL, you'll at least soft-parse each statement.

    Dynamic SQL is obviously in the documentation, but most people here think that they don't need to read the documentation.

    So, for once
    glance

    OPEN io_cursor FOR
    'SELECT year_desc,'||
    P_SelectColumns||
    ' FROM SPF_RESULT_VW '||
    'WHERE r_num = 1 '|| --FILTER FOR LATEST PERIOD FOR EACH YEAR
    'and agreement_type_ind = P_AGREEMENT_TYPE_IND '||-- FILTER FOR desired Agreement_type_ind
    'GROUP BY year_desc '||
    'ORDER BY year_desc'
    ;
    

    Please note that I have renamed the parameter.

  • read the value of the item page after filling value pop-up window

    I can't read or insert and also I cannot perform dynamic action of a page element data after the filling of the data page of the window popup (pass back to the point of the page). But I can read and insert, perform a dynamic action data while filling in the data using ajax and PLSQL code...


    How to read the value after the filling of database page popup window?


    SKUD

    Set value using Javascript is that in your browser page but is not yet available in the session. This is why the report does not return the expected results.

    Before you refresh the report, you need to set the session state from this point.

    You can configure after assigning a new value or before the report is updated to the element
    For interactive reports, is available built in
    You can go to report attributes > attributes advanced-> Page elements to submit and specify P2_X1 for the field (and any other page element that depends on the report)

    For standard reports, you can create a dynamic Action that is triggered 'before updating"report region, select PLSQL as action types, give a code BÉGIN END NULL; model and specify the name of the item in the item page to submit the field so that it affects the value of items in the session.

  • Reset the value of the item page to null

    Hello
    On one of the pages of my site, my I list of some articles and each value of the element is a link, and if I click on the name of the element, a pop up appears which shows me the history of the issue. This pop-up history item, I have two elements of date picker where I provide the start and end date between which I want to see the story from this point. I add two calculations (before header) to set the values of the selectors of dates for the minimum and maximum dates for the mark of history goes back to this article in the database and on the first time, a complete history of the item turns in pop. Now I can choose my own minimum and maximum dating bicker date element and press a button, now the pop up refreshes and shows me the story between the dates, I have chosen.
    Now I close the pop-up windows and click on something else, but here when pop up is charged, I see the old values of date (that I selected for the previous article) in the date picker and ideally my calculations must have worked and dates selectors should see the minimum and maximum dates for this item.

    Can someone help me solve the problem so that if ever a new pop-up is open to a new element, the element in date picker must have updated them to the values that should be linked to the new item I clicked on that moment rather than date of previous section values.

    Thanks in advance

    Salman

    Hello Salman,

    I think I understand now what you are aming at.
    You say you have a calculation for the popup that defines the values where they are used for the first time. What conditions you have on these points? I guess they are submitted every time that you run the update, so the State of the item is updated with these values. If you don't reset it, these values will persist and be taken to the next item, which is what you currently see.
    You can place a process in your calling page that resets the page desired elements to be null before your calculation evaluates their condition, so the calculation allows you to retrieve the values of database. Another option would be to send a trigger element (for example a hidden item PX_TRIGGER get value 1 on submit) to the target page, which is part of the condition of your calculation (PX_TRIGGER = 1) and reset the trigger in your calculation (: PX_TRIGGER = 0).
    Please correct me if I am wrong.

    -Udo

  • Pass values of the item to the page with 'No URL Access'

    I have a request of "high security" where I try to limit the information passed around in the URL so I have several pages with branches of the 'branch to the page' where the target page access protection is set to "no access URL".

    However, I still need to set multiple values page element in the target page (the one I am connexiona step).

    Thinking about how to do what I thought of two ways to get this data to the target page.
    First way:
    (a) set up several calculations in the source page that calculates the values of the element in the target page and subordinate these calculations on a button application.
    (b) set up my 'on page' management on the source with the same request conditional button.

    Second way:
    (a) put in place target with a process of pl/sql page that defines the page elements
    APEX_UTIL. SET_SESSION_STATE('P31_SSN',:P40_SSN); -P31 is the target page
    do the same for all elements on the page. The process of subjecting to press the button.
    (b) implemented the same 'page' branch on the source with the same conditional key.

    Pro or con either of these approaches? Is there a different approach? I'm IMPOSSIBLE in any case implement a branch to URL with the item values in the URL as I don't want sensitive data columns in newspapers. I know that set_session_state can have interesting interactions with variable bind where they may not be, but I see no problem with my test pages...

    It doesn't matter what technique lets you define the session state - do what is easier. Call for apex_util.set_session_state is the same as make an assignment, for example,.

    APEX_UTIL. SET_SESSION_STATE('P31_SSN',:P40_SSN);

    .. .is equivalent to

    : P31_SSN: =: P40_SSN;

    Calculations are the same thing.

    Application parts are not broader than the elements on the page regarding the scope of application; any point in the session state can be referenced by any element of the request. Application parts are no rendering/display properties or association of specific page.

    Scott

  • [SOLVED] Property of the label of the box = MySQL column name

    Hello!
    I'm trying to get the value of a column in a MySQL database to link to the label of a checkbox property.
    I use a Repeater to retrieve all records in the database - but what I really need, but the names of column to a table and not the lines/records.

    So, is it possible to get the values of the column names in a MySQL via a PHP request directly, or I have to create a
    an XML file separate that contain manually entered values?

    Thanks for your help!
    Kind regards
    Christo

    This has been resolved.

    See the code below
    Kenwio

    THE FLEX AND PHP CODE:

  • Not able to see the value of the item description-&gt; main classification

    Hello group,

    I configured the responsibility of China. From now on, I'm not able to see the lov primary classification in the item Description screen.

    China HRMS Manager-> Total Compensation-> Description-> primary Classification (column) element the only value that is gathering is "initialization of balance."

    Where we, the responsibility, I am able to see more options. Can someone suggest me the reason for the same.

    Thank you

    It's 11.5.10 version

    Hi please refer to the below metalink note...
    566421.1 setting form element has a single value in the primary Classification balance initialization
    See you soon
    Ganesh

Maybe you are looking for