Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Insert Question

0 views
Skip to first unread message

Mtek

unread,
Apr 8, 2008, 2:20:31 PM4/8/08
to

Hi,

Say I have an external table with 4 columns like this. (Actual tables
have more than 100 columns).

C1
C2
C3
C4

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 /
SELECT.

I have 12 tables like this, and I do not want to create 12
triggers......

Does anyone have any suggestions?

Thank you,

John.

Ed Prochak

unread,
Apr 8, 2008, 3:01:52 PM4/8/08
to

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

0 new messages