I have one Table A with 3 attributes: 

**ID (PK), UNIT(varchar2), VALUE(number)**

And I have another Table B that references the PK of Table A via a foreign key.

**ID, FK\_TABLE\_A**

In Table B are already records, but the value of the attribute **FK\_TABLE\_A** is null. What I want is, that all records in Table B get an **own unique reference** to Table A's PK by inserting new data into Table A and referencing the newly created primary key as foreign key into Table B.

What I have done so far:
I can now insert new data via following SQL:

```
INSERT INTO TABLE_A(ID, UNIT, VALUE) VALUES (TABKE_A_SEQ.nextval, 'SOME_STRING', 1);

```

And I can update by hand the refernce to Table B

```
UPDATE TABLE_B SET FK_TABLE_A = 123; //123 is just an example PK

```

But I do not want to query for each record everytime the DB, but instead want to combine somehow the first `insert` with the second `update` in one query. 
So that the update takes the newly created PK in Table A as reference.

Is this possible?

I am using Oracle as DB.