best way to "parameterize" a tablename?

From: <mh_at_pixar.com>
Date: Thu, 21 Aug 2008 21:58:03 GMT
Message-ID: <Lxlrk.25253$Ri.20562@flpi146.ffdc.sbc.com>


I have need to do something like this:

    if tablename = 'FOO'

        insert into foo ...
    else if tablename = 'BAR'

        insert into bar ... (exact same stuff)     etc...

I hesitate to use an execute immediate, due to the troublesome quoting issues, but is there a good way to do something like this?

    insert into $TABLENAME ...

Many TIA!
Mark

-- 
Mark Harrison
Pixar Animation Studios
Received on Thu Aug 21 2008 - 16:58:03 CDT

Original text of this message