Comma separated Values have repeated values

Find the Comma separated Values have repeated values
say
Str:= '123,abc,4566,4897996,46546546,ouiouiou,lhjlhlh,123,pojpoj,465465,123,poipoio,lahslka,'
The above sting has 123 repeated 3 times i need to make a note of it and intimate to user
can a Oracle Function does this?
Thanks!

This is one way of doing so, using Pure Oracle functions:
with dat as
  select ',' || '123,abc,4566,4897996,46546546,ouiouiou,lhjlhlh,123,pojpoj,465465,123,poipoio,lahslka,' col
    from dual
select col, length(translate(lower(replace(col, ',123,', '~')), '~abcdefghijklmnopqrstuvwxyz1234567890-=+_)(*&^%$#@!<>?":|}{,.', '~')) occurances
  from dat;
COL                                                                                                                                                                         OCCURANCES         
,123,abc,4566,4897996,46546546,ouiouiou,lhjlhlh,123,pojpoj,465465,123,poipoio,lahslka,           3

Similar Messages

  • I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query parameter to report parameter i need to pass distinct values. How can i resolve this

    I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query
    parameter to report parameter i need to pass distinct values. How can i resolve this

    Hi nancharaiah,
    If I understand correctly, you want to pass distinct values to report parameter. In Reporting Service, there are only three methods for parameter's Available Values:
    None
    Specify values
    Get values from a query
    If we utilize the third option that get values from a dataset query, then the all available values are from the returns of the dataset. So if we want to pass distinct values from a dataset, we need to make the dataset returns distinct values. The following
    sample is for your reference:
    Select distinct field_name  from table_name
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Obtaining comma-separated list of text values associated with bitwise flag column

    In the table msdb.dbo.sysjobsteps, there is a [flags] column, which is a bit array with the following possible values:
    0: Overwrite output file
    2: Append to output file
    4: Write Transact-SQL job step output to step history
    8: Write log to table (overwrite existing history)
    16: Write log to table (append to existing history)
    32: Include step output in history
    64: Create a Windows event to use as a signal for the Cmd jobstep to abort
    I want to display a comma-separated list of the text values for a row. For example, if [flags] = 12, I want to display 'Write Transact-SQL job step output to step history, Write log to table (overwrite existing history)'.
    What is the most efficient way to accomplish this?

    Here is a query that gives the pattern:
    DECLARE @val int = 43
    ;WITH numbers AS (
       SELECT power(2, n) AS exp2 FROM (VALUES(0), (1), (2), (3), (4), (5), (6)) AS n(n)
    ), list(list) AS (
       SELECT
         (SELECT CASE WHEN exp2 = 1  THEN 'First flag'
                      WHEN exp2 = 2  THEN 'Flag 2'
                      WHEN exp2 = 4  THEN 'Third flag'
                      WHEN exp2 = 8  THEN 'IV Flag'
                      WHEN exp2 = 16 THEN 'Flag #5'
                      WHEN exp2 = 32 THEN 'Another flag'
                      WHEN exp2 = 64 THEN 'My lucky flag'
                 END + ', '
          FROM   numbers
          WHERE  exp2 & @val = exp2
          ORDER BY exp2
          FOR XML PATH(''), TYPE).value('.', 'nvarchar(MAX)')
    SELECT substring(list, 1, len(list) - 1)
    FROM   list
    Here I'm creating the numbers on the fly, but it is better to have a table of numbers in your database. It can be used in many places, see here for a short discussion:
    http://www.sommarskog.se/arrays-in-sql-2005.html#numbersasconcept
    (Only read down to the next header.)
    For FOR XML PATH thing is the somewhat obscure way we create concatenated lists. There is not really any using trying to explain how it works; it just works. The one thing to keep in mind is that it adds an extra comma at the end and the final query strips
    it off.
    This query does not handle that 0 has a special meaning - that is left as an exercise to the reader.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Credit mgnt:open orders and sales value have minus value in FD33

    Hi friends,
    In FD33, we notice that for a particular customer following fields are appearing with negative value (minus )
    ex: credit limit: 100,000.000
    1-Open orders:58,493.000-
    2-Sales value:45,528.203-
    3-Credit Exposure:32,682.479-
    Receivables is having Positive value, special liablity field is 00 value,
    i checked the table S066- open orders= 58,493.00-
    could you please help me to know what could be the reason for these negative value (minus), kindly provide answers with details
    thanks in advance

    Hi,
    Run the report RVKRED77 which will correct the value.
    Regards,
    Murali

  • SQL Select with comma separated column value

    Hi All
    ASP VBScript
    I have a DB column named allowed_contracts that stores a
    comma separated
    list of of values e.g. 3, 5, 19, 44, 52
    I need to select records based on a variable called
    varContractList that
    contains another comma separated list i.e. 5, 44, 52
    I only want to select records where the allowed_contracts
    column contains
    each of the varContractList,
    For example only return records that have 5 or 44 or 52 in
    thier
    allowed_contracts column.
    My brain is now in a persistant vegetive state trying to work
    this out so
    any ideas would be much appreciated.
    Regards
    Bren

    Hi Jules
    Cheers for this.
    I was trying to be a bit cute (lazy even) by storing the
    project ID's as a
    comma delimted string but as we see it doesn't always pay to
    be lazy. Serves
    me right for destroying brain cells by drinking the Welshpool
    beer the other
    week whilst visiting mates down that neck of the woods. :-))
    Time for another table me thinks.
    Rgds
    Bren
    "Julian Roberts" <[email protected]> wrote in message
    news:e7i13f$mup$[email protected]..
    > Fatal flaw here Bren. In a relational database, one
    shouldn't really store
    > foreign keys as a comma delimted string. One should have
    a 3 table
    > structure. eg
    >
    > Products:
    > ProductID
    > Product
    >
    > Categories:
    > CategoryID
    > Category
    >
    > ProductCategories:
    > ProductID
    > CategoryID
    >
    > So, from the table ProductCategories, a product can
    belong to many
    > categories. When doing a front end search to find
    products in multiple
    > categories, products can be shown thus:
    >
    > select * from Products where ProductID in (select
    ProductID from
    > ProductCategories where CategoryID in (5,44))
    >
    > --
    > Jules
    >
    http://www.charon.co.uk/charoncart
    > Charon Cart 3
    > Shopping Cart Extension for Dreamweaver MX/MX 2004
    >
    >
    >
    >
    >

  • Error: OQ78YWIW when repeating values in a pivot

    All,
    I'm receiving the following error on a pivot table:
    Assertion failure: rTotalPosition.tCellInfo.iLayerCell != rTotalPosition.tCellInfo.iEndLayerCell at line 310 of e:\views_e\nightly\sun\10134\windows\vobs\080726.1900\analytics_web\main\project\webpivotview\edgeiteratordef.h
    Error Details
    Error Codes: OQ78YWIW
    I get this when I set the column's value suppression to 'Repeat' - customer's request. I don't have this problem when the value suppresion is set to 'Suppress' (the 'Default').
    The pivot has 4 columns in the rows, 3 of which have subtotals.
    Any suggestion?
    Thanks in advance!

    Thanks for the reply, KK.
    I might have missed the point on something reading the link article, but, the article is suggesting how to select multiple columns in the column selector view. I'm just getting the error with a simple pivot with subtotals that have repeating values set for some of the four columns in the 'row' portion of the pivot.

  • Repeating Values on axis (SSRS Chart)

    Hi ,
         i have repeating values on axis .i am not sure sure how to get rid of this problem.i did workaround like changing interval property expression to iif(max(count(Fileld))<4,1,0) but it didn't help.i have attached  image file
    for reference .

    Hi Zamin,
    From your screenshot, it seems that the interval of the axis is 0.5, and the "Decimal places" was set to 0 in the “Number” tab, right? So 0.5 becomes 1 and 1.5 becomes 2. To avoid this issue, please set the "Decimal places" to 1 in the “Number” tab.
    If you have any questions, please feel free to ask.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Repeating values suppressed in tableview

    Hi, when I have repeating values in a tableview they are automatically suppressed.  How can I turn this feature off?  Do I need to include an iterator?  This is just a straightforward display only tableview that must display all the contents of the table regardless if they repeat or not.
    Thanks in advance,
    Kevin

    Hi Raja, yes sorry I should've specified that it is htmlb.  Here is an example:
    <htmlb:tableView id              = "tableviewexample"
                     table           = "<%= itab %>"
                     width           = "500"
                     visibleRowCount = "15" >
      <htmlb:tableViewColumn columnName  = "FIELD1"
                             fixedColumn = "TRUE"
                             title       = "Field1"
                             wrapping    = "false" />
      <htmlb:tableViewColumn columnName  = "FIELD2"
                             fixedColumn = "TRUE"
                             title       = "Field2"
                             wrapping    = "false" />
      <htmlb:tableViewColumn columnName  = "FIELD3"
                             fixedColumn = "TRUE"
                             title       = "Field3"
                             wrapping    = "false" />
      <htmlb:tableViewColumn columnName  = "FIELD4"
                             fixedColumn = "TRUE"
                             title       = "Field4"
                             wrapping    = "false" />
    </htmlb:tableView>
    The itab is loaded correctly and the contents appear as:
    FIRSTROW         |            0.00 |        50000.00 |    50000.00
    SECONDROW         |            0.00 |        50000.00 |    50000.00
    When this itab is rendered using the htmlb tableview the repeating value fields are not shown. It will appear like this:
    Field1           Field2           Field3            Field4
    FIRSTROW       0.00           50,000.00      50,000.00
    SECONDROW
    There must be a way to easily turn this off.
    Thanks,
    Kevin

  • ReportViewer Total column InScope causes repeating values in Innermost group

    I have a table which has only one cell. Inside that cell it has a rectangle (design purposes only) and inside that rectangle there is my main table. Primary table is used for paging, so it has one group. Innermost table is for data view. The problem is,
    that if i have ANY expression containing InScope("Matrix1_Group1") in Total column in the innermost table, i get repeating values in that table. Numbers are ok, but rows titles are repeating.
    +-----------+------------+---------+----------+
    | Country | Producer | [Month] | Total |
    +-----------+------------+---------+----------+
    | [Country] | [Producer] | SUM(Q) | <<Expr>> |
    +-----------+------------+---------+----------+
    | Total | SUM(Q) | <<Expr>> |
    +------------------------+---------+----------+
    This is the sample of my innermost table (tried my best. not allowed to insert images). I i use InScope("Matrix1_Group1") in ANY (value, Color, BackgroundColor) expression in Total column, Producer column values are repeating (the first value
    is repeated in all rows).
    Sample expression from cell in Total column is: =IIF(InScope("Matrix1_Group1"), Fields!Producer.Value/SUM(Fields!Producer.Value, "Matrix1_Group1"), "100%")
    More information abou this problem.
    It only occurs if two conditions are met: repor has paging and InScope returns true. I have to make pages in report and each page contains table and some other blocks. I use List component to create a list and use grouping. Then i put a table inside. If
    table is outside any element, everything works perfectly, but if it is inside list, table, matrix or something similar allowing to create pages, the problem occurs. 
    Also, if InScope allways returns FALSE and none condition is met - there is no problem. But if any InScope return TRUE - i have repeating values in innermost group.

    Please have a look at the following links:
    http://download-west.oracle.com/docs/html/B10602_01/orbr_summary.htm#1010648
    http://download-west.oracle.com/docs/html/B10602_01/toc.htm

  • 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;
    /

  • How to get distinct values in a comma separated list of email addresses?

    Hi Friends,
    I have a cursor which fetches email address along with some other columns. More than one record can have same email address.
    Ex
    CURSOR C1 IS
    SELECT 1 Buyer,'XX123' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 2 Buyer,'XX223' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 1 Buyer,'XX124' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 2 Buyer,'XX224' PO, '[email protected]' Buyer_email from dualNow, i open the cursor write the contents into a file and also form a comma separated list of buyer emails as follows
    for cur_rec in c1
    LOOP
    --write contents into a file
    l_buyer_email_list := l_buyer_email_list||cur_rec.buyer_email||',';
    END LOOP
    l_buyer_email_list := RTRIM(l_buyer_email_list,',');
    The buyer email list will be like: '[email protected],[email protected],[email protected],[email protected]'
    Inorder to avoid duplicate email address in the list, i can store each of this value is a table type variable and compare in each iteration whether the email already exist in the list or not.
    Is there any other simpler way to achieve this?
    Regards,
    Sreekanth Munagala.

    If you are using oracle version 11, you can use listagg function
    with c as
    (SELECT 1 Buyer,'XX123' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 2 Buyer,'XX223' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 1 Buyer,'XX124' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 2 Buyer,'XX224' PO, '[email protected]' Buyer_email from dual
    select buyer, listagg(buyer_email,',') within group (order by  buyer) 
    from c
    group by buyer
    order by buyerFor prior versions
    {cod}
    with c as
    (SELECT 1 Buyer,'XX123' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 2 Buyer,'XX223' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 1 Buyer,'XX124' PO, '[email protected]' Buyer_email from dual
    UNION ALL
    SELECT 2 Buyer,'XX224' PO, '[email protected]' Buyer_email from dual
    select buyer, rtrim(xmlagg(xmlelement(e,buyer_email||',').extract('//text()')),',')
    from c
    group by buyer
    order by buyer

  • 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!

  • Query on column with comma separated values

    I have a proposed table with unnormalized data like the following:
    ID COLA COLB REFLIST
    21 xxx  zzz  24,25,78,412
    22 xxx  xxx  21
    24 yyy  xxx  912,22
    25 zzz  fff  433,555,22
    .. ...  ...  ...There are 200 million rows. There is maximum of about 10 IDs in the REFLIST, though typically two or three. How could I efficiently query this data on the REFLIST column? e.g. something like:
    SELECT id FROM mytable WHERE :myval in reflistLogically there is a many to many relationship between rows in this table. The REFLIST column contains pointers to ID values elsewhere in the table. The data could be normalized so that the relationship keys are in a separate table (in fact this is the current solution that we want to change).
    ID  REF
    21  24
    21  25
    21  78
    21  412
    22  21
    24  912
    ... ...The comma separated list seems instinctively like a bad idea, however there are various reasons for proposing it. The main reason is because the source for this data has it structured like the REFLIST example. It is an OLTP-like system rather than a data warehouse. The source code (and edit performance) would benefit greatly from not having to maintain the relationship table as the data changes.
    Going back to querying the REFLIST column, the problem seems to be building an approriate index for the data. The ideas proposed so far are:
    <li>Make a materialized view that presents the relationships as normalized (e.g. as in the example with ID, REF columns above), then index the plain column - the various methods of writing the view SQL have been widely posted.
    <li>Use a Oracle Text Index (not something I have ever had call to use before).
    Any other ideas? Its Oracle 10.2, though 11g could be possible.
    Thanks
    Jim

    Something like this ?
    This is test demo on my 11.2.0.1 Windows XP
    SQL> create table test (id number,reflist varchar2(30));
    Table created.
    SQL> insert into test values (21,'24,25,78,412');
    1 row created.
    SQL> insert into test values (22,'21');
    1 row created.
    SQL> insert into test values (24,'912,22');
    1 row created.
    SQL> insert into test values (25,'433,555,22');
    1 row created.
    SQL> select * from test
      2  where
      3  ',' || reflist || ',' like '%,22,%';
            ID REFLIST
            24 912,22
            25 433,555,22
    SQL>Source:http://stackoverflow.com/questions/7212282/is-it-possible-to-query-a-comma-separated-column-for-a-specific-value
    Regards
    Girish Sharma
    Edited by: Girish Sharma on Jul 12, 2012 2:31 PM

  • Comma separated values for input and return multiple values

    Hello everyone,
    I have this simple package. Can someone suggest a way to accept multiple empno as input (comma separated) and to return set of salary values for the set of employee numbers (compatible to work with lower Oracle versions). Thanks much!
    CREATE OR REPLACE PACKAGE test_multi IS
    FUNCTION GET_sal(P_empno IN emp.empno%TYPE) RETURN NUMBER;
    END test_multi;
    CREATE OR REPLACE PACKAGE BODY test_multi IS
    FUNCTION GET_sal(P_empno IN emp.empno%TYPE) RETURN NUMBER IS
    V_sal NUMBER(10,2);
    MSG VARCHAR2(200);
    BEGIN
    SELECT sal
    INTO V_sal
    FROM emp
    WHERE empno = p_empno;
    RETURN V_sal;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('No data found.');
    IF (V_sal IS NULL OR V_sal = 0) THEN
    V_sal := 0;
    END IF;
    RETURN V_sal;
    WHEN OTHERS THEN
    MSG := SUBSTR(SQLERRM, 1, 70);
    DBMS_OUTPUT.PUT_LINE(MSG);
    END GET_sal;
    END test_multi; -- End package

    A way to do this in 10g or above...
    SQL> ed
    Wrote file afiedt.buf
      1  with e as (select '7499,7698,7654,7902' as enos from dual)
      2  --
      3  select empno, sal
      4  from emp
      5  where empno in (select regexp_substr(enos,'[^,]+',1,rownum)
      6                  from   e
      7*                 connect by rownum <= length(regexp_replace(enos,'[^,]'))+1)
    SQL> /
         EMPNO        SAL
          7902       3000
          7698       2850
          7654       1250
          7499       1600
    SQL>As for Oracle 8, .... well.... like Oracle, I no longer use unsupported versions, so I'd recommend you upgrade to something that is supported.

  • Adding a parameter with comma separated having different values

    i want to add a parameter with comma separated having different values of a column. e.g i have column having values from 10000 to 99999. i want to create report for the selected values of 11111,12111,131111 etc. This selection can be one or more values as desired. Second problem is restricting the records as per parameter.

    Reports doesn't allow multi-selection of a parameter in its parameter form. You need to use Oracle*Forms or an HTML Form to front end more advanced parameter form options.
    However, you could have multiple parameters and combine their selections into a single parameter in the after parameter form trigger. This would at least allow you to give the user the option for selecting up to 'n' parameters. The single parameter would have to be of type "character" and you probably want to add appropriate quotes around the values in the after parameter form trigger.
    Second problem is restricting the records as per parameter. Once you've got the comma seperated values into a single parameter (say p_myValues with a default value of '') then you can just use a lexical parameter to restrict the values as in:
    select * from emp
    where to_char(empno) in (&p_myValues)

Maybe you are looking for

  • Download Adobe Premiere / Photoshop Elements 11

    Hi, I bought last year a pack with Premiere Elements 11 and Photoshop Elements 11. Both were on dvd, but I registered them on the Adobe Website. As I changed my computer and don't have a dvd player now, I'm looking for a way to have them again, witho

  • EPS File Not Using Proper Fonts in Illustrator

    I am trying to import an EPS file that I created in Finale 2014 into Illustrator CS6 (64 bit). It seems to not want to use the Maestro font for the noteheads, rather replacing it with Myriad Pro. I have tried this on multiple machines with the same r

  • Contact # for Lightroom?  I need a live person to talk to.

    I

  • Virtual keyboard sticky in iOS8

    After several years of using a Zagg bluetooth keyboard with my iPads (1 and now 3) very happily, IOS8 seems to have distubed things. In particular, the virtual keyboard comes up and cannot be dismissed with the key in the bottom right-hand corner; I

  • How to create knowledge articles in CRM?

    Dear All, With the new 7.0 version being completely new to us, we have struggling with creating knowledge articles in the system. How to create a new knowledge article in the system? Thanks in advance! Leon