SQL Experts Only
Date: 1996/08/06
Message-ID: <MPLANET.3207f769kennedy989685_at_news.enteract.com>#1/1
Here is my dilema...
I have two tables in production that appear as shown below:
SQL> desc TABLE_A
Currently, only TABLE_A is populated and TABLE_B is a new table. I need
to insert an entry in TABLE_B for each row in TABLE_A. If there are 30
rows in TABLE_A, I need to insert 30 rows in the new table. The
IDENTIFIER_ID is a sequence number (SOME_SEQ) and the FK_TABLE_A_ID is a
foreign key to TABLE_A.IDENTIFIER_ID.
Can I do the update through SQL? I know I can make the update writing a
quick C++/ODBC application, but I'd rather just use SQL.
Any help is greatly appreciated.
Name Null? Type
------------------------------- -------- ----
IDENTIFIER_ID NOT NULL NUMBER
SOME_FIELD_1 VARCHAR2(20)
SOME_FIELD_2 NUMBER
SQL> desc TABLE_B
Name Null? Type
------------------------------- -------- ----
IDENTIFIER_ID NOT NULL NUMBER
FK_TABLE_A_ID NUMBER
SOME_OTHER_FIELD VARCHAR2(20)
Ken Received on Tue Aug 06 1996 - 00:00:00 CEST