best way to "parameterize" a tablename?

From: <>
Date: Thu, 21 Aug 2008 21:58:03 GMT
Message-ID: <Lxlrk.25253$>

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 Harrison
Pixar Animation Studios
Received on Thu Aug 21 2008 - 16:58:03 CDT

Original text of this message