Comma Separated Tags from BLT?

Was reading the help documentation and noticed that there is a way to pass in comma separated tags to a query template:
TagName
One or more tag names to be queried
String Or String List
None
The name of a tag in the underlying data source.  This parameter can be repeated multiple times in a URL if multiple tags are to be queried, and multiple tags can be passed in a single parameter as a comma-separated list of tag names.
I tried this from a BLT and it didn't work. What is the trick to get this to work? I have about 50 tags to query and I dont want to hard code the mappings and I would rather not fire 50 individual queries. 
Any thoughts?

Brian,
You can't do it from an APPLET perspective or a standard TagQuery action block in BLS because of the explicit TagName.1 to TagName.128 query properties.  The TagName property you found in the help only works for a direct query to the Illuminator servlet such as:  http://<server:port>/Lighthammer/Illuminator?Server=Simulator&Mode=Current&TagName=L1Speed,L1Yield,AssetUtil1
If you need to wrap this functionality inside BLS or simply want to use it in an applet, then drop something like this into an XMLQuery template:
http://localhost/Lighthammer/Illuminator?QueryTemplate=Path/File&StartDate=[SD]&EndDate=[ED]&TagName=[Param.1]&Content-Type=text/xml
Assumptions would then be that you can bundle your data server and mode information in the query template (or you can keep them explicit with Server and Mode like in the first example and [Param.x] the right side of the equal sign to allow for simple Current/History/HistoryEvent changes).  The [SD] and [ED] tokens will make the XMLQuery known to be time sensitive to an iChart so the default 60 minutes, etc. will go into the http request and give you the convenient VCR controls in the time control bar.
Regards,
Jeremy

Similar Messages

  • Get Comma separated result from SQL Query

    Hey Everyone
    I have a requirement where i need to get comma separated result of names because there is one to many relationship i.e for every protocol there are mutiple people associated to it , and i created PL/SQL function for that and everything was fine and when it is in production multiple number of cursors were opened because of the logic and leading to RAC fail over and for that we were manually clearing the cursors every weekend and i am looking to create a Materialized view for this logic but i was unable to code the logic using Connect by clause
    Result is like and i want comma separated names for every protocol
    P06065     TESTER13 TESTER13
    P02095     PATRICIA CARMELITANO
    P02095     ANNE MUIR
    P02095     ROBERT HARLOW
    P02095     JANICE ALBERT
    P02095     Jacqueline van Dalen
    P02095     GUENTER HENNIG DR.
    P05209     Olga Xenaki
    P05553     Birgit Limbach-Angele
    P05553     Anja Schulz Dr.
    P05553     CHRISTA HAGENBUCHER
    here is the function which i wrote, i need to get the same logic through SQL Statement .. thanks for your help
    cursor c_GSCR is
    select T565804.FST_NAME||' '||T565804.LAST_NAME
    from
    S_PT_POS_HST_LS T544105 /* S_PT_POS_HST_LS_Protocol_Team */ ,
    S_CONTACT T565804 /* S_CONTACT_Protocol_Team */,
    S_CL_PTCL_LS T541903 /* S_CL_PTCL_LS_Protocol */
    where ( T541903.ROW_ID = T544105.CL_PTCL_ID and
    T544105.POSTN_ID = T565804.PR_HELD_POSTN_ID and
    T544105.ROLE_CD = 'Lead Project Manager' AND
    T541903.ROW_ID = v_PTCL_ID and
    T541903.PAR_PTCL_ID is null and T544105.END_DT is null );
    BEGIN
    l_row_num := 0;
    l_role := '';
    l_role_list := '';
    v_PTCL_ID := PTCL_ID;
    OPEN C_GSCR;
    if C_GSCR%isopen THEN
    LOOP
    FETCH C_GSCR INTO l_role;
    exit when C_GSCR%notfound;
    IF l_role_list IS NULL THEN
    l_role_list:=l_role;
    ELSE
    l_role_list:=l_role_list||', '||l_role;
    END IF;
    END LOOP;
    CLOSE C_GSCR;
    end if;
    ~Srix

    Hi,
    Srix wrote:
    Thanks for the Info .. My database in 10g R 2 i started using COLLECT Function
    select T541903.PTCL_NUM ,
    CAST(COLLECT(T565804.FST_NAME||' '||T565804.LAST_NAME) AS varchar2_ntt) , 7) AS LPM_NAME
    from
    S_PT_POS_HST_LS T544105 /* S_PT_POS_HST_LS_Protocol_Team */ ,
    S_CONTACT T565804 /* S_CONTACT_Protocol_Team */,
    S_CL_PTCL_LS T541903 /* S_CL_PTCL_LS_Protocol */
    where T541903.ROW_ID = T544105.CL_PTCL_ID and
    T544105.POSTN_ID = T565804.PR_HELD_POSTN_ID and
    T544105.ROLE_CD = 'Lead Project Manager' AND
    T541903.PAR_PTCL_ID is null and T544105.END_DT is null
    GROUP BY T541903.PTCL_NUM
    The result i like ...Do you mean "The result *is* like ..."?
    Or do you mean "The result I [would] like [is] ..."?
    The code above has unblanaced parentheses. If you are getting anything other than an error message, then I don't believe you are really running what you posted.
    Whenever you have a problem, post a complete test script that people can use to recreate the problem and test their ideas.
    Please do that. Post CREATE TABLE and INSERT statements to crate the sample data, the code you used to create the carachr2_ntt type and the function, and your best attempt at a query (formatted). Simplify as much as possible. For example, do you really need 3 tables to illustrate the problem? For purposes of asking a question on this forum, can't you pretend you have just one table, with 2 columns?
    I suspect the problem has to do with the user-defined type and function, which you didn't post. I can't even see how you called the function in your query. Without the information I mentioned above, there's not much I can do to help you.

  • Changing to comma separated values from a table

    Hi Gurus
    I have a column called ID and second column duplicatesID. So for each ID I can have more than one Duplicate ID.
    I want to have comma separated for values of Dup IDs for each ID.
    so
    ID | DuplicateIDs
    1 | 10501
    1 | 2010
    2 | 103
    2 | 109856
    2 | 1245
    result wanted is
    ID | DupsIDs
    1 | 10501 , 2010
    2 | 103,109856, 1245
    regards,
    ebro

    My preferred way is this
    SELECT ID,
    STUFF((SELECT ',' + CAST( DuplicateIDs AS varchar(10)) FROM table WHERE ID = t.ID FOR XML PATH(''),TYPE).value('.','varchar(max)'),1,1,'') AS DupsIDs
    FROM (SELECT DISTINCT ID FROM Table)t
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Read/Insert values from comma separated string

    I need Stored procedure to insert values in table using comma separated values from string based on algorithm as below.
    There are two table Mtable(Parent table), Ctable(Child table).
    Value passed from String can be like_
    1,A001,R1,C1,R2,C2,R3,C3
    2,A002,X1,Y1,X2,Y2
    3,A003,A1,B1,A2,B2,A3,B3
    1)For line1 I need to insert in Mtable values(1,A001)
    And in ctable I need to insert 3 rows with values
         ROW1     (1,R1,C1)
         ROW2     (1,R2,C2)
         ROW3     (1,R3,C3)
    2)For line2 I need to insert in Mtable values(2,A002)
    And in ctable I need to insert 2 rows with values
         ROW1     (2,X1,Y1)
         ROW2     (2,X2,Y2)
    Please help me to overcome this.
    Thanks

    create table t as
    select '1,A001,R1,C1,R2,C2,R3,C3' s from dual union
    select '2,A002,X1,Y1,X2,Y2' from dual union
    select '3,A003,A1,B1,A2,B2,A3,B3' from dual
    Table created
    select substr(s,1,instr(s,',')-1),
    substr(s,instr(s,',',1,2*i)+1,instr(s||',',',',1,2*i+1)-instr(s,',',1,2*i)-1),
    substr(s,instr(s,',',1,2*i+1)+1,instr(s||',',',',1,2*i+2)-instr(s,',',1,2*i+1)-1
    from t, (select 1 i from dual union select 2 from dual union select 3 from dual)
    where instr(s,',',1,2*i+1)>0
    order by 1,i
    SUBSTR(S,1,INSTR(S,',')-1) SUBSTR(S,INSTR(S,',',1,2*I)+1, SUBSTR(S,INSTR(S,',',1
    1                          R1                             C1                   
    1                          R2                             C2                   
    1                          R3                             C3                   
    2                          X1                             Y1                   
    2                          X2                             Y2                   
    3                          A1                             B1                   
    3                          A2                             B2                   
    3                          A3                             B3                   
    8 rows selected

  • Look Up For Comma Separated Strings

    Hi,
    How to look up for comma separated string from livecycle forms manager ??
    Plz gimme an idea on this.
    Raghava Kumar V.S.S.

    Hi
    My point is that the more detailed you ask your question, the more likely you are to get an answer.
    Those of us who monitor these newsgroups also appreciate you doing as much of your own research as possible, before asking us for help - we're more likely to spend our own (personal and valuable) time helping you, if we know that you've spent your own time doing research, and you've still not been able to solve the problem.
    I look forward to your next question :-)
    Howard

  • Comma Separated Value Taking too Much Time to Execute

    Hi,
    select ES_DIAGNOSIS_CODE DC from ecg_study WHERE PS_PROTOCOL_ID LIKE 'H6L-MC-LFAN'
    The above query returns comma separated value from the above query.
    I am using the query below to split the comma separated value but the below query is taking lot of time to return the data.
    SELECT
    select DC from (
    with t as ( select ES_DIAGNOSIS_CODE DC from ecg_study WHERE PS_PROTOCOL_ID LIKE 'H6L-MC-LFAN' )
    select REGEXP_SUBSTR (DC, '[^,]+', 1, level) DC from t
    connect by level <= length(regexp_replace(DC,'[^,]*'))+1 )
    Please suggest me is there any alternative way to do this comma separated value.
    Thanks
    Sudhir

    Nikolay Savvinov wrote:
    Hi BluShadow,
    I know that this function is fast with varchar2 strings from several years of using it. With CLOBs one may need something faster, but the OP didn't menion CLOBs.
    Best regards,
    NikolayJust because you perceive it to be fast doesn't mean it's faster than doing it in SQL alone.
    For starters you are context switching from the SQL engine to PL/SQL to call it.
    Then in your code you are doing this...
    select substr(v_str,v_last_break+1, decode(v_nxt_break,0,v_length, v_nxt_break-v_last_break-1)) into v_result from dual;which is context switching back from the PL/SQL engine to the SQL engine for each entry in the string.
    Why people do that I don't know... when PL/SQL alone could do it without a context switch e.g.
    v_result := substr(v_str,v_last_break+1, case when v_nxt_break = 0 then v_length else v_nxt_break-v_last_break-1 end);So, if you still think it's faster than pure SQL (which is what the OP is using), please go ahead and prove it to us.

  • Using Comma-Separated Selector

    I am building a site with products that can have different colors.
    Some products share colors.
    I am using the Comma-Separated Selector to select the available colors for each product from a list.
    My problem is showing each product and the colors available for each product.
    How do I create a recordset that pulls only the colors I need from the colors table based on the comma separated feild from the products table?
    Thanks for any help or point in the right direction.
    RGNelson

    Difficult to say without seeing how your database is planned
    Nested region? - probably not
    take a look at the MYSQL query with uses
    HAVING IN (items in a comma separated list, item, item, etc)
    this is the same approach as the article you mentioned
    also a similar problem (possibly) mentioned here...
    ryanpratt, "Multiple conditions in Querey builder Help" #2, 18 Nov 2008 7:30 am
    atb
    Paul

  • Need to Convert Comma separated data in a column into individual rows from

    Hi,
    I need to Convert Comma separated data in a column into individual rows from a table.
    Eg: JOB1 SMITH,ALLEN,WARD,JONES
    OUTPUT required ;-
    JOB1 SMITH
    JOB1 ALLEN
    JOB1 WARD
    JOB1 JONES
    Got a solution using Oracle provided regexp_substr function, which comes handy for this scenario.
    But I need to use a database independent solution
    Thanks in advance for your valuable inputs.
    George

    Go for ETL solution. There are couple of ways to implement.
    If helps mark

  • Combine data from a table and insert to another in comma separated format

    In my SQL database table i have some data as shown below.
    KNO       Course      Grade     Institution
    124        BTECH       First       IIT Calicut
    128        BE             First       KKS Institute
    124        CCNA         Q          NIIT Delhi
    124        DDCN         Q          Appl Calicut
    128        DIT            A         NIIT Delhi
    128        VB              Q        IICM Delhi
    i want this courses to be arranged as sample given under to a table named mainpers
    KNO    Course    
    124     BTECH[First], CCNA[Q],DDCN[Q]
    128     BE[First], DIT[A], VB[Q] 
    I am a System Administrator at Vadodara

    You can do this in SQL.
    with cte as (
    select distinct KNO
    from Table1
    select KNO
    , Stuff(
    (select ',' + Course + '[' + Grade + ']'
    from Table1
    where Table1.KNO = cte.KNO
    for xml path ('')
    ), 1, 1, '') as Course
    from cte
    http://davidduffett.net/post/5334646215/get-a-comma-separated-list-of-values-in-sql-with-for
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • Exporting Metadata (caption information) from JPEGS to a comma separated value (CSV) file

    Here is my dilemma. I am an archivist at an arts organization and we are in the process of digitizing many of our materials to post them on the web and make them available to internet users. One of the principle components of our collection is a large trove of photographs. We have been in the process of digitizing these images and embedding metadata (in the Caption/Description, Author/Photographer and Copyright fields) via PhotoShops File Info command.
    Now I am at a crossroads. We need to extract this metadata and transfer it into a comma separated value form, like an Excel spreadsheet or a FileMakerPro database. I have been told that it is not possible to do this through PhotoShop, that I must run a script through Acrobat or Bridge. I have no clue how to do this. I have been directed to a couple of links.
    First I was directed to this (now dead) link: http://www.barredrocksoftware.com/products.html
    The BSExportMetadata script allegedly exports the metadata from files selected in Adobe's Bridge into a comma separated value (CSV) file suitable for import into Excel, Access and most database programs. It installs as a Bridge menu item making it simple to use. The the Export Metadata script provides you with an easy to use wizard allowing you to select associated information about a set of images that you can then export. This script requires Creative Suite 2 (CS2). This script sounds like it does exactly what I want to do, but unfortunately, it no longer exists.
    Then I found this:
    Arnold Dubin, "Script to Export and Import Keywords and Metadata" #13, 8 Aug 2005 7:23 am
    I tried this procedure, but nothing seemed to happen. I also tried to copy the script into the JAVASCRIPT action option in Acrobat, but I received a message that the script had an error. It also seems to me that this script does not set up a dumping point, that is, a file into which this information will be exported to.
    I am a novice, not a code writer or a programmer/developer. I need a step-by-step explanation of how to implement this filtering of information. We have about 2000 jpeg and tiff files, so I would rather not go through each file and copy and paste this information elsewhere. I need to find out how to create a batch process that will do this procedure for me. Can anyone help?

    Hello -
    Is anyone aware of a tool that will do the above that is available for mac? Everything I've found so far seems to be PC only.
    Any help is appreciated, thanks!

  • Remove Duplicates From Comma Separated String

    Hi,
    I have one Column which contains duplicates values with comma separated.
    Customer ID
    5,5,5,5,6,6,5,5,5,6,7,4,1,2,1,4,7,2
    I wrote this:
    select REGEXP_REPLACE('5,5,5,5,6,6,5,5,5,6,7,4,1,2,1,4,7,2', '(^|,)([^,]*)(,\2)+','\1\2') from dual;
    5,6,5,6,7,4,1,2,1,4,7,2
    But it eliminates only continuous elements.
    I want out put like:
    5,6,7,4,1,2
    Please help.
    Thanks.
    Amit
    Edited by: 987565 on Feb 12, 2013 4:02 AM

    Thanks Purvesh,
    While testing with real data, it is ignoring some values. I didn't understand why it happening.
    with data as
    select '5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5668,5716,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5668,5716' col from dual
    select ltrim(max(sys_connect_by_path(col, ',')) keep (dense_rank last order by rn - 1), ',') col
    from (
    select col, row_number() over (order by 1) rn
    from (
    select distinct regexp_substr(col, '[^,]+', 1, level) col
    from data
    connect by level <= length(col) - length(replace(col, ','))
    start with rn = 1
    connect by prior rn = rn - 1;
    Result I got is:
    5714,5714,5716
    My Real Query is like that:
    declare
    cursor c1 is
    select o.id id
    from order o;
    v_char varchar2(200) := '';
    begin
    for a1 in c1 loop
    with data as
    select o.cust_id as col into v_char
    from order o
    where o.id = a1.id
    select ltrim(max(sys_connect_by_path(col, ',')) keep (dense_rank last order by rn - 1), ',') col
    from (
    select col, row_number() over (order by 1) rn
    from (
    select distinct regexp_substr(col, '[^,]+', 1, level) col
    from data
    connect by level <= length(col) - length(replace(col, ','))
    start with rn = 1
    connect by prior rn = rn - 1;
    SYS.dbms_output.put_line(v_char);
    end loop;
    end;
    Later, i will update same cust_id with v_char.

  • SSRS Report : Comma Separated Hyperlinks

    Hello,
    I want to display Comma Separated Hyperlinks in SSRS Report. I am not sure what should I change here to get this working.
    Below is the flow of data.
    1. Extracting value from the SharePoint List using SSIS Package Script component and filling data in SQL Table.
    I have used this Table and created below view to stuff all these three links together.
    SELECT ID, STUFF
    ((SELECT ', ' + BCM.BCMProgramDocument
    FROM BCMProgramDocumentation BCM
    WHERE BCM.Risk = R.ID FOR XML PATH('')), 1, 1, '') AS BCMDoc
    FROM Risk R
    which gives me below output, not sure why.
    "&lt;a href='http://yahoo.com'&gt;YAHOO&lt;/a&gt;", "&lt;a href='http://gmail.com'&gt;GMAIL&lt;/a&gt;", "&lt;a href='http://hotmail.com'&gt;HOTMAIL&lt;/a&gt;"
    Then in the SSRS Reporting, I have placed a PlaceHolder with HTML View selected and gave above field value in the expression.
    They are not appearing as comma separated Hyperlinks.
    Can anyone please help me on this ? What are the changes required in above steps ?
    Thank you,
    Mittal.

    Hi Mittal,
    According to your description, you want to show three links together with comma separated from BCMProgramDocument column to a report table. After testing the issue in my environment, we can refer to the following steps to achieve your requirement:
    Use the following query create a dataset:
    select * from BCMProgramDocumentation
    Click Fields in the left pane, add a Calculated Field as below:
    Field Name: ID2                     Field Source: 1
    Drag a table to design surface, then insert the expression below in the detail row:
    =JOIN(lookupset(Fields!ID2.Value,Fields!ID2.Value,Fields!BCMProgramDocument.Value,"DataSet1"),",")
    Right-click the Placeholder to open Placeholder Properties, then select ‘HTML-Interpret HTML tags as styles’ as Markup type.
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to remove html tags from a column

    Hi
    Problem is this: I get a column with a comma separated list of id's and I can successfully parse these id's and use them elsewhere. BUT, occasionally there are html tags within that id list like this:
    1082471,1237423<br xmlns="http://www.w3.org/1999/xhtml" />
    Is there a way to just automatically remove all tags from a column? Could do this with regex, but since there is no support, I don't know what to do.

    Hi,
    If the HTML can be detected by a starting symbol like „<“, then you could use the following:
    Unfortuntely the operation “ReplaceRange” is only available on a Text-level, so you have to invoke a function (at least to my knowledge). You also need an Index-column in your table, so if you don’t have it, you need to create one as well.
    This is your function:
    let
       fnRemoveHTML = (Value, Index) =>
    let
       Source = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
       IndeNo = Index,
       Value_ = Source{IndeNo-1}[Value],
       length = Text.Length(Text.From(Value_)),
       position = Text.PositionOf(Text.From(Value_), "<"),
       range = length-position,
       new= if Value_ is number then Value_ else Text.ReplaceRange(Value_, position, range, "")
    in
        new
    in
      fnRemoveHTML
    And this is how you invoke it:
    let
        Quelle = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
        Last = Table.AddColumn(Quelle, "Custom", each fn_RemoveHTML([Value], [Index])),
        ChangedType = Table.TransformColumnTypes(Last,{{"Custom", type number}})
    in
        ChangedType
    Provided your table is called “Tabelle1” & the column with your values to be replaced “Value” & your index-col “Index”
    Imke

  • MODEL clause to process a comma separated string

    Hi,
    I'm trying to parse a comma separated string using SQL so that it will return the parsed values as rows;
    eg. 'ABC,DEF GHI,JKL' would return 3 rows;
    'ABC'
    'DEF GHI'
    'JKL'
    I'm thinking that I could possibily use the MODEL clause combined with REGULAR expressions to solve this as I've already got a bit of SQL which does the opposite ie. turning the rows into 1 comma separated string;
    select id, substr( concat_string, 2 ) as string
    from (select 1 id, 'ABC' string from dual union all select 1, 'DEF GHI' from dual union all select 1, 'JKL' from dual)
    model
    return updated rows
    partition by ( id )
    dimension by ( row_number() over (partition by id order by string) as position )
    measures ( cast(string as varchar2(4000) ) as concat_string )
    rules
    upsert
    iterate( 1000 )
    until ( presentv(concat_string[iteration_number+2],1,0) = 0 )
    ( concat_string[0] = concat_string[0] || ',' || concat_string[iteration_number+1] )
    order by id;
    Can anyone give me some pointers how to parse the comma separated string using regexp and create as many rows as needed using the MODEL clause?

    Yes, you could do it without using ITERATE, but FOR ... INCREMENT is pretty much same loop. Couple of improvements:
    a) there is no need for CHAINE measure
    b) there is no need for CASE in RULES clause
    c) NVL can be applies on measures level
    with t as (select 1 id, 'ABC,DEF GHI,JKL,DEF GHI,JKL,DEF GHI,JKL,DEF,GHI,JKL' string from dual
       union all
        select 2,'MNO' string from dual
        union all
       select 3,null string from dual
    SELECT  id,
             string
      FROM   T
       MODEL
        RETURN UPDATED ROWS
        partition by (id)
        DIMENSION BY (0 POSITION)
        MEASURES(
                 string,
                 NVL(LENGTH(REGEXP_REPLACE(string,'[^,]+','')),0)+1 NB_MOT
        RULES
         string[FOR POSITION FROM  1 TO NB_MOT[0] INCREMENT 1] = REGEXP_SUBSTR(string[0],'[^,]+',1,CV(POSITION))
    SQL> with t as (select 1 id, 'ABC,DEF GHI,JKL,DEF GHI,JKL,DEF GHI,JKL,DEF,GHI,JKL' string from dual
      2     union all
      3      select 2,'MNO' string from dual
      4      union all
      5     select 3,null string from dual
      6      )
      7   SELECT  id,
      8           string
      9    FROM   T
    10     MODEL
    11      RETURN UPDATED ROWS
    12      partition by (id)
    13      DIMENSION BY (0 POSITION)
    14      MEASURES(
    15               string,
    16               NVL(LENGTH(REGEXP_REPLACE(string,'[^,]+','')),0)+1 NB_MOT
    17              )
    18      RULES
    19      (
    20       string[FOR POSITION FROM  1 TO NB_MOT[0] INCREMENT 1] = REGEXP_SUBSTR(string[0],'[^,]+',1,CV(POSITION))
    21      )
    22  /
            ID STRING
             1 ABC
             1 DEF GHI
             1 JKL
             1 DEF GHI
             1 JKL
             1 DEF GHI
             1 JKL
             1 DEF
             1 GHI
             1 JKL
             2 MNO
            ID STRING
             3
    12 rows selected.
    SQL> SY.

  • How can i get all these values in single row with comma separated?

    I have a table "abxx" with column "absg" Number(3)
    which is having following rows
    absg
    1
    3
    56
    232
    43
    436
    23
    677
    545
    367
    xxxxxx No of rows
    How can i get all these values in single row with comma separated?
    Like
    output_absg
    1,3,56,232,43,436,23,677,545,367,..,..,...............
    Can you send the query Plz!

    These all will do the same
    create or replace type string_agg_type as object
    2 (
    3 total varchar2(4000),
    4
    5 static function
    6 ODCIAggregateInitialize(sctx IN OUT string_agg_type )
    7 return number,
    8
    9 member function
    10 ODCIAggregateIterate(self IN OUT string_agg_type ,
    11 value IN varchar2 )
    12 return number,
    13
    14 member function
    15 ODCIAggregateTerminate(self IN string_agg_type,
    16 returnValue OUT varchar2,
    17 flags IN number)
    18 return number,
    19
    20 member function
    21 ODCIAggregateMerge(self IN OUT string_agg_type,
    22 ctx2 IN string_agg_type)
    23 return number
    24 );
    25 /
    create or replace type body string_agg_type
    2 is
    3
    4 static function ODCIAggregateInitialize(sctx IN OUT string_agg_type)
    5 return number
    6 is
    7 begin
    8 sctx := string_agg_type( null );
    9 return ODCIConst.Success;
    10 end;
    11
    12 member function ODCIAggregateIterate(self IN OUT string_agg_type,
    13 value IN varchar2 )
    14 return number
    15 is
    16 begin
    17 self.total := self.total || ',' || value;
    18 return ODCIConst.Success;
    19 end;
    20
    21 member function ODCIAggregateTerminate(self IN string_agg_type,
    22 returnValue OUT varchar2,
    23 flags IN number)
    24 return number
    25 is
    26 begin
    27 returnValue := ltrim(self.total,',');
    28 return ODCIConst.Success;
    29 end;
    30
    31 member function ODCIAggregateMerge(self IN OUT string_agg_type,
    32 ctx2 IN string_agg_type)
    33 return number
    34 is
    35 begin
    36 self.total := self.total || ctx2.total;
    37 return ODCIConst.Success;
    38 end;
    39
    40
    41 end;
    42 /
    Type body created.
    [email protected]>
    [email protected]> CREATE or replace
    2 FUNCTION stragg(input varchar2 )
    3 RETURN varchar2
    4 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
    5 /
    CREATE OR REPLACE FUNCTION get_employees (p_deptno in emp.deptno%TYPE)
    RETURN VARCHAR2
    IS
    l_text VARCHAR2(32767) := NULL;
    BEGIN
    FOR cur_rec IN (SELECT ename FROM emp WHERE deptno = p_deptno) LOOP
    l_text := l_text || ',' || cur_rec.ename;
    END LOOP;
    RETURN LTRIM(l_text, ',');
    END;
    SHOW ERRORS
    The function can then be incorporated into a query as follows.
    COLUMN employees FORMAT A50
    SELECT deptno,
    get_employees(deptno) AS employees
    FROM emp
    GROUP by deptno;
    ###########################################3
    SELECT SUBSTR(STR,2) FROM
    (SELECT SYS_CONNECT_BY_PATH(n,',')
    STR ,LENGTH(SYS_CONNECT_BY_PATH(n,',')) LN
    FROM
    SELECT N,rownum rn from t )
    CONNECT BY rn = PRIOR RN+1
    ORDER BY LN desc )
    WHERE ROWNUM=1
    declare
    str varchar2(32767);
    begin
    for i in (select sal from emp) loop
    str:= str || i.sal ||',' ;
    end loop;
    dbms_output.put_line(str);
    end;
    COLUMN employees FORMAT A50
    SELECT e.deptno,
    get_employees(e.deptno) AS employees
    FROM (SELECT DISTINCT deptno
    FROM emp) e;
    DEPTNO EMPLOYEES
    10 CLARK,KING,MILLER
    20 SMITH,JONES,SCOTT,ADAMS,FORD
    30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    CREATE OR REPLACE FUNCTION concatenate_list (p_cursor IN SYS_REFCURSOR)
    RETURN VARCHAR2
    IS
    l_return VARCHAR2(32767);
    l_temp VARCHAR2(32767);
    BEGIN
    LOOP
    FETCH p_cursor
    INTO l_temp;
    EXIT WHEN p_cursor%NOTFOUND;
    l_return := l_return || ',' || l_temp;
    END LOOP;
    RETURN LTRIM(l_return, ',');
    END;
    COLUMN employees FORMAT A50
    SELECT e1.deptno,
    concatenate_list(CURSOR(SELECT e2.ename FROM emp e2 WHERE e2.deptno = e1.deptno)) employees
    FROM emp e1
    GROUP BY e1.deptno;
    DEPTNO EMPLOYEES
    10 CLARK,KING,MILLER
    20 SMITH,JONES,SCOTT,ADAMS,FORD
    30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    CREATE OR REPLACE TYPE t_string_agg AS OBJECT
    g_string VARCHAR2(32767),
    STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
    value IN VARCHAR2 )
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
    returnValue OUT VARCHAR2,
    flags IN NUMBER)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
    ctx2 IN t_string_agg)
    RETURN NUMBER
    SHOW ERRORS
    CREATE OR REPLACE TYPE BODY t_string_agg IS
    STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
    RETURN NUMBER IS
    BEGIN
    sctx := t_string_agg(NULL);
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
    value IN VARCHAR2 )
    RETURN NUMBER IS
    BEGIN
    SELF.g_string := self.g_string || ',' || value;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
    returnValue OUT VARCHAR2,
    flags IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    returnValue := RTRIM(LTRIM(SELF.g_string, ','), ',');
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
    ctx2 IN t_string_agg)
    RETURN NUMBER IS
    BEGIN
    SELF.g_string := SELF.g_string || ',' || ctx2.g_string;
    RETURN ODCIConst.Success;
    END;
    END;
    SHOW ERRORS
    CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2)
    RETURN VARCHAR2
    PARALLEL_ENABLE AGGREGATE USING t_string_agg;
    /

Maybe you are looking for

  • I can't burn a cd in itunes no matter what I do someone please help?

    I am having a lot of trouble burning a cd in itunes?every time I try to burn a cd an unknown error (4450) appears and I can't figure out what the problem is and other times it says the burning speed is too high but I put it down to the lowest and it

  • Failure to initialize Photoshop CS5 Upgrade

    I bought a download version of the CS5 upgrade. I am on dial up at home which makes such a dowload impossible (52 hours!) so I took my lap top to the library where they have high speed and downloaded there, after much difficulty. I then transferred i

  • Wifi has been disabled?

    The Wifi icon at the top of my screen has an "x" where the signal strength would normally be.  When I open the network preferences there is no wifi option nor can I add a new wifi connection by clicking the "+" symbol.  It is not my router or interne

  • Crystal Reports (Web Viewer) Configuration Problem

    Hi, I am trying to show a simple report via JSP. But it gives an error that I could not understand. I think it is related with configuration files. Any recommendations would be helpful! The error's print stack trace and my configuration file's conten

  • Configuring agent on windows server 2008  with SQL server 2008R2

    Hi all, I have installed the ODI on Server 2008 machine i have successfully configure the ODI repositories(Master & work) on Sql Server 2008 R2.I have created the agent in topology navigator with name:LOCALAGENT and updated the odiparam.bat file acco