Tranforming columns into rows taking to long

Hi,
Please help me in tuning the query. I am trying to transform rows into columns. Its taking lots of time almost 13hrs for 500k records.
select
decode ( r,
          1,Col_1,
          2,Col_2,
          3,Col_3,
          4,Col_4,
          5,Col_5,
          6,Col_6,
          7,Col_7,
          8,Col_8,
          9,Col_9,
          10,Col_10,
          11,Col_11,
          12,Col_12,
          13,Col_13,
          14,Col_14,
          15,Col_15,
          16,Col_16,
          17,Col_17,
          18,Col_18,
          19,Col_19,
          20,Col_20) Col,
R ,
decode ( r,
          1,CASE WHEN SUBSTR(T1.Date_1,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_1,'YYYYDDD') ELSE NULL END,
          2,CASE WHEN SUBSTR(T1.Date_2,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_2,'YYYYDDD') ELSE NULL END,
          3,CASE WHEN SUBSTR(T1.Date_3,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_3,'YYYYDDD') ELSE NULL END,
          4,CASE WHEN SUBSTR(T1.Date_4,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_4,'YYYYDDD') ELSE NULL END,
          5,CASE WHEN SUBSTR(T1.Date_5,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_5,'YYYYDDD') ELSE NULL END,
          6,CASE WHEN SUBSTR(T1.Date_6,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_6,'YYYYDDD') ELSE NULL END,
          7,CASE WHEN SUBSTR(T1.Date_7,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_7,'YYYYDDD') ELSE NULL END,
          8,CASE WHEN SUBSTR(T1.Date_8,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_8,'YYYYDDD') ELSE NULL END,
          9,CASE WHEN SUBSTR(T1.Date_9,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_9,'YYYYDDD') ELSE NULL END,
          10,CASE WHEN SUBSTR(T1.Date_10,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_10,'YYYYDDD') ELSE NULL END,
11,CASE WHEN SUBSTR(T1.Date_11,5) BETWEEN '001'     AND '366'
               THEN TO_DATE(T1.Date_12,'YYYYDDD') ELSE NULL END,
          12,CASE WHEN SUBSTR(T1.Date_12,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_12,'YYYYDDD') ELSE NULL END,
          13,CASE WHEN SUBSTR(T1.Date_13,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_13,'YYYYDDD') ELSE NULL END,
          14,CASE WHEN SUBSTR(T1.Date_14,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_14,'YYYYDDD') ELSE NULL END,
          15,CASE WHEN SUBSTR(T1.Date_15,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_15,'YYYYDDD') ELSE NULL END,
          16,CASE WHEN SUBSTR(T1.Date_16,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_16,'YYYYDDD') ELSE NULL END,
          17,CASE WHEN SUBSTR(T1.Date_17,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_17,'YYYYDDD') ELSE NULL END,
          18,CASE WHEN SUBSTR(T1.Date_18,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_18,'YYYYDDD') ELSE NULL END,
          19,CASE WHEN SUBSTR(T1.Date_19,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_19,'YYYYDDD') ELSE NULL END,
          20,CASE WHEN SUBSTR(T1.Date_20,5) BETWEEN '001' AND '366'
               THEN TO_DATE(T1.Date_20,'YYYYDDD') ELSE NULL END)
Date from Table_1 t1,(select level R from dual connect by level <= 20)
where decode ( r,
          1,Col_1,
          2,Col_2,
          3,Col_3,
          4,Col_4,
          5,Col_5,
          6,Col_6,
          7,Col_7,
          8,Col_8,
          9,Col_9,
          10,Col_10,
          11,Col_11,
          12,Col_12,
          13,Col_13,
          14,Col_14,
          15,Col_15,
          16,Col_16,
          17,Col_17,
          18,Col_18,
          19,Col_19,
          20,Col_20) !=0
thanks
Edited by: user627047 on Jun 23, 2009 12:07 AM

Here I managed to get the output
PLAN_TABLE_OUTPUT
Plan hash value: 2442671038
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 408 | 274K| 40 (43)| 00:00:01 |
| 1 | NESTED LOOPS | | 408 | 274K| 40 (43)| 00:00:01 |
| 2 | VIEW | | 1 | 13 | 2 (0)| 00:00:01 |
|* 3 | CONNECT BY WITHOUT FILTERING| | | | | |
| 4 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 |
|* 5 | EXTERNAL TABLE ACCESS FULL | EVP0010 | 408 | 269K| 38 (45)| 00:00:01 |
Predicate Information (identified by operation id):
3 - filter(LEVEL<=20)
5 - filter(DECODE("R",1,"C_LOGO_LYLTY_CARD_1",2,"C_LOGO_LYLTY_CARD_2",3,"C_LOGO
_LYLTY_CARD_3",4,"C_LOGO_LYLTY_CARD_4",5,"C_LOGO_LYLTY_CARD_5",6,"C_LOGO_LYLTY_CAR
D_6",7,"C_LOGO_LYLTY_CARD_7",8,"C_LOGO_LYLTY_CARD_8",9,"C_LOGO_LYLTY_CARD_9",10,"C
_LOGO_LYLTY_CARD_10",11,"C_LOGO_LYLTY_CARD_11",12,"C_LOGO_LYLTY_CARD_12",13,"C_LOG
O_LYLTY_CARD_13",14,"C_LOGO_LYLTY_CARD_14",15,"C_LOGO_LYLTY_CARD_15",16,"C_LOGO_LY
LTY_CARD_16",17,"C_LOGO_LYLTY_CARD_17",18,"C_LOGO_LYLTY_CARD_18",19,"C_LOGO_LYLTY_
CARD_19",20,"C_LOGO_LYLTY_CARD_20")<>0)
24 rows selected.

Similar Messages

  • Problem in displaying the data of columns into rows in sap script

    hi,
    i am working on a sap script and i have to display the dat which is displayed in column into rows but it is not displaying it properly.
    eg, C
        12.1
        Si
        5.5
    it is displaying the data right now like this but i want to display the  data like this:-
    eg, C      Si
        12.1   5.5
    plzzprovide me guidelines how to solve this problem.

    hi,
    i am using this code to display the data:-
    plzz provide me guidelines where i am getting wrong?
    TOPparCOMPONENT DESP,,,,,, INS. LOT #, , , , , , MIC,,,,,,,,,, MIC VALUEparENDTOPparFINAL
    PROTECT
    IF &I_FINAL-PRUEFLOS& NE '000000000000'
    &I_FINAL-MAKTX(23)&&i_final-prueflos(12Z)&
    &I_FINAL-kurztext(25)&
    &I_FINAL-original_input(8)&
    ELSE
    &I_FINAL-MAKTX(23)&     
    &I_FINAL-kurztext(25)&
    &I_FINAL-original_input(8)&
    ENDIF
    ENDPROTECT
    ITEMHEAD
    POSITION WINDOW
    SIZE WIDTH +0 . 4 CH HEIGHT +1 LN
    BOX FRAME 10 TW
    BOX HEIGHT '1.35' LN INTENSITY 20
    IF &PAGE& = '1'
    BOX XPOS '0' CH YPOS '0' CM WIDTH '0' CM HEIGHT '43' LN FRAME '10' TW
    For horizontal line at top
    BOX XPOS '0' CH YPOS '0' CM WIDTH '75' CH HEIGHT '0' LN FRAME '10' TW
    COLUMN LINES...
    END OF COLUMN LINES...
    BOX XPOS '0' CH YPOS '43' LN WIDTH '75' CH HEIGHT '0' LN FRAME '10'TW
    BOX XPOS '75' CH YPOS '0' LN WIDTH '0' CH HEIGHT '43' LN FRAME '10'TW
    ELSE
    COLUMN LINES...
    END OF COLUMN LINES...
    BOX XPOS '0' CH YPOS '0' CM WIDTH '0' CM HEIGHT '47' LN FRAME '10' TW
    BOX XPOS '0' CH YPOS '0' CM WIDTH '75' CH HEIGHT '0' LN FRAME '10' TW
    BOX XPOS '0' CH YPOS '0' CM WIDTH '45' CM HEIGHT '0' LN FRAME '10' TW
    BOX XPOS '20' CH YPOS '0' CM WIDTH '0' CM HEIGHT '47' LN FRAME '10' TW
    BOX XPOS '0' CH YPOS '47' LN WIDTH '75' CH HEIGHT '0' LN FRAME '10'TW
    BOX XPOS '75' CH YPOS '0' LN WIDTH '0' CH HEIGHT '47' LN FRAME '10'TW
    ENDIF
    LINEFEED
    NEWPAGE
    NEW-PAGE
    provide me guidelines to solve this problem.
    Edited by: ricx .s on Mar 13, 2009 5:58 AM

  • How to display the rows in to columns and columns into rows?

    DES:- I know by using pivot and unpivot you can convert rows into columns and columns into rows but i don't know how to write the syntax?

    Hi,
    Besides the places Martin mentioned above, there are many examples in the forum FAQ:
    https://community.oracle.com/message/9362005#9362005
    For an example of both PIVOT and UNPIVOT in the same query, see
    http://forums.oracle.com/forums/thread.jspa?threadID=920854&tstart=0

  • To convert columns into row

    Hi All,
    I need help in building view which actually can show columns data as row.
    e.g.
    row is as follows
    Name Age Salary
    ABC 25 10000
    BBC 28 12000
    The above tables data I want to get as
    Name ABC BBC
    Age 25 28
    Salary 10000 12000
    Thanks in advance.

    Even if I don't really understand such requirement, I wrote some times ago such function to play around that :
    Re: Converting Columns into rows
    Nicolas.

  • How to turn columns into rows

    Hi. Does anyone know how to turn columns into rows ie:
    select field1, field2, field3, field4, field5 from table
    desired result:
    field1 field2
    field1 field3
    field1 field4
    field1 field5
    Thank you!

    Something like this ?
    select field1
    , case n.l
    when 1 then field2
    when 2 then field3
    when 3 then field4
    when 4 then field5
    end field
    from table
    , (select level l from dual connect by level <= 4) n

  • Converting columns into rows

    Dear all....I need to convert all columns into rows in a table. For example table has following columns:
    Emp_Cod........Val1......Val2......Val3
    1 a b c
    Now I wish that each column should display as a value like:
    Emp_Cod........Val1
    1 a
    1 b
    1 c
    Now the one way to solve this job is to write a union statement for each column but for this I'll have to write equal number of select statements as there are columns.
    What I need that is there anyway to write minimum code for this job, is there any alternate way???

    SQL> with t as(select 1 emp_code, 'a' val1, 'b' val2, 'c' val3 from dual)
      2  select*from t unpivot(v for c in(val1,val2,val3));
    EMP_CODE  C     V                                                      
            1  VAL1  a                                                      
            1  VAL2  b                                                      
            1  VAL3  c                                                      
    SQL> col COLUMN_VALUE for a20
    SQL> with t as(select 1 emp_code, 'a' val1, 'b' val2, 'c' val3 from dual)
      2  select*from t,table(sys.odcivarchar2list(val1,val2,val3));
    EMP_CODE  V  V  V  COLUMN_VALUE                                        
            1  a  b  c  a                                                   
            1  a  b  c  b                                                   
            1  a  b  c  c                                                   

  • Transpose columns into rows

    hi ,
    i need to transpose columns into rows ,
    i know i can use the UNION ALL but my num of columns will most likely not be fixed so how can i do that ?
    pls advise

    This is from one of the forms link,, i reallyy dont know the link, but i guess this is "adrains" code
    SQL> WITH ilv AS (
      2      SELECT str || ','                                   AS str
      3      ,     (LENGTH(str) - LENGTH(REPLACE(str, ','))) + 1 AS no_of_elements
      4      FROM   t
      5      )
      6  SELECT RTRIM(str, ',')                              AS original_string
      7  ,      SUBSTR(str, start_pos, (next_pos-start_pos)) AS single_element
      8  ,      element_no
      9  FROM  (
    10         SELECT ilv.str
    11         ,      nt.column_value AS element_no
    12         ,      INSTR(
    13                   ilv.str,
    14                   ',',
    15                   DECODE(nt.column_value, 1, 0, 1),
    16                   DECODE(nt.column_value, 1, 1, nt.column_value-1)) + 1 AS start_pos
    17         ,      INSTR(
    18                   ilv.str,
    19                   ',',
    20                   1,
    21                   DECODE(nt.column_value, 1, 1, nt.column_value)) AS next_pos
    22         FROM   ilv
    23         ,      TABLE(
    24                   CAST(
    25                      MULTISET(
    26                         SELECT ROWNUM FROM dual CONNECT BY ROWNUM < ilv.no_of_elements
    27                         ) AS number_ntt )) nt
    28        );
    ORIGINAL_STRING                 SINGLE_ELEMENT  ELEMENT_NO
    X,Y,Z                           X                        1
    X,Y,Z                           Y                        2
    X,Y,Z                           Z                        3
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  XXX                      1
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  Y                        2
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  ZZ                       3
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  AAAAA                    4
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  B                        5
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  CCC                      6
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  D                        7
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  E                        8
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  F                        9
    XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG  GGG                     10
    13 rows selected.
    Note that the above SQL performs the following steps:
        * determines how many elements are in each string (WITH clause);
        * for each string, generates a collection of n elements (TABLE expression), where n is the derived number of elements in the string. Note in particular the use of "less than" in the "CONNECT BY ROWNUM < ilv.no_of_elements" on line 26. In all versions other than 10.1.x, this will need to be "CONNECT BY ROWNUM <= ilv.no_of_elements" (i.e. "less than or equal to"). There is an unusual bug with this row-generation technique in 10.1 that generates an additional row from the CONNECT BY;
        * uses the generated rows in a Cartesian Product with the original data to generate n rows per string, based on the above definition of n;
        * calculates the start and end position of each element in each string (INSTR); and
        * cuts each element from each string (SUBSTR).

  • One Column into Rows

    I have data in a table that looks like below:
    ColumnA               ColumnB
    123                    abc|cde|fgr
    345                    def|ght|sew
    890                    deq|nmk|lop|lip|fre|dwsThere is no limit on how many values you can have in ColumnB and they are pipe delimited.
    I need to split this one column into rows as:
    ColumnA               ColumnB
    123                    abc
    123                    cde
    123                    fgr
    345                    def
    345                    ght
    890                    fre
    890                    dwsThanks in advance!

    with sample_data as (
                         select 123 columna,'abc|cde|fgr' columnb from dual union all
                         select 345,'def|ght|sew' from dual union all
                         select 890,'deq|nmk|lop|lip|fre|dws' from dual
    select  columna,
            regexp_substr(columnb,'[^|]+',1,column_value) columnb
      from  sample_data,
            table(
                  cast(
                       multiset(
                                select  level
                                  from  dual
                                  connect by level <= length(regexp_replace(columnb || '|','[^|]'))
                       as sys.OdciNumberList
      order by columna,
               column_value
       COLUMNA COLUMNB
           123 abc
           123 cde
           123 fgr
           345 def
           345 ght
           345 sew
           890 deq
           890 nmk
           890 lop
           890 lip
           890 fre
       COLUMNA COLUMNB
           890 dws
    12 rows selected.
    SQL> SY.

  • Convert single column into rows

    hi Gurus,
    I have one table test colums are id and name.
    id number
    name varchar2
    data is like
    id name
    1 xy
    2 xyy
    3 mm
    4 pp
    Now my requirement is to convert single column id into rows
    i,e my output should be of singel rows like :- 1,2,3,4
    How to achive this result .
    I dont have any idea to do this query.
    Please help guys.
    Thanks in advance.
    Vijay

    Well,
    As long as your code doesn't have to run in production, simplest way is:
    WM_CONCAT (but it's not documented)
    or use XMLAGG, it's simpler than a connect by:
    MHO%xe> with t as (
      2  select 1 col, 'xy' str from dual union all
      3  select 2, 'xyy' from dual union all
      4  select 3, 'mm'from dual union all
      5  select 4, 'pp' from dual union all
      6  select 8, 'pp' from dual union all
      7  select 12, 'pp' from dual union all
      8  select 40, 'pp' from dual
      9  )-- actual query, based on id's generated above:
    10  select rtrim(xmlagg(xmlelement(e,col||',')).extract('//text()'),',') col
    11  from   t;
    COL
    1,2,3,4,8,12,40
    1 rij is geselecteerd.

  • How to split columns into rows

    Hi All,
    Below is my table structure:=
    SQL> create table split(id number,value varchar2(200));
    Table created.
    SQL> insert into split values(1,'X,Y,Z');
    1 row created.
    SQL> insert into split values(2,'A,B,C');
    1 row created.
    SQL> commit;
    Commit complete.
    Expected Output
    ID Value
    1 X
    1 Y
    1 Z
    2 A
    2 B
    3 C
    I know the feature of converting rows into columns by listagg in Oracle 11g, but is there any feature to convert rows into columns based on a delemiter..."," in my case.
    Please help....
    Thanks
    Arijit

    >
    is there any feature to convert rows into columns based on a delemiter
    >
    Here is one way
    VAR csv VARCHAR2(100)EXEC :csv := 'abc,de,fg,hij,klmn,o,pq,rst,uvw,xyz';
    The query:
    WITH data AS( SELECT SUBSTR(csv, INSTR(csv,',',1,LEVEL)+1,                     INSTR(csv,',',1,LEVEL+1) - INSTR(csv,',',1,LEVEL)-1 ) token    FROM ( SELECT ','||:csv||',' csv FROM SYS.DUAL ) CONNECT BY LEVEL < LENGTH(:csv)-LENGTH(REPLACE(:csv,',',''))+2 )SELECT token  FROM data;See http://projectwownow.blogspot.com/2010/02/oracle-convert-csv-string-into-rows.html

  • How to convert columns into rows using  transpose function

    Hi
    anybody tell me how to convert columns values into rows using transpose function.

    Since BluShadow went to all the trouble to put it together, someone should use it.
    See the post titled How do I convert rows to columns? here SQL and PL/SQL FAQ
    John

  • Split multiple columns into rows using XML

    Hi Forum,
    I am trying to split 2 columns that each contain values separated by semicolon into single rows. The relation between the values of the two columns is that the order in the cells corresponds to each other.
    The data looks like this:
    pk    Manufacturer                partnumber
    1     Man1; Man2;Man3      PN1;PN2;PN3
    2     Man4; Man2;Man5      PN4;PN5;PN6
    The result should be:
    pk    Manufacturer     partnumber
    1       Man1                   PN1
    1       Man2                   PN2
    1       Man3                   PN3
    2       Man4                   PN4
    2       Man2                   PN5
    2       Man5                   PN6
    I am not sure how to format the XML to get a useful Basis for XML.value or XML.query
    Any ideas?
    TIA
    Alex

    Hi,
    Try like this ,
    DECLARE @tmp TABLE (pk INT,Manufacturer NVARCHAR(50),partnumber NVARCHAR(50))
    INSERT @tmp SELECT 1,'Man1; Man2;Man3','PN1;PN2;PN3'
    INSERT @tmp SELECT 2,'Man4; Man2;Man5','PN4;PN5;PN6'
    SELECT * FROM @tmp
    SELECT tmp2.pk pk,Manufacturer,partnumber FROM (
    SELECT ROW_NUMBER()OVER(ORDER BY tmp1.pk) RN,* FROM (
    SELECT pk,
    LTRIM(i.value('.','varchar(100)')) Manufacturer
    FROM ( SELECT pk, Manufacturer,
    CONVERT(XML,'<r><n>'
    + REPLACE(Manufacturer,';', '</n><n>') + '</n></r>') AS X
    FROM @Tmp) Spt
    CROSS APPLY Spt.X.nodes('//*[text()]') x(i)
    ) tmp1 ) tmp2
    JOIN
    (SELECT ROW_NUMBER()OVER(ORDER BY pk) RN,* FROM (
    SELECT pk,
    j.value('.','varchar(100)') partnumber
    FROM ( SELECT pk, partnumber,
    CONVERT(XML,'<r><n>'
    + REPLACE(partnumber,';', '</n><n>') + '</n></r>') AS Y
    FROM @Tmp) Spt
    CROSS APPLY Spt.Y.nodes('//*[text()]') y(j)) tmp2 ) tmp3 ON tmp3.RN = tmp2.RN
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

  • Transporting columns into rows using SSIS

    Hi everyone,
    Just need some help.
    I wanna transpose a data table in SSIS.
    The table is originally 
    CUSTREFNO
    Citizen
    FORENAME
    Citizen
    SURNAME
    Citizen
    DATE-OF-BIRTH
    Citizen
    TEL_NO
    Citizen
    GUARDIANNAME
    Citizen
    ADDRESS1
    Citizen
    ADDRESS2
    Citizen
    ADDRESS3
    Citizen
    ADDRESS4
    Citizen
    POSTTOWN
    Citizen
    POSTCODE
    Citizen
    OPERATOR
    Junk
    BOARDINGPOINT
    Junk
    DESTINATION
    Junk
    SERVICE_NO
    Junk
    EMAIL
    Citizen
    And i need the table in the following format
    CUSTREFNO
    FORENAME
    SURNAME
    DATE-OF-BIRTH
    TEL_NO
    GUARDIANNAME
    ADDRESS1
    ADDRESS2
    ADDRESS3
    ADDRESS4
    POSTTOWN
    POSTCODE
    OPERATOR
    BOARDINGPOINT
    DESTINATION
    SERVICE_NO
    EMAIL
    Citizen
    Citizen
    Citizen
    Citizen
    Citizen
    Citizen
    Citizen
    Citizen
    Citizen
    Citizen
    Citizen
    Citizen
    Junk
    Junk
    Junk
    Junk
    Citizen
    Any help, would be very much appreciated, thanks

    Umar, please see these resources.
    http://blogs.msdn.com/b/philoj/archive/2007/11/10/transposing-rows-and-columns-in-sql-server-integration-services.aspx
    http://www.rad.pasfu.com/index.php?/archives/14-PIVOT-Transformation-SSIS-Complete-Tutorial.html
    http://dinesql.blogspot.in/2011/08/pivot-and-unpivot-integration-services.html
    http://sqlage.blogspot.in/2013/12/ssis-how-to-use-unpivot-in-ssis.html
    http://www.bimonkey.com/2009/06/the-pivot-transformation/
    http://www.sql-server-performance.com/2007/ssis-pivot-unpivot/
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Comma separated column into rows for each value

    experts,
    I have a two column table. The second column has comma separated string values. How can I put the values separate for each comma separated and make one row for each value?
    example,
    column1 |   StringColumn
    s1          |   test, joy, happy
    s2          |  USA, England, India
    I want the result to be like below
    column1   |     StringColumn
    s1            |      test
    s1            |      joy
    s1            |      happy
    s2            |     USA
    s2            |     England
    s2            |     India
    thanks in advance
    ebro

    Hello ebro,
    See the following for a possible solution:
    http://gallery.technet.microsoft.com/scriptcenter/Convert-Small-CSV-Value-to-ffc142ff
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Sql Script containing INSERT INTO TABLE_NAME taking very long time

    Version:11g
    I have a .sql file which contains insert statements for the table ZIP_CODES like.
    INSERT INTO ZIP_CODES (ZIP_CODE, CITY, PROV, COUNTRY_CODE, LONGITUDE, LATITUDE)
    VALUES (..........);This sql file contains above 800,000 INSERT statements like these! Execution of this file takes around 20 minutes.
    Our client insists that they need a script to create this table and not a dump file (export dump of just this table)
    Is there any way i could speed up these INSERTs in this script. I have added a commit half way through this file because i was worried about UNDO tablespace.
    This table (ZIP_CODES) is not dependant on any other table (no FKs, no FK references,..).
    Edited by: Steve_74 on 03-Sep-2009 05:53

    One possible option is to use External Tables
    1. Create a CSV file with the values to be stored in the table.
    2. Create an directory object (The location where the CSV file will be stored)
    3. Create an External Table pointing to the CSV file
    4. Just do a INSERT INTO ZIP_CODES SELECT * FROM <external table> (may be try to use a APPEND hint)
    5. Drop the Directory object and External Table.

Maybe you are looking for

  • Filesystem goes read-only

    Hi, all Yesterday, OVM Server3.1.1 was crashed. due to ovspoolfs.img was corrupted. I recovered ovspoolfs.img.(but OVM Manager didn't recognize that server.) Main problem is that Filesystem goes read-only. I checked out /var/log/messages. but There a

  • Article IDoc not getting processed in PI for particle article type

    Hello All,      I have an strange behaviour in my system. i.e 1, we are creating an article IDOC by using BD10 for particulat article type. 2, IDOC created succesfully , then 3, Process the IDOC in BD87 to push the IDOC to PI system . 4, But i could

  • Start up problem

    dear all toshiba user... i have a serious problem with my toshiba laptop model no L300 STN501 for over 1 1/2 years now...the problem come during start up.. when i'm about to start my laptop with ac power only, i noticed that the power supply LED is f

  • How can i set this comparison in formula node

    a=[0,100] a<=5          => x=1 5<a<=10    => x=2 10<a<=95  => x=3 95<a<=98  => x=4 a>98          => x=5 Thank you. Solved! Go to Solution.

  • Oracle Explorer not Visible in VS 2005

    Hi, Uses: VS 2005 Pro; Oracle 9i Remote Database(Live); Oracle 10g Express Edition(Production); Windows Xp sp3+; I have my computer which is installed with Oracle 10g Express Edition and I 'm able to connect to the local Oracle XE as well as to the R