Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> SQL / PLSQL help in conerting multiple rows into columns

SQL / PLSQL help in conerting multiple rows into columns

From: Baswannappa, Shiva <SXBaswan_at_dcss.com>
Date: Thu, 08 May 2003 09:26:49 -0800
Message-ID: <F001.00594046.20030508092649@fatcity.com>


Hi Every Guru

I rememeber to have seen this request in the list few months ago.

I have following to achieve

Table "vendor" has following columns:

site_code          (not null)
vendor_name        (not null)
vendor_number      (not null)
material_code      (not null)

Table "ATT" has following columns:

att_name
att_value
site_code

values stored in ATT table are

att_name       att_value     site_code     material_code
--------       ---------     ----------    -------------
vendor_name    abc           A             m1
vednor_number  xyz           A             m1
vendor_name    def           B             m2
vendor_number  ghi           B             m2

I need to insert values from ATT table into vendor table in one go per record. To do that, I need to convert ATT table multirows into single row for each of site code. Like

A, abc, xyz, m1
B, def, ghi, m2

Long shot thoughts are to use plsql tables, varrays manipulate and then insert/update the vendor table.

I may be able to convince the client to let me create additional table. The client does not want to or like to do that, as that involves whole process of getting approvals, validations etc.

The DB is oracle 9i ver 2. on HP-UX11

I appreciate "Any" thoughts leading to solution.

Regards

Shiva

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Baswannappa, Shiva
  INET: SXBaswan_at_dcss.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu May 08 2003 - 12:26:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US