can oracle types be updated like tables?

Posted by Omnipresent on Stack Overflow See other posts from Stack Overflow or by Omnipresent
Published on 2010-06-14T16:27:53Z Indexed on 2010/06/15 9:22 UTC
Read the original article Hit count: 254

Filed under:
|

I am converting GTT's to oracle types as explained in an excellent answer by APC. however, some GTT's are being updated based on a select query from another table. For example:

UPDATE my_gtt_1 c
   SET (street, city, STATE, zip) = (SELECT src.unit_address,
                                            src.unit_city,
                                            src.unit_state,
                                            src.unit_zip_code
                                       FROM (SELECT mbr.ROWID row_id,
                                                    unit_address,
                                                    RTRIM(a.unit_city) unit_city,
                                                    RTRIM(a.unit_state) unit_state,
                                                    RTRIM(a.unit_zip_code) unit_zip_code
                                               FROM table_1        b,
                                                    table_2          a,
                                                    my_gtt_1 mbr
                                              WHERE type = 'ABC'
                                                AND id = b.ssn_head
                                                AND a.h_id = b.h_id
                                                AND row_id >= v_start_row
                                                AND row_id <= v_end_row) src
                                      WHERE c.ROWID = src.row_id)
 WHERE state IS NULL
    OR state = ' ';

if my_gtt_1 was not a global temporary table but an oracle collection type then is it possible to do updates this complex? Or in these cases we are better off using the global temporary table?

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about plsql