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

Home -> Community -> Usenet -> c.d.o.server -> Re: %rowtype

Re: %rowtype

From: Lucyna Witkowska <ypwitkow_at_nospamcyf-kr.edu.pl>
Date: Thu, 11 Sep 2003 09:47:37 +0000 (UTC)
Message-ID: <bjpgbp$91b$1@srv.cyf-kr.edu.pl>


jim agans <jwagans_at_yahoo.com> wrote:
> I have 2 tables defined exactly the same...is there a way I can use
> the %rowtype to facilitate this process?

> -- define record type
> --
> R_ccc_1 CCC_1%ROWTYPE;
> --
> -- insert this customer in to CCC_2 from CCC_1
> --
> SELECT(*) -- I need all the fields from here can I cheat and
> not put all fields in a list?
> INTO
> R_ccc_1
> from CCC_1
> WHERE CCC_1.CUSTOMER_NUMBER = V_CUST_NUMBER;
> --
> -- then insert in to the ccc_2 table
> --
> INSERT INTO
> CCC_2
> VALUES
> (R_CCC_1); -- can this be done?

No. But you can do:

INSERT INTO CCC_2 SELECT * FROM CCC_1
 WHERE CCC_1.CUSTOMER_NUMBER = V_CUST_NUMBER; Greetings,
LW Received on Thu Sep 11 2003 - 04:47:37 CDT

Original text of this message

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