Converting Columns to rows in Oracle 10g

Hi
i need hint to convert rows to columns.i had given the data strucure and expected output
Source Table
BU_ID     Prod_id     total_clients   Tot_men        Totwomen
101        AAA           85              50          35
101        BBB           40              20          20Expected Output
BU_ID  Prod_id    Clint_info          Values
101      AAA          total_clients      85
101      AAA          Tot_men          50
101      AAA          totwomen        35
101      BBB           total_clients      40
101      BBB           tot_men          20
101      BBB           totwomen        20Thanks
Edited by: Sami on Aug 1, 2012 8:25 PM

Hi,
Cross-join your table with a Counter Table , a table (or result set, as in the example below) that counts from 1 up to the number of columns you want to unpivot, like this:
WITH     cntr     AS
     SELECT     LEVEL     AS n
     FROM     dual
     CONNECT BY     LEVEL <= 3     -- Number of columns to be unpivoted
SELECT       s.bu_id
,       s.prod_id
,       CASE  c.n
          WHEN  1  THEN  'total_clients'
          WHEN  2  THEN  'total_men'
          WHEN  3  THEN  'total_women'
       END          AS client_info
,       CASE  c.n
          WHEN  1  THEN  total_clients
          WHEN  2  THEN  total_men
          WHEN  3  THEN  total_women
       END          AS values
FROM            source_table  s
CROSS JOIN     cntr           c
ORDER BY  s.bu_id
,            s.prod_id
,       c.n
;If you'd care to post CREATE TABLE and INSERT statements for your sample data, then I could test this.
The values column that you create can only have 1 data type. If the original, unpivoted columns have different data types, you may need to convert some of them in the CASE expression that defines values.

Similar Messages

  • Columns to rows in oracle 10g

    Hi,
      I need the output from columns to rows in oracle 10g.
    this is my original output using some select query,
    select a.created_by,b.modified_by from created_tp a,modified_tp b where a.col_id=b.col_id.
    created_by       modified_by
    Siva                 Raja
    but i need this same output by rows like
    user--anything fine
    Siva
    Raja
    Thanks
    Siva

    Hi,
    select case l when 1 then a.created_by
    else b.modified end
    from created_tp a,modified_tp b, (select level l from dual connect by level <= 2)
    where a.col_id=b.col_id.

  • Convert columns to row equivalent to stragg function in oracle sql

    Hi,
    Sorry i forgot my Oracle version :
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 64-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - ProductionI searched in google but i didn't found the solution.
    I looking for a function in discoverer equivalent to stragg sql function.
    Note : stragg function convert columns to rows.
    Thanks
    SELECT   deptno, stragg ('-' || ename)
        FROM emp_test
    GROUP BY deptno;
        DEPTNO STRAGG_STR                                                 
            10 -CLARK-KING-MILLER                                         
            20 -SMITH-FORD-ADAMS-SCOTT-JONES                              
            30 -ALLEN-BLAKE-MARTIN-TURNER-JAMES-WARD                      
    3 rows selected.Edited by: Salim Chelabi on 2010-01-29 08:32

    Hi again,
    *1- I created  my function in my schema.*
    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;
    SHOW ERRORS
    *2- I ran my query in my schema with sqlplus.*
    SELECT deptno,ename,sal, string_agg(ename)over(partition by deptno) AS employees
    FROM   emp_test
    order by deptno;
        DEPTNO ENAME             SAL EMPLOYEES                                        
            10 CLARK            2450 CLARK,KING,MILLER                                
            10 KING             5000 CLARK,KING,MILLER                                
            10 MILLER           1300 CLARK,KING,MILLER                                
            20 JONES            2975 JONES,FORD,ADAMS,SMITH,SCOTT                     
            20 FORD             3000 JONES,FORD,ADAMS,SMITH,SCOTT                     
            20 ADAMS            1100 JONES,FORD,ADAMS,SMITH,SCOTT                     
            20 SMITH             800 JONES,FORD,ADAMS,SMITH,SCOTT                     
            20 SCOTT            3000 JONES,FORD,ADAMS,SMITH,SCOTT                     
            30 WARD             1250 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN             
            30 TURNER           1500 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN             
            30 ALLEN            1600 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN             
            30 JAMES             950 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN             
            30 BLAKE            2850 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN             
            30 MARTIN           1250 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN             
    14 rows selected.
    *3- I import this function in discoverer administration*
    4- My problem :When i use the function string_agg(ename)over(partition by deptno) in discover deskto i got the error you can't use over in this place.
    Any ideas.
    Thank in advance.
    Regards Salim.

  • How to convert varchar to BLOB in oracle 10g?

    Hi all,
    I have 2 columns A and B which are of varchar2(2000) dataype.
    I would like to concatinate these 2 columns and convert them into BLOB in oracle 10g.
    Any help is appreciated.
    Regards,
    Ravi

    don't use BLOB to store large text, use CLOB instead
    anyway:
    SQL> create table test
      2  (txt varchar2(10)
      3  ,other varchar2(10)
      4  );
    Table created.
    SQL>
    SQL> insert into test values ('some text', 'other text');
    1 row created.
    SQL>
    SQL> create table test2
      2  (col blob)
      3  /
    Table created.
    SQL>
    SQL> insert into test2
      2  select utl_raw.cast_to_raw (txt||other)
      3    from test
      4  /
    1 row created.
    SQL> select *
      2    from test2
      3  /
    SP2-0678: Column or attribute type can not be displayed by SQL*Plus
    SQL>
    SQL> select utl_raw.cast_to_varchar2(col)
      2    from test2
      3  /
    UTL_RAW.CAST_TO_VARCHAR2(COL)
    some textother text
    SQL>
    SQL> drop table test
      2  /
    Table dropped.
    SQL> drop table test2
      2  /
    Table dropped.

  • Columns Display Support in Oracle 10g Express Edition..................

    I am working with the Oracle 10g Express Edition, and I Created a Table with 52 Fields and even successfully inserted data into the table via Java Program. But the problem is when I am displaying the table from the Oracle 10g Express Edition Interface, it is displaying only first 31 Fields and displaying "<div class="fielddata">First 31 columns displayed.</div>". What should i do if I want to display all the 52 columns. Awaiting for the Reply. Thank You..

    duplicate post
    Columns Display Support in Oracle 10g Express Edition..................

  • 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 convert column to row in 10g  and calculate the count

    876602 wrote:
    Hi ,
    i need to convert the column to row in my DB 10g , i cant use the Decode method because i have about 2000 items in MDN column
    this is sample of my date ,
    MDN             Date
    5C4CA98EABA3     20111205235240
    5C4CA98EABA3     20110925121833
    5C4CA98EABB0     20111025103700
    5C4CA98EABB0     20111124103700
    5C4CA98EABB5     20111030175717
    5C4CA98EABB8     20110925142653
    5C4CA98EABB8     20111126175853i need the result to be ,
    MDN             Date                                   count
    5C4CA98EABA3     20111205235240 ;  20110925121833    2
    5C4CA98EABB0     20111025103700 ;  20111124103700    2
    5C4CA98EABB5    20111030175717                      1
    5C4CA98EABB8   20110925142653 ; 20111126175853       2any help please ,
    Edited by: 876602 on 15/12/2011 01:33 ص

    SQL> with t as
      2  (
      3  select '5C4CA98EABA3' MDN ,'20111205235240' Dte  from dual
      4  union all
      5  select '5C4CA98EABA3','20110925121833' from dual
      6  union all
      7  select '5C4CA98EABB0','20111025103700' from dual
      8  union all
      9  select '5C4CA98EABB0','20111124103700' from dual
    10  union all
    11  select '5C4CA98EABB5','20111030175717' from dual
    12  union all
    13  select '5C4CA98EABB8','20110925142653' from dual
    14  union all
    15  select '5C4CA98EABB8','20111126175853' from dual
    16  )
    17  select mdn,ltrim(sys_connect_by_path(dte,';'),';') s,rw as "count"
    18  from
    19  (
    20  select mdn,dte,row_number() over(partition by mdn order by mdn) rw
    21  from t
    22  )
    23  where connect_by_isleaf = 1
    24  start with rw = 1
    25  connect by prior rw = rw-1
    26  and prior mdn = mdn
    27  ;
    MDN          S                                                                                     count
    5C4CA98EABA3 20111205235240;20110925121833                                                             2
    5C4CA98EABB0 20111025103700;20111124103700                                                             2
    5C4CA98EABB5 20111030175717                                                                            1
    5C4CA98EABB8 20110925142653;20111126175853                                                             2

  • How to convert column to row in 10g

    Hi ,
    i need to convert the column to row in my DB 10g , i cant use the Decode method because i have about 2000 items in MDN column
    this is sample of my date ,
    MDN             Date
    5C4CA98EABA3     20111205235240
    5C4CA98EABA3     20110925121833
    5C4CA98EABB0     20111025103700
    5C4CA98EABB0     20111124103700
    5C4CA98EABB5     20111030175717
    5C4CA98EABB8     20110925142653
    5C4CA98EABB8     20111126175853i need the result to be ,
    MDN             Date
    5C4CA98EABA3     20111205235240 ;  20110925121833 
    5C4CA98EABB0     20111025103700 ;  20111124103700
    5C4CA98EABB5    20111030175717
    5C4CA98EABB8   20110925142653 ; 20111126175853any help please ,
    Edited by: 876602 on 15/12/2011 01:33 ص

    Note the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions)*", so only for issues with the SQL Developer tool. Please post these questions under the dedicated {forum:id=75} forum.
    Regards,
    K.

  • Converting Column to Rows

    Hello,
    I am trying to build and SQL to convert columns from multiple rows to the all rows - see below test data and result expected:
    CREATE TABLE XX_TEST(NAME VARCHAR2(10),A1 VARCHAR2(10),A2 VARCHAR2(10), A3 VARCHAR2(10),A4 VARCHAR2(10),A5 VARCHAR2(10));
    INSERT INTO XX_TEST VALUES('LIST','A','B','C','D','E');
    INSERT INTO XX_TEST VALUES('L1','1',NULL,'3',NULL,NULL);
    INSERT INTO XX_TEST VALUES('L2','1','5','4',NULL,NULL);
    COMMIT
    SELECT * FROM XX_TEST;
    Result expected:
    NAME is Column from table XX_TEST but COLUMN and VALUE are the columns converted to rows-
    NAME COLUMN VALUE
    L1 A1 1
    L1 A2 NULL
    L1 A3 3
    L1 A4 NULL
    L1 A5 NULL
    L2 A1 1
    L2 A2 5
    L2 A3 4
    L2 A4 NULL
    L2 A5 NULL
    Thanks
    BS

    Hi,
    Thanks for posting the sample data in such a useful form!
    Whenever you post a question, you should always say what version of Oracle you're using, too.
    Displaying multiple columns from one row as one column on multiple rows is called Unpivoting .
    In Oracle 11, you can use the SELECT ... UNPIVOT feature to do that.
    In any version of Oracle, you can cross-join your table to a Counter that has as many rows as your original table has columns to be unpivoted.
    In this problem, we need a self-join of the unpivoted data, to join the rows with name='LIST' to every other row.
    WITH     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL     <= 5
    ,     unpivoted_xx_test     AS
         SELECT     x.name
         ,     'A' || c.n     AS col
         ,     CASE  c.n
                   WHEN 1     THEN x.a1
                   WHEN 2     THEN x.a2
                   WHEN 3     THEN x.a3
                   WHEN 4     THEN x.a4
                   WHEN 5     THEN x.a5
              END          AS val
         FROM          cntr     c
         CROSS JOIN     xx_test     x
    SELECT       u.name
    ,       u.col
    ,       l.val          AS val1
    ,       u.val          AS val2
    FROM       unpivoted_xx_test     l
    JOIN       unpivoted_xx_test     u  ON     l.col     = u.col
    WHERE       l.name     =  'LIST'
    AND       u.name     != 'LIST'
    ORDER BY  name
    ,       col
    ;Output:
    NAME       COL VAL1       VAL2
    L1         A1  A          1
    L1         A2  B
    L1         A3  C          3
    L1         A4  D
    L1         A5  E
    L2         A1  A          1
    L2         A2  B          5
    L2         A3  C          4
    L2         A4  D
    L2         A5  EThe query above uses some features that were new in Oracle 9, but the basic strategy will work in earlier versions.
    If your columns don't have such regular names (A1, A2, A3, ...) then you can use another CASE expression to derive unpivoted_xx_test.col.

  • Problem in Converting Database into Archivelog mode (Oracle 10G)

    Hi Team,
    I come across a strange problem in the ORACLE 10G Server.
    I am converting database mode from NoArchivelog to Archivelog mode through RMAN in 10G.
    Now When I execute these following commands through RMAN prompt it works properly as shown below?
    C:\>rman
    Recovery Manager: Release 10.2.0.1.0 - Production on Thu Nov 30 18:01:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    RMAN> connect target /
    connected to target database: RAVI (DBID=4025722893, not open)
    RMAN> shutdown immediate;
    using target database control file instead of recovery catalog
    database dismounted
    Oracle instance shut down
    RMAN> STARTUP MOUNT;
    connected to target database (not started)
    Oracle instance started
    database mounted
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 79693180 bytes
    Database Buffers 79691776 bytes
    Redo Buffers 7139328 bytes
    RMAN> SQL 'ALTER DATABASE ARCHIVELOG';
    sql statement: ALTER DATABASE ARCHIVELOG
    RMAN> ALTER DATABASE OPEN;
    database opened
    RMAN>
    But this same script when i writes in the backup.ora file & pass to Rman prompt it fails,
    File backup.ora contains...
    run
    SHUTDOWN IMMEDIATE;
    STARTUP MOUNT;
    SQL 'ALTER DATABASE ARCHIVELOG';
    ALTER DATABASE OPEN;
    passed to RMAN as follows...
    C:\OracleCode\BACKUP>"C:\oracle\product\10.2.0\db_1\bin\RMAN.EXE" target /"connect target SYSTEM/sreedhar@RAVI" log="C:\ORACLE~2\LOGS\backup_log.log" append cmdfile="C:\ORACLE~2\BACKUP\backup.ora"
    RMAN> 2> 3> 4> 5> 6> 7> 8>
    then it fails giving the following errors...
    using target database control file instead of recovery catalog
    database closed
    database dismounted
    Oracle instance shut down
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of startup command at 11/30/2006 18:05:59
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    Recovery Manager complete.
    The same thing is working in the Oracle 9i but not in the Oracle 10G.
    Can Anybody plz help me in this?
    Regards,
    S.Tiwari
    .

    export ORACLE_SID=<SID>
    rman target /cmdfile="C:\ORACLE~2\BACKUP\backup.ora"
    it will connect to the default SID, there's no such thing as a default SID, what do you mean?
    But what if there are more that one SID available & I
    want to connect to SID other than the default SID.just specify the desired SID prior starting rman.
    more over the same string is working with 9i but not
    with 10G.maybe due to a bug?
    to summarize, you have two options it you would like to start up the instance:
    either you specify the SID prior starting rman and use os authentication
    or
    you register the instance statically and use oracle authentication.
    regards,
    -ap

  • Need help with query for converting columns to rows

    Hello,
    I know this is a very common question asked in the forum. I have searched regading this, i did find some threads, but i was not able to achieve what i require from the answers posted. So anybody please help me.
    I have a table which is having multiple columns as follows:
    Insert into table_1 (X,Y,Z,A,B,C,D,E,F,G,H,I) values (0,0,2,0,0,1,3,0,0,0,0,0);I want to convert the result into a two column, multiple rows i.e., I want the result as follows:
    Col1 Col2
    X      0
    Y     0
    Z      2
    A     0
    B     0
    C     1
    D     3
    E     0
    F     0
    G     0
    H     0
    I      0Please anybody help me in writing the query for this..

    Is this what you are expecting:
    SQL> WITH T AS
      2  (
      3  SELECT 0 X, 0 Y, 2 Z, 0 A, 0 B, 1 C, 3 D, 0 E, 0 F, 0 G, 0 H, 0 I FROM DUAL
      4  )
      5  SELECT  'X' col1, X col2 FROM T
      6  UNION ALL
      7  SELECT  'Y' col1, Y col2 FROM T
      8  UNION ALL
      9  SELECT  'Z' col1, Z col2 FROM T
    10  UNION ALL
    11  SELECT  'A' col1, A col2 FROM T
    12  UNION ALL
    13  SELECT  'B' col1, B col2 FROM T
    14  UNION ALL
    15  SELECT  'C' col1, C col2 FROM T
    16  UNION ALL
    17  SELECT  'D' col1, D col2 FROM T
    18  UNION ALL
    19  SELECT  'E' col1, E col2 FROM T
    20  UNION ALL
    21  SELECT  'F' col1, F col2 FROM T
    22  UNION ALL
    23  SELECT  'G' col1, G col2 FROM T
    24  UNION ALL
    25  SELECT  'H' col1, H col2 FROM T
    26  UNION ALL
    27  SELECT  'I' col1, I col2 FROM T
    28  /
    C       COL2                                                                   
    X          0                                                                   
    Y          0                                                                   
    Z          2                                                                   
    A          0                                                                   
    B          0                                                                   
    C          1                                                                   
    D          3                                                                   
    E          0                                                                   
    F          0                                                                   
    G          0                                                                   
    H          0                                                                   
    C       COL2                                                                   
    I          0                                                                   
    12 rows selected.

  • How to convert columns to rows

    I have 70 columns and I need to convert them into rows. Please help!
    Currently, it is showing as listed below
    message 1 message 2 message 3 message 4 message 5 .......... message 70
    system 1 20 10 40 60 100
    system 2 40 30 50 80 110
    system 3 60 60 70 90 120
    The desire output
    system 1 system 2 system 3
    message 1 20 40 60
    message 2 10 30 60
    message 3 40 50 70
    message 70

    Something like...
    SQL> ed
    Wrote file afiedt.buf
      1  select decode(rn,1,'Empno :'||empno
      2                  ,2,'Ename ('||empno||') :'||ename
      3                  ,3,'Job ('||empno||') :'||job
      4               ) as col
      5  from emp
      6       cross join (select rownum rn from dual connect by rownum <= 3)
      7* order by empno, rn
    SQL> /
    COL
    Empno :7369
    Ename (7369) :SMITH
    Job (7369) :CLERK
    Empno :7499
    Ename (7499) :ALLEN
    Job (7499) :SALESMAN
    Empno :7521
    Ename (7521) :WARD
    Job (7521) :SALESMAN
    Empno :7566
    Ename (7566) :JONES
    Job (7566) :MANAGER
    Empno :7654
    Ename (7654) :MARTIN
    Job (7654) :SALESMAN
    Empno :7698
    Ename (7698) :BLAKE
    Job (7698) :MANAGER
    Empno :7782
    Ename (7782) :CLARK
    Job (7782) :MANAGER
    Empno :7788
    Ename (7788) :SCOTT
    Job (7788) :ANALYST
    Empno :7839
    Ename (7839) :KING
    Job (7839) :PRESIDENT
    Empno :7844
    Ename (7844) :TURNER
    Job (7844) :SALESMAN
    Empno :7876
    Ename (7876) :ADAMS
    Job (7876) :CLERK
    Empno :7900
    Ename (7900) :JAMES
    Job (7900) :CLERK
    Empno :7902
    Ename (7902) :FORD
    Job (7902) :ANALYST
    Empno :7934
    Ename (7934) :MILLER
    Job (7934) :CLERK
    42 rows selected.

  • ExtStringTemplate Warning while Converting a SQLServer DB to Oracle 10g

    Hi everyone,
    I hope this is the right Forum to ask about this. I apologize if I misplaced it
    I am currently having some trouble with the migration of a MSSQL Database (2000 with all its stored Procedures) to ORACLE 10g. I am using the offline Capture Method to generate the captured Model without any errors or warnings.
    But as soon as I convert the Captured Model to the ORACLE Model I get a bunch of Warning Messages that read as follows:
    Oracle.dbtools.migration.parser.ext.ExtStringTemplate.setValue(ExtStringTemplate.java:134)
    Clicking on Details does not give any further clues on which Object caused it during conversion.
    During the last few Days I tried to find Information about this Warning Message searching several Blogs and Forums, but to no avail.
    I would like to know how I could solve this problem or if it even might influence the applications later on that are supposed to work with the converted Database.
    Any help with this is highly appreciated
    Here some Information about the test Environment:
    System specs:
    Oracle runs in A Virtual Box Dev-Environment with Win2k3 as Guest OS
    VirtualBox: 3.0.10 r54097
    ORACLE Database 10g r 2
    SQL Developer     Info
    Oracle SQL Developer 2.1.0.62
    Version 2.1.0.62
    Build MAIN-62.61
    Copyright © 2005, 2009, Oracle. All Rights Reserved. Alle Rechte vorbehalten.
    IDE Version: 11.1.1.2.36.54.96
    Product ID: oracle.sqldeveloper
    Product Version: 11.1.1.62.61
    Version
    Komponente     Version
    ==========     =======
    Java(TM)-Plattform     1.6.0_11
    Oracle-IDE     2.1.0.62.61
    Versionierungsunterstützung     2.1.0.62.61
    Eigenschaften
    Name     Wert
    ====     ====
    apple.laf.useScreenMenuBar     true
    awt.toolkit     sun.awt.windows.WToolkit
    class.load.environment     oracle.ide.boot.IdeClassLoadEnvironment
    class.load.log.level     CONFIG
    class.transfer     delegate
    com.apple.macos.smallTabs     true
    com.apple.mrj.application.apple.menu.about.name     "SQL_Developer"
    com.apple.mrj.application.growbox.intrudes     false
    file.encoding     Cp1252
    file.encoding.pkg     sun.io
    file.separator     \
    ice.browser.forcegc     false
    ice.pilots.html4.ignoreNonGenericFonts     true
    ice.pilots.html4.tileOptThreshold     0
    ide.AssertTracingDisabled     true
    ide.bootstrap.start     1174433566556
    ide.build     MAIN-62.61
    ide.conf     C:\Programme\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
    ide.config_pathname     C:\Programme\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
    ide.debugbuild     false
    ide.devbuild     false
    ide.extension.search.path     sqldeveloper/extensions:jdev/extensions:ide/extensions
    ide.firstrun     true
    ide.java.minversion     1.6.0_04
    ide.launcherProcessId     2636
    ide.main.class     oracle.ide.boot.IdeLauncher
    ide.patches.dir     ide/lib/patches
    ide.pref.dir     C:\Dokumente und Einstellungen\Administrator\Anwendungsdaten\SQL Developer
    ide.pref.dir.base     C:\Dokumente und Einstellungen\Administrator\Anwendungsdaten
    ide.product     oracle.sqldeveloper
    ide.shell.enableFileTypeAssociation     C:\Programme\sqldeveloper\sqldeveloper.exe
    ide.splash.screen     splash.gif
    ide.startingArg0     C:\Programme\sqldeveloper\sqldeveloper.exe
    ide.startingcwd     C:\Dokumente und Einstellungen\Administrator\Desktop
    ide.user.dir     C:\Dokumente und Einstellungen\Administrator\Anwendungsdaten\SQL Developer
    ide.user.dir.var     IDE_USER_DIR
    ide.work.dir     C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\SQL Developer
    ide.work.dir.base     C:\Dokumente und Einstellungen\Administrator\Eigene Dateien
    java.awt.graphicsenv     sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob     sun.awt.windows.WPrinterJob
    java.class.path     ..\..\ide\lib\ide-boot.jar
    java.class.version     50.0
    java.endorsed.dirs     C:\Programme\sqldeveloper\jdk\jre\lib\endorsed
    java.ext.dirs     C:\Programme\sqldeveloper\jdk\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
    java.home     C:\Programme\sqldeveloper\jdk\jre
    java.io.tmpdir     C:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\
    java.library.path     C:\Programme\sqldeveloper;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oracle\product\10.2.0\db_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\Microsoft SQL Server\100\Tools\Binn\;C:\Programme\Microsoft SQL Server\100\DTS\Binn\;C:\Programme\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Programme\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\WINDOWS\system32\WindowsPowerShell\v1.0
    java.naming.factory.initial     oracle.javatools.jndi.LocalInitialContextFactory
    java.runtime.name     Java(TM) SE Runtime Environment
    java.runtime.version     1.6.0_11-b03
    java.specification.name     Java Platform API Specification
    java.specification.vendor     Sun Microsystems Inc.
    java.specification.version     1.6
    java.util.logging.config.file     logging.conf
    java.vendor     Sun Microsystems Inc.
    java.vendor.url     http://java.sun.com/
    java.vendor.url.bug     http://java.sun.com/cgi-bin/bugreport.cgi
    java.version     1.6.0_11
    java.vm.info     mixed mode
    java.vm.name     Java HotSpot(TM) Client VM
    java.vm.specification.name     Java Virtual Machine Specification
    java.vm.specification.vendor     Sun Microsystems Inc.
    java.vm.specification.version     1.0
    java.vm.vendor     Sun Microsystems Inc.
    java.vm.version     11.0-b16
    jdbc.library     /C:/Programme/sqldeveloper/jdbc/lib/ojdbc5.jar
    line.separator     \r\n
    oracle.home     C:\Programme\sqldeveloper
    oracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG     true
    oracle.jdbc.Trace     true
    oracle.translated.locales     de,es,fr,it,ja,ko,pt_BR,zh_CN,zh_TW
    oracle.xdkjava.compatibility.version     9.0.4
    orai18n.library     /C:/Programme/sqldeveloper/jlib/orai18n.jar
    os.arch     x86
    os.name     Windows 2003
    os.version     5.2
    path.separator     ;
    reserved_filenames     con,aux,prn,lpt1,lpt2,lpt3,lpt4,lpt5,lpt6,lpt7,lpt8,lpt9,com1,com2,com3,com4,com5,com6,com7,com8,com9,conin$,conout,conout$
    sqldev.debug     false
    sun.arch.data.model     32
    sun.boot.class.path     C:\Programme\sqldeveloper\jdk\jre\lib\resources.jar;C:\Programme\sqldeveloper\jdk\jre\lib\rt.jar;C:\Programme\sqldeveloper\jdk\jre\lib\sunrsasign.jar;C:\Programme\sqldeveloper\jdk\jre\lib\jsse.jar;C:\Programme\sqldeveloper\jdk\jre\lib\jce.jar;C:\Programme\sqldeveloper\jdk\jre\lib\charsets.jar;C:\Programme\sqldeveloper\jdk\jre\classes
    sun.boot.library.path     C:\Programme\sqldeveloper\jdk\jre\bin
    sun.cpu.endian     little
    sun.cpu.isalist     pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
    sun.desktop     windows
    sun.io.unicode.encoding     UnicodeLittle
    sun.java2d.ddoffscreen     false
    sun.jnu.encoding     Cp1252
    sun.management.compiler     HotSpot Client Compiler
    sun.os.patch.level     Service Pack 2
    svnkit.sax.useDefault     true
    user.country     DE
    user.dir     C:\Programme\sqldeveloper\sqldeveloper\bin
    user.home     C:\Dokumente und Einstellungen\Administrator
    user.language     de
    user.name     Administrator
    user.timezone     Europe/Berlin
    user.variant     
    windows.shell.font.languages     
    Erweiterungen
    Name     Identifier     Version     Status
    ====     ==========     =======     ======
    Audit     oracle.ide.audit     11.1.1.2.36.54.96     Geladen
    Check For Updates     oracle.ide.webupdate     11.1.1.2.36.54.96     Geladen
    Code Editor     oracle.ide.ceditor     11.1.1.2.36.54.96     Geladen
    Datenbank-UI     oracle.ide.db     11.1.1.2.36.54.96     Geladen
    Datenbankobjekt-Explorer     oracle.ide.db.explorer     11.1.1.2.36.54.96     Geladen
    Diff/Merge     oracle.ide.diffmerge     11.1.1.2.36.54.96     Geladen
    Extended IDE Platform     oracle.javacore     11.1.1.2.36.54.96     Geladen
    Externe Tools     oracle.ide.externaltools     11.1.1.2.36.54.96     Geladen
    File Support     oracle.ide.files     11.1.1.2.36.54.96     Geladen
    File System Navigator     oracle.sqldeveloper.filenavigator     11.1.1.62.61     Geladen
    Help System     oracle.ide.help     11.1.1.2.36.54.96     Geladen
    Import/Export Support     oracle.ide.importexport     11.1.1.2.36.54.96     Geladen
    Index Migrator support     oracle.ideimpl.indexing-migrator     11.1.1.2.36.54.96     Geladen
    JDeveloper Runner     oracle.jdeveloper.runner     11.1.1.2.36.54.96     Geladen
    Log Window     oracle.ide.log     11.1.1.2.36.54.96     Geladen
    Navigator     oracle.ide.navigator     11.1.1.2.36.54.96     Geladen
    Object Viewer     oracle.sqldeveloper.oviewer     11.1.1.62.61     Geladen
    Objektgalerie     oracle.ide.gallery     11.1.1.2.36.54.96     Geladen
    Oracle Data Modeler Reports     oracle.sqldeveloper.datamodeler_reports     11.1.1.62.61     Geladen
    Oracle Database Browser     oracle.sqldeveloper.thirdparty.browsers     11.1.1.62.61     Geladen
    Oracle IDE     oracle.ide     11.1.1.2.36.54.96     Geladen
    Oracle SQL Developer     oracle.sqldeveloper     11.1.1.62.61     Geladen
    Oracle SQL Developer Data Modeler Viewer     oracle.datamodeler     2.0.0.574     Geladen
    Oracle SQL Developer Extras     oracle.sqldeveloper.extras     1.1.1.62.61     Geladen
    Oracle SQL Developer Migrations     oracle.sqldeveloper.migration     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - Antlr3 Translation Core     oracle.sqldeveloper.migration.translation.core_antlr3     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - DB2     oracle.sqldeveloper.migration.db2     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - Microsoft Access     oracle.sqldeveloper.migration.msaccess     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - MySQL     oracle.sqldeveloper.migration.mysql     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - SQLServer     oracle.sqldeveloper.migration.sqlserver     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - Sybase     oracle.sqldeveloper.migration.sybase     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - Teradata     oracle.sqldeveloper.migration.teradata     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - Translation Core     oracle.sqldeveloper.migration.translation.core     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - Translation Db2     oracle.sqldeveloper.migration.translation.db2     11.1.1.62.61     Geladen
    Oracle SQL Developer Migrations - Translation UI     oracle.sqldeveloper.migration.translation.gui     11.1.1.62.61     Geladen
    Oracle SQL Developer Reports     oracle.sqldeveloper.report     11.1.1.62.61     Geladen
    Oracle SQL Developer SearchBar     oracle.sqldeveloper.searchbar     11.1.1.62.61     Geladen
    Oracle SQL Developer TimesTen     oracle.sqldeveloper.timesten     2.0.0.62.61     Geladen
    Oracle SQL Developer Unit Test     oracle.sqldeveloper.unit_test     11.1.1.62.61     Geladen
    Oracle SQL Developer Worksheet     oracle.sqldeveloper.worksheet     11.1.1.62.61     Geladen
    Oracle XML Schema Support     oracle.sqldeveloper.xmlschema     11.1.1.62.61     Geladen
    PROBE Debugger     oracle.jdeveloper.db.debug.probe     11.1.1.2.36.54.96     Geladen
    Peek     oracle.ide.peek     11.1.1.2.36.54.96     Geladen
    Persistent Storage     oracle.ide.persistence     11.1.1.2.36.54.96     Geladen
    QuickDiff     oracle.ide.quickdiff     11.1.1.2.36.54.96     Geladen
    Replace With     oracle.ide.replace     11.1.1.2.36.54.96     Geladen
    Runner     oracle.ide.runner     11.1.1.2.36.54.96     Geladen
    Snippet Window     oracle.sqldeveloper.snippet     11.1.1.62.61     Geladen
    Sql Monitoring Project     oracle.sqldeveloper.sqlmonitor     11.1.1.62.61     Geladen
    Tuning     oracle.sqldeveloper.tuning     11.1.1.62.61     Geladen
    Unterstützung von Datenbankverbindungen     oracle.jdeveloper.db.connection     11.1.1.2.36.54.96     Geladen
    Unterstützung von Historie     oracle.jdeveloper.history     11.1.1.2.36.54.96     Geladen
    VHV     oracle.ide.vhv     11.1.1.2.36.54.96     Geladen
    Versionierungsunterstützung     oracle.jdeveloper.vcs     11.1.1.2.36.54.96     Geladen
    Versionierungsunterstützung für Subversion     oracle.jdeveloper.subversion     11.1.1.2.36.54.96     Geladen
    Virtual File System     oracle.ide.vfs     11.1.1.2.36.54.96     Geladen
    Web Browser and Proxy     oracle.ide.webbrowser     11.1.1.2.36.54.96     Geladen
    oracle.ide.indexing     oracle.ide.indexing     11.1.1.2.36.54.96     Geladen

    Thank you very much for your Reply.
    Sorry that I couldn't write earlier.
    --Does this stop your Oracle Model from being converted?
    The conversion process completes with a few errors that I'm going to fix by hand.
    --Is there anymore to the Exception ?
    Concerning the Details button: When I click Details it only shows the same exception Message as posted above. Unfortunatly no stacktrace. But maybe there is some kind of logfile outside the IDE which I am not aware of yet, since I am rather new to working with sql developer. If you could point me to the stacktrace I will be happy to post it here.
    --Can you skim through some of your converted procedures to see if anything stands out
    I did as you suggested. There was a strange behaviour in a Procedure where there was a construct like N'<somestring>' in the original Transact SQL. Somehow every SQL statement that follows is recognized as a String, hence the code is not compiling at all.
    There are also some Prcedures which exit with the message: "unexpected end of Subtree"
    Edited by: gWahl on 13.11.2009 00:43

  • Converting columns to row

    Hi,
    I have 6 columns and 4 rows and i want to convert it into 6 rows and 4 columns and want to display in table control.
    plz help me in this ....

    Hi Kinjal,
       Question is not clear. You want to change the internal table values with 6 columns & 4 rows to 4 columns & 6 rows?
    If my understanding is correct, check the bleow logic:
    loop at itab1.
    case sy-tabix.
      when 1.
       itab2-c1 = itab1-c1.
       append itab2.
       itab2-c1 = itab1-c2.
       append itab2.
       itab2-c1 = itab1-c3.
       append itab2.
       itab2-c1 = itab1-c4.
       append itab2.
       itab2-c1 = itab1-c5.
       append itab2.
       itab2-c1 = itab1-c6.
       append itab2.
    when 2.
      itab2-c2 = itab1-c1.
      modify itab2 transporting c2 index 1.
      itab2-c2 = itab1-c2.
      modify itab2 transporting c2 index 2.
      itab2-c2 = itab1-c3.
      modify itab2 transporting c2 index 3.
      itab2-c2 = itab1-c4.
      modify itab2 transporting c2 index 4.
      itab2-c2 = itab1-c5.
      modify itab2 transporting c2 index 5.
      itab2-c2 = itab1-c6.
      modify itab2 transporting c2 index 6.
    when 3.
       itab2-c3 = itab1-c1.
      modify itab2 transporting c3 index 1.
    when 4.
       itab2-c4 = itab1-c1.
      modify itab2 transporting c4 index 1.
    Endloop.
    Finally you will get 6 rows with 4 coulmns.

  • 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                                                   

Maybe you are looking for