Concatenation of list of values in a single variable.

My query returns list of transactions. I want store all these transactions in a single variable and are comma separated. We are achieving this functionality by FOR loop. Is there any simple method to achieve this? Please let me know if you have any ideas.
Thanks and regards
Nagaraja Akkivalli.

If you are using 11gR2 database you can use LISTAGG see
http://download.oracle.com/docs/cd/E14072_01/server.112/e10592/functions087.htm
There is a post here with various other alternatives;
http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php
Cheers
David

Similar Messages

  • How can i pass multiple values by a single variable to EXECUTE IMMEDIATE

    Hi All,
    I want to pass multiple values for where condition for execute immediate. Something Like this:-
    bold
    Declare
    v_cond varchar(1000);
    Begin
    v_cond := '''INR','USD'''; --(OPTION 1)
    v_cond := 'INR,USD'; --(OPTION 2)
    EXECUTE IMMEDIATE 'Delete from table where colm in (:v_cond)' using v_cond;
    END;
    bold
    I am using this into a procedure
    Now option 1 gives an error ie a syntax error (; expected or something like that)(I am sorry, i can't tell the exact error here as i am not in the office right now)
    and option 2 makes the procedure execute but obviously doesn't delete the records, as it takes the whole as one.
    Please Help
    Regards
    Neeraj Bansal

    See the links containing examples under
    *7. List of values in an IN clause?*
    SQL and PL/SQL FAQ
    from the SQL and PL/SQL FAQ.

  • List of Values from SAP BW variable in Web Intelligence

    Hi Ingo,
    We have SAP BW Query Variables with list of values available in Universe and hence Web Intellligence.
    These variables are on InfoObjects like Business Partner, Contract Account...etc. The actual values for these objects are in millions. Whenever we use these filters at WebI, its taking too much time to load all those millions of List of Values.
    Can you please guide us how to avoid loading these List of Values and provide a text box for user input.
    Appreciate your help.
    Regards,
    Ravi Kumar Garre

    Hi,
    no - this is a feature you can enable on any List of values including those that are being generated based on BI variable. In the Universe - assuming a query with a BI variable - you will have two List of Value definitions per Variable.
    open the properties and set both of them to "Delegated Search", save the universe, export it and then you should see the difference.
    ingo

  • List of Values using page item variable

    I know there has to be a simple solution to my problem but I cannot figure it out. Any assistance would be greatly appreciated.
    I have a Shared list of values that I want to reuse on several of my pages. I have tried (I thought) all the variable possibilities but cannot figure out how to reference the page item in my list of values.
    Original code:
    select app_name d, app_sys_id f
    from ops_application
    where :P32_RADIO2 = 'Application'
    union
    select db_name d, db_id f
    from ops_database
    where :P32_RADIO2 = 'Database'
    Doesn't work:
    select app_name d, app_sys_id f
    from ops_application
    where 'P'||:APP_PAGE_ID||'_RADIO' = 'Application'
    union
    select db_name d, db_id f
    from ops_database
    where 'P'||:APP_PAGE_ID||'_RADIO' = 'Database'
    I also have tried 'P'||v('APP_PAGE_ID')||'_RADIO'
    'P'||&APP_PAGE_ID.||'_RADIO'
    'P&APP_PAGE_ID._RADIO'
    'P'||:APP_PAGE_ID||'_RADIO'
    Thanks,
    Gayle
    Edited by: user8116955 on Sep 27, 2010 12:25 PM

    Gayle,
    I haven't tried this, but what about
    where v('P'||:APP_PAGE_ID||'_RADIO') = 'Application'That should allow you to build up the name of the page item dynamically, and then test the value...
    A lower-quality solution would be to use an application item rather than a page item, as then you'd know the name ahead of time.
    Let me know if this works,
    -David

  • Make List of Values for Required Bind Variables

    In the SQL query for my View Object, I have a bind variable, which I set to "required". In the search form resulting from a View Criteria, a textbox shows up asking the user for the value of that variable. Is there a way to make it a List of Values instead?

    Hi WV,
    Create a transient attribute in your VO that contains the LOV and then set the value of your bind variable to point to this new transient attribute. Also here is another approach
    https://blogs.oracle.com/shay/entry/adf_query_with_parameters_and
    Let us know how it goes.
    -Juan Camilo

  • How to get Multiple Values for a single Variable in BPS.......

    Hi Gurus:
    I have a layout for planning, where I can plan for 5 days of the week. I also have a day column (yesterday) where I have the actual values. Users want to edit/foecast the next 5 days values. I am using a Variable to get the Date column which uses the System Date. However, since I am getting just one date in the Function Module (Code given below), the remaining days are greyed out and I can not enter the forecast values. I would like the same variable to get a series of dates in the same function module. What changes do I nee dto make in the ABAP code so that the remaining columns (Date) becaoe available for editing??
    The FM code I have to get "Today's Date" is as follows:
    FUNCTION ZCSHFL_GET_TODAY.
    ""Local Interface:
    *" IMPORTING
    *" REFERENCE(I_AREA) TYPE UPC_VAR-AREA
    *" REFERENCE(I_VARIABLE) TYPE UPC_Y_VARIABLE
    *" REFERENCE(I_CHANM) TYPE UPC_Y_CHANM
    *" REFERENCE(ITO_CHANM) TYPE UPC_YTO_CHA
    *" EXPORTING
    *" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL
    data: ls_charsel type upc_ys_charsel.
    ls_charsel-seqno = 1.
    ls_charsel-sign = 'I'.
    ls_charsel-opt = 'EQ'.
    ls_charsel-CHANM = I_chanm.
    ls_charsel-low = sy-datum.
    insert ls_Charsel into table eto_charsel.
    ENDFUNCTION.
    I want to get the Yestarday's Date as weel as dates for next 4 days from Today for this variable which are being used in the layout. Can anyone suggest the code tor this please.
    Thanks very much in advance......
    Best.... ShruMaa

    Hi,
    What I understand you need to return those dates from function module using parameter ETO_CHARSEL , right? If so just use this code:
    ls_charsel-seqno = 1.
    ls_charsel-sign = 'I'.
    ls_charsel-opt = 'BT'.  "we are giving ranges, so days between...
    ls_charsel-CHANM = I_chanm.
    ls_charsel-low = sy-datum - 1.  "...first day is yesterday
    ls_charsel-high = sy-datum + 4. "...and last day is 4 days from today
    insert ls_Charsel into table eto_charsel.
    This way you provide 5 days starting from yesterday till 4 days from today.
    Regards
    Marcin

  • How do I bind variables in a List of value

    I'm using jdev 11g. I have an updatable view object for which I want to use a list of values on a few fields. I have defined a read-only view object that query a table that contains several list of values based on a column call domain. How do I narrow the returned list of values with a bind variable. Or do I need to define a view object for each domain?

    Hi Frank,
    Thanks for your reply. After playing with different options with the list of values, I came to the conclusion that this functionality has been added to 11g to replicate Form's LOV functionality. However, if I select a radio group as the default list type, the filter option is grayed out. Also, i'm not sure i understand the relationship between the default list type and the control type on a page. I tried to define a default list type as Input Text with List of Values which let me add a filter, and on my page I dropped the field as a single selection radio group. In this case the filter does not work. Only if i drop a List of Value the filter will work but i don't want this king of interface.
    The way i did this with 10g was to define a view object with bindings and set the bind variable value on the binding page using a invokeAction. Is it still the way to do this in 11g?

  • How to use List of values with bind variables on item?

    Hi
    I made a dynamic list of values with a bind variable as a provider. I tried to run the list, and it worked fine - i filled inn the bind variable when asked for, and i got a list of values to choose from.
    I would very much like to use this list of values as an attribute on a custom made item. My wish is that when creating the item you someplace write the bind variable, and the list will then turn up as wanted. (I could f.ex add the variable as an attribute on the page type)
    I tried to create a custom attribute and assign the list of values to it. It created an error when I then tried to add the attribute to the item.
    Does anyone have any idea on how to solve this?
    Any help appreciated!
    Maja R. Anjer

    Hi
    i am getting error as
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT meaning, lookup_code,lookup_type
    FROM fnd_lookup_values
    WHERE view_application_id = 200) QRSLT WHERE (lookup_type=:1 AND ( UPPER(MEANING) like :2 AND (MEANING like :3 OR MEANING like :4 OR MEANING like :5 OR MEANING like :6)))
    Thanks
    Mateti

  • Multiple default values for Selection type variable

    Hi all,
    I am using Bex 3.5. I have a fundamental doubt while creating a User Entry, Selection Option, Optional type variable.  I am trying to include multiple single variables in the default section, but it accepts only one. Is it possible to add multiple default values to the variable so that they show up in the selection screen when we run the report via Bex Analyzer ?
    Thanks for the inputs !
    Regards
    Snehith.

    Hi,
    In one of my bi7 reports, i remember i have given multiple default values in a single variable. For example i wanted to have multiple material types in my selection screen.
    But i have to check out the type of that user entry variable.
    Hope the above reply was helpful.
    Kind regards,
    Ashutosh singh

  • List of values single result behaviour?

    Hi all,
    In ADFDemo List of values is launching popup if there is single result for given search criteria, but there is a line with text: // 2: if there is only one match, update data and not launch popup. How can i prevent popup from being raised. Line: event.setLaunchPopup(false); is not working or i am doing something wrong.
    Any ideas?

    Hi,
    see http://thepeninsulasedge.com/frank_nimphius/adf-faces-rich-client-javascript-programming/
    I documented " Stop client to server event propagation" to explain how client side event propagation can be stopped
    Frank

  • Retrieving ALL values from a single restricted user property

    How can I retrieve ALL values of a single restricted user property from within
    a .jpf file?
    I want to display a dropdown list within a form in a JSP which should contain
    all the locations listed in the property 'locations'. I ever get just the default
    value when I access the property via
    ProfileWrapper pw = userprofile.getProfileForUser(user);
    Object prop = pw.getProperty("ClockSetup", "Locations");

    Well, the code you've got will retrieve the single value of the property
    for the current user. You're getting the default value because the
    current user doesn't have Locations property set, so the ProfileWrapper
    returns the default value from the property set.
    I assume you want to get the list of available values that you entered
    into the .usr file in Workshop. If so, I've attached a
    SetColorController.jpf, index.jsp, and GeneralInfo.usr (put in
    META-INF/data/userprofiles) I wrote for an example that does just this.
    It uses the PropertySetManagerControl to retrieve the restricted values
    for a property, and the jsp uses data-binding to create a list from that
    pageflow method.
    For a just-jsps solution, you can also use the
    <ps:getRestrictedPropertyValues/> tag. I've attached a setcolor-tags.jsp
    that does the same thing.
    Greg
    Dirk wrote:
    How can I retrieve ALL values of a single restricted user property from within
    a .jpf file?
    I want to display a dropdown list within a form in a JSP which should contain
    all the locations listed in the property 'locations'. I ever get just the default
    value when I access the property via
    ProfileWrapper pw = userprofile.getProfileForUser(user);
    Object prop = pw.getProperty("ClockSetup", "Locations");
    [att1.html]
    package users.setcolor;
    import com.bea.p13n.controls.exceptions.P13nControlException;
    import com.bea.p13n.property.PropertyDefinition;
    import com.bea.p13n.property.PropertySet;
    import com.bea.p13n.usermgmt.profile.ProfileWrapper;
    import com.bea.wlw.netui.pageflow.FormData;
    import com.bea.wlw.netui.pageflow.Forward;
    import com.bea.wlw.netui.pageflow.PageFlowController;
    import java.util.Collection;
    import java.util.Iterator;
    * @jpf:controller
    * @jpf:view-properties view-properties::
    * <!-- This data is auto-generated. Hand-editing this section is not recommended. -->
    * <view-properties>
    * <pageflow-object id="pageflow:/users/setcolor/SetColorController.jpf"/>
    * <pageflow-object id="action:begin.do">
    * <property value="80" name="x"/>
    * <property value="100" name="y"/>
    * </pageflow-object>
    * <pageflow-object id="action:setColor.do#users.setcolor.SetColorController.ColorFormBean">
    * <property value="240" name="x"/>
    * <property value="220" name="y"/>
    * </pageflow-object>
    * <pageflow-object id="action-call:@page:index.jsp@#@action:setColor.do#users.setcolor.SetColorController.ColorFormBean@">
    * <property value="240,240,240,240" name="elbowsX"/>
    * <property value="144,160,160,176" name="elbowsY"/>
    * <property value="South_1" name="fromPort"/>
    * <property value="North_1" name="toPort"/>
    * </pageflow-object>
    * <pageflow-object id="page:index.jsp">
    * <property value="240" name="x"/>
    * <property value="100" name="y"/>
    * </pageflow-object>
    * <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@">
    * <property value="116,160,160,204" name="elbowsX"/>
    * <property value="92,92,92,92" name="elbowsY"/>
    * <property value="East_1" name="fromPort"/>
    * <property value="West_1" name="toPort"/>
    * <property value="success" name="label"/>
    * </pageflow-object>
    * <pageflow-object id="forward:path#success#begin.do#@action:setColor.do#users.setcolor.SetColorController.ColorFormBean@">
    * <property value="204,160,160,116" name="elbowsX"/>
    * <property value="201,201,103,103" name="elbowsY"/>
    * <property value="West_0" name="fromPort"/>
    * <property value="East_2" name="toPort"/>
    * <property value="success" name="label"/>
    * </pageflow-object>
    * <pageflow-object id="control:com.bea.p13n.controls.ejb.property.PropertySetManager#propSetMgr">
    * <property value="31" name="x"/>
    * <property value="34" name="y"/>
    * </pageflow-object>
    * <pageflow-object id="control:com.bea.p13n.controls.profile.UserProfileControl#profileControl">
    * <property value="37" name="x"/>
    * <property value="34" name="y"/>
    * </pageflow-object>
    * <pageflow-object id="formbeanprop:users.setcolor.SetColorController.ColorFormBean#color#java.lang.String"/>
    * <pageflow-object id="formbean:users.setcolor.SetColorController.ColorFormBean"/>
    * </view-properties>
    public class SetColorController extends PageFlowController
    * @common:control
    private com.bea.p13n.controls.ejb.property.PropertySetManager propSetMgr;
    * @common:control
    private com.bea.p13n.controls.profile.UserProfileControl profileControl;
    /** Cached possible colors from the User Profile Property Set definition.
    private String[] possibleColors = null;
    /** Get the possible colors, based upon the User Profile Property Set.
    public String[] getPossibleColors()
    if (possibleColors != null)
    return possibleColors;
    try
    PropertySet ps = propSetMgr.getPropertySet("USER", "GeneralInfo");
    PropertyDefinition pd = ps.getPropertyDefinition("FavoriteColor");
    Collection l = pd.getRestrictedValues();
    String[] s = new String[l.size()];
    Iterator it = l.iterator();
    for (int i = 0; it.hasNext(); i++)
    s[i] = it.next().toString();
    possibleColors = s;
    catch (P13nControlException ex)
    ex.printStackTrace();
    possibleColors = new String[0];
    return possibleColors;
    /** Get the user's favorite color from their profile.
    public String getUsersColor()
    try
    ProfileWrapper profile = profileControl.getProfileFromRequest(getRequest());
    return profileControl.getProperty(profile, "GeneralInfo", "FavoriteColor").toString();
    catch (P13nControlException ex)
    ex.printStackTrace();
    return null;
    // Uncomment this declaration to access Global.app.
    // protected global.Global globalApp;
    // For an example of page flow exception handling see the example "catch" and "exception-handler"
    // annotations in {project}/WEB-INF/src/global/Global.app
    * This method represents the point of entry into the pageflow
    * @jpf:action
    * @jpf:forward name="success" path="index.jsp"
    protected Forward begin()
    return new Forward("success");
    * @jpf:action
    * @jpf:forward name="success" path="begin.do"
    protected Forward setColor(ColorFormBean form)
    // set the color in the user's profile
    try
    ProfileWrapper profile = profileControl.getProfileFromRequest(getRequest());
    profileControl.setProperty(profile, "GeneralInfo", "FavoriteColor", form.getColor());
    catch (P13nControlException ex)
    ex.printStackTrace();
    return new Forward("success");
    * FormData get and set methods may be overwritten by the Form Bean editor.
    public static class ColorFormBean extends FormData
    private String color;
    public void setColor(String color)
    this.color = color;
    public String getColor()
    return this.color;
    [GeneralInfo.usr]
    [att1.html]

  • Prompt List of Values in WebI - SAP BI Variable - SAP BI Query -BI Infoset

    Hi,
    We have a Multiprovider built on an Infoset. SAP BI Infoset is built using 2 DSOs.
    There is a SAP BI Query on top of this Multiprovider.
    Multiple-Single Values type Optional Variables are created for some of the Objects of this SAP BI Query.
    Universe is created on top of this SAP BI Query, using SAP Integration kit.
    WebI is created on top of this Universe.
    Prompts are created on some of the Universe Objects, for the WebI report.
    We are facing a typical problem.
    When a WebI prompt is created on one particular object, (which also has a Multiple Single Value type Optional Variable in SAP BI Query), its List of Values is showing up only first three values in WebI. The SAP BI Variable in BEX Analyzer shows up all the 8 values for the List of Values, for the same object.
    The Output WebI report has more values for the object than shown up in the List of Values & this is the problem.
    We tried to keep the settings in Info-object, DSO, Infoset, Multiprovider = Values in Master Data (for the List of Values).
    Similar objects and similar variables for the same query / webi show all the List of Values.
    Any guidance on aspects to be checked would be helpful.
    regards,
    Rajesh K Sarin

    Problem :
    If an SAP BI Infoset is used in data modelling, and a restricted key
    figure is created in the SAP BI Query; the resultant WebI Object Prompt
    for the Info-object, only shows up LOVs which have been used for the
    restricted Key Figure. Both the things are not related except for the
    fact that some of the values for the same object are used for the
    restricted key figure.
    Details :
    We have a Multiprovider built on an SAP BI Infoset.
    SAP BI Infoset is built using 2 DSOs.
    There is a SAP BI Query on top of this Multiprovider.
    There is a restricted key figure in the sap bi query. KeyFigure "Number
    of Records" is restricted for 3 of the relevant Info-object "Meter
    Reading Status" values.
    Universe is created on top of this SAP BI Query, using SAP Integration
    kit. WebI is created on top of this Universe.
    Prompt is created on the Universe Object for Meter Reading Status, in
    the WebI report.
    List of Values is showing up only the three values in WebI (which were
    used in the Restricted Key Figure calculation).
    SAP BI Variable in BEX Analyzer for the same Info-object Meter Reading
    Status shows up all the 8 values for the List of Values.
    The Output WebI report has more values for the object than shown up in
    the List of Values & this is the problem.
    We have kept the settings in Info-object, DSO, Infoset,
    Multiprovider, Query = Values in Master Data (for the List of Values).
    When we delete the "Restricted Key Figure" from the SAP BI Query, the
    refreshed Universe and Webi have a complete set of List of Values
    applicable.   
    Steps for Reconstruction    
    1. Create Infoset
    2. Create SAP BI Query on Infoset
    3. Create Restricted Key Figure for Number of Records and few of the
    values for a characteristic info-object "X".
    4. Create BO Universe on SAP BI Query
    5. Create Webi on BO Universe
    6. Create a Prompt on the characteristic info-object "X".
    7. Check List of Values for the characteristic info-object "X" in SAP
    BI Query and WebI.
    8. LOVs in WebI are equal to the values used for restriction in the
    restricted key figure.
    9. Delete the restricted key figure from SAP BI Query.
    10. Refresh Universe
    11. Webi prompt shows all the values for the prompt on "X".

  • Entering mulitple values for a single user parameter

    Hello,
    Can anyone explain to me how to allow multiple values for a single parameter?
    For example, say I want to allow the report to display a list of employees based on their employee id. I want to allow the user to enter mulitple
    employee id's into a single field to get their report. SO the user would enter "241, 459, 832" to return the list of those 3 employees. I have the SQL set up below, but obviously I need to set up something different to break it out into 3 separate values. Any help would be greatly appreciated!
    SELECT * FROM EMPLOYEE
    WHERE EMPLOYEE_ID IN (:P_EMP_ID)

    Hi,
    Another way to do this is to use the lexical parameter, but then you have to create the parameter form in Forms. Your SQL would look like this for example:
    select * from emp where empno is not null &empno
    where &empno is a lexical parameter.
    Then on your parameter form you would have a text field F_empid, say 200 character long, allowing the user to enter multiple values separated by a ",".
    Then in the trigger that calls the report you would create a parameter list, and a variable that holds the values read from the form, this variable is where you define the value to be passed to the report's lexical parameter. For example:
    declare
    v_empid varchar2(200); (consistent with the length of the lexical parameter in the report).
    begin
    v_empid:='and empno in ('||F_empid||')';
    then you pass v_empid to &empno in the call to the report.
    This method works well. Good luck.

  • How can I use comma in the return values of a static list of values

    Hi all,
    I want to create a select list (static LOV) like the following:
    Display Value / Return Value
    both are "Y" / 'YY'
    one is "Y" / 'YN','NY'
    I write the List of values definition is like this:
    STATIC:both are "Y"; 'YY',one is "Y";'YN', 'NY'
    However, it is explain by htmldb like this:
    Display Value / Return Value
    both are "Y" / 'YY'
    one is "Y" / 'YN'
    / 'NY'
    I tried using "\" before the ",", or using single or double quote, but all these do not work:(
    How can I use a comma in the return values?
    Thanks very much!

    "Better still, why not process the code of both Y with 2Y and one is Y with 1Y? "
    Could you please explain in detail? thanks! I am quite new to htmldb
    In fact I have a table which has too columns "a1" and "a2", both the values of these two columns are "Y" or "N". AndI want to choose the records that both a1 and a2 are "Y", or just one of a1, a2 is "Y".
    So I write the report sql like this:
    "select * from t1 where a1 || a2 in(:MYSELECTLIST) "
    Thus, I need to use "," in the LOV, since expression list in IN(,,,) using ",".
    Any other way to implement this?

  • How to use two view Accessor's in a List of Values

    Hi
    I have one Transient VO , dragged on to .jsff page. One of the attribute of the transient VO has list of values.
    I have two View Accesors, First View Accesor consists of only ID's and Second View Accesor consists of Description value associated to each ID in the first View Accesor, Now I have to use these both View Accesor in such a way , Values are from First View Accesor and Description is from the second View Accesor as a drop down on my jsff page.
    The source for these both View Accesors are different. There is no relation ship between the two View Accesors. Is it possible to have these two View Accesors to a single drop down list ?

    Hi..
    yes ..on the same line i was getting ERROR.I got it resolved by rebinding it to the perticular column again.below is my code..
    <af:inputListOfValues id="valueId"
    popupTitle="Search and Select: #{bindings.Value.hints.label}"
    value="#{bindings.Value.inputValue}"
    model="#{bindings.Value.listOfValuesModel}"
    required="#{bindings.Value.hints.mandatory}"
    columns="#{bindings.Value.hints.displayWidth}"
    shortDesc="#{bindings.Value.hints.tooltip}"
    label="#{bindings.Value.hints.label}"
    inlineStyle="size:small;">
    <f:validator binding="#{bindings.Value.validator}"/>
    But i had to edit the value and validator parameter to make it row binding as shown below.I dont understand even after i bind the perticular datacontrol to the ADF table..it was still showing as
    value="#{bindings.Value.inputValue} not as value="#{row.bindings.Value.inputValue},because of this it was not able to function properly..
    <af:inputListOfValues id="valueId"
    popupTitle="Search and Select: #{bindings.Value.hints.label}"
    value="#{row.bindings.Value.inputValue}" model="#{bindings.Value.listOfValuesModel}"
    required="#{bindings.Value.hints.mandatory}"
    columns="#{bindings.Value.hints.displayWidth}"
    shortDesc="#{bindings.Value.hints.tooltip}"
    label="#{bindings.Value.hints.label}"
    inlineStyle="size:small;">
    <f:validator binding="#{row.bindings.Value.validator}"/>
    ~Harish
    Edited by: 886523 on Sep 28, 2011 2:52 AM

Maybe you are looking for