Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> how to add id to 2 tables
Hello,
I have been tasked with creating a Ora 9.2 db and loading some data
from a spreadsheet. Not quite sure how to do this. Well install db no
problem.
Currentlt the data looks like this:
NodeName varchar2(255)
Shelf int
Slot int
Port int
..
The cuuning plan is to have two tables:
NodeTable
Id int
NodeName
CircuitTable
Id int (?)
NodeID int
CircuitID varchar2(255)
Shelf int
Slot int
Port int
..
So for each of say 100-200 Nodes there will be say 1 to 100 Circuit
details to fill in (curently held in a spreadsheet).
The idea of the NodeTable, with generated Id, is to facilitate fast searching for a particular combination of Shelf/Slot/Port.
I am however unclear on how to populate these two tables. OK with SQL*Loader from comma separated vars (from spreadsheet) to the CircuitTable.
But what is the easy way of generating the NodeTable complete with Id? a trigger on insert or PL/SQL after all the CircuitTbale has been populated or ?
Must I use an number (aka int) for the Id?
More than happy to read any relevant fine manual BTW...
TIA Tony Received on Thu Sep 22 2005 - 03:05:16 CDT