+1  A: 

The USING clause is only for bind variables (i.e. where you would use column names in a select statement), not table names. Typical usage would look like this:

Select col1 from table1 where col2 = :a

If you want to use variable table names use something like this:

         v_tab    := 'ex.emp';
         v_strSQL := 'SELECT * FROM ' || v_tab;
         EXECUTE IMMEDIATE v_strSQL;
Diederik Hoogenboom
tundal45
A bind variable can only hold a single atomic value - it cannot refer to a result set. A FROM clause can only refer to result sets (e.g. you can't "SELECT * FROM 'abc'") - so a bind variable just doesn't make sense in that context. This "workaround" is exactly the way you can dynamically alter the result set that the query acts on.
Jeffrey Kemp