Re: Insert Question
Date: Tue, 8 Apr 2008 12:01:52 -0700 (PDT)
On Apr 8, 2:20 pm, Mtek <m..._at_mtekusa.com> wrote:
> Say I have an external table with 4 columns like this. (Actual tables
> have more than 100 columns).
> And the actual table is exactly the same. The easiest thing to do is
> to do a INSERT...SELECT.
> However, say that I need to call a function on the first column to
> retrieve / convert a lookup value. How can I now do a INSERT /
> I have 12 tables like this, and I do not want to create 12
> Does anyone have any suggestions?
> Thank you,
Well the triggers are likely easier than listing all the columns with
a function on 12 out of 100 columns.
INSERT INTO realtable (c1,c2,c3,...c99,c100) select c1,c2,c3,c4funct(c4),...c99funct(c99),c100 from exttable ;
Would you rather write the above 12 times or 12 triggers? Ed Received on Tue Apr 08 2008 - 14:01:52 CDT