Subject RE: [firebird-support] Basic Firebird SQL question
Author Tim Gahnström
> -----Original Message-----
> From: Myles Wakeham [mailto:myles@...]
> I have a table in Firebird of 'Parts' and a separate table of
> 'Warehouses'.
> I need to populate a table of 'Stock_On_Hand' that is
> basically a join table that resolves the many-to-many
> relationship of parts and warehouses.

> But I need to create a SQL Script that will take my current
> data in Parts & Warehouses and create these records for each
> corresponding row in these tables to initially populate this table.


I am not sure I have fully understood the question (it is always easier actuall examples of code and what the table definitions are) but you probably want to do something along the lines of:

Insert into Stock_On_Hand select Part.iPartNo, Warehouses.iWarehouseNo from Part outer join Warehouses on part.SomeField = warehouses.someOtherField

Tim