Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2004
    Posts
    102

    Unanswered: Convert the column

    Hi All,

    I need your help.

    I have a table value
    ORD DAY LINE HOUR QTY
    ----- --------- ----- ---- ---------
    N022A 02-DEC-13 H 1 50
    N022A 02-DEC-13 H 2 60
    N022A 02-DEC-13 H 3 70
    N022A 02-DEC-13 H 4 80
    M826M 02-DEC-13 Z 1 20
    M826M 02-DEC-13 Z 2 30
    M826M 02-DEC-13 Z 3 30
    M826M 02-DEC-13 Z 4 30
    I need to display Data in the following way in form 6i

    ORD DAY LINE 1 2 3 4 5
    ----- --------- ----- ---- ---- ---- ---- ----
    N022A 02-DEC-13 H 50 60 70 80
    M826M 02-DEC-13 Z 20 30 30 30
    I'm using oracle 10g and developer 6i. it will be done in report 6i but i need to display in forms 6i. It will be very great full if anybody found the solution.

    Thanks in advance.
    Working Together...

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    "Pivot" is the keyword you are looking for.

  3. #3
    Join Date
    Jul 2004
    Posts
    102
    Thanks Littlefoot for your prompt response.

    is pivot support in form 6i ?

    it will be gr8 if you give me an example.
    Working Together...

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    6i is obsoleted & unsupported.
    It is past time to upgrade.
    Oracle Database Search Results: pivot
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Jul 2004
    Posts
    102
    Thanks anacedent.

    I got one solution using case, though it is a static. looking for some dynamic.
    Working Together...

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Dynamic, in Forms? You can't create data blocks dynamically (at least, I don't know how) as all items (that represent columns) have to be predefined. Therefore:
    - anticipate maximum number of columns
    - create a view using pivoting options available in your database version
    - create a block based on that view

  7. #7
    Join Date
    Jul 2004
    Posts
    102
    I have made It the following way

    select PROD_DT,LINE,PROCESS,ORDER_NUMBER,
    sum(case when prod_hr='1' then prod_qty end) as H1,
    sum(case when prod_hr='2' then prod_qty end) as H2,
    sum(case when prod_hr='3' then prod_qty end) as H3,
    sum(case when prod_hr='4' then prod_qty end) as H4
    from Daily_prod
    Group by PROD_DT,LINE,PROCESS,ORDER_NUMBER
    Here H1, H2,H3 & H4 are predefine. If any value is entered with prod_hr=5 then i have edit it again. I need that dynamically so there is no need to edit if 5,6.. are entered.
    Working Together...

  8. #8
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I understand what you are saying, but you don't understand what I am saying. Forms just can't do that.

  9. #9
    Join Date
    Jul 2004
    Posts
    102
    hmm......got your point.

    Thanks.
    Working Together...

Posting Permissions

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