hi,
i'm hoping someone can offer some advice as to how to go about dynamic row insertion. i have a table filled with projects, & another table with associated phases (subprojects). there's a business rule that states that all projects *must* have a base phase - '.000', and unfortunatley, none of the projects (at time of import) in the database do.
e.g. Project Phase
98008 010
98008 020
etc
what i'd like to do is create a base phase record for each distinct project number in the projects table. i'm thinking that i should itterate through a resultset of distinct project values and simply do an insert in the phases table. however, quite a few posts in here have stated that cursors should be used as last resort. i also made the mistake of assuming that triggers would execute for each row insertion (in my case, i wanted the triggers to create the phase record when projects were imported during a batch process).
any thoughts on this? there's got to be a simple way to do this. many thanks in advance!
..:: mirirom ::..
i'm hoping someone can offer some advice as to how to go about dynamic row insertion. i have a table filled with projects, & another table with associated phases (subprojects). there's a business rule that states that all projects *must* have a base phase - '.000', and unfortunatley, none of the projects (at time of import) in the database do.
e.g. Project Phase
98008 010
98008 020
etc
what i'd like to do is create a base phase record for each distinct project number in the projects table. i'm thinking that i should itterate through a resultset of distinct project values and simply do an insert in the phases table. however, quite a few posts in here have stated that cursors should be used as last resort. i also made the mistake of assuming that triggers would execute for each row insertion (in my case, i wanted the triggers to create the phase record when projects were imported during a batch process).
any thoughts on this? there's got to be a simple way to do this. many thanks in advance!
..:: mirirom ::..