Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Posts
    34

    Unanswered: how to get this select

    I have a scenario where i am receiving each column for a row in a separate row as column name value pair
    something like this


    table_name column_name value Jobid row_iden

    -- row 1 details

    t1 c1 101 21 1
    t1 c2 102 21 1
    t1 c3 103 21 1
    t1 c4 104 21 1
    t1 c5 105 21 1


    -- row 2 details
    t1 c1 201 21 1
    t1 c2 202 21 1
    t1 c3 203 21 1
    t1 c4 204 21 1
    t1 c5 205 21 1


    -- row 3 details
    t1 c1 301 21 1
    t1 c2 302 21 1
    t1 c3 303 21 1
    t1 c4 304 21 1
    t1 c5 305 21 1


    the data required to insert into another table is like this


    t/n c1 c2 c3 c4 c5 jobid
    === === === === === === =====

    t1 101 102 103 104 105 21
    t1 201 202 203 204 205 21
    t1 301 302 303 304 305 21


    Regards

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    From which school, class & instructor was this homework assignment made?

  3. #3
    Join Date
    Dec 2003
    Location
    Noida, India.
    Posts
    171

    Re: how to get this select

    Check if this helps:
    http://otn.oracle.com/oramag/code/tips2002/081802.html



    Originally posted by zulu99
    I have a scenario where i am receiving each column for a row in a separate row as column name value pair
    something like this


    table_name column_name value Jobid row_iden

    -- row 1 details

    t1 c1 101 21 1
    t1 c2 102 21 1
    t1 c3 103 21 1
    t1 c4 104 21 1
    t1 c5 105 21 1


    -- row 2 details
    t1 c1 201 21 1
    t1 c2 202 21 1
    t1 c3 203 21 1
    t1 c4 204 21 1
    t1 c5 205 21 1


    -- row 3 details
    t1 c1 301 21 1
    t1 c2 302 21 1
    t1 c3 303 21 1
    t1 c4 304 21 1
    t1 c5 305 21 1


    the data required to insert into another table is like this


    t/n c1 c2 c3 c4 c5 jobid
    === === === === === === =====

    t1 101 102 103 104 105 21
    t1 201 202 203 204 205 21
    t1 301 302 303 304 305 21


    Regards
    Oracle can do wonders !

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: how to get this select

    I wrote a similar utility myself a while ago - needn't have bothered if I had seen this link!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •