oracle中如何将参数作为表名进行查询?


select
I9 as depth
from #terminalTableName#
where

<![CDATA[time > to_date(#startTime#,'yyyy-mm-dd hh24:mi:ss')]]> and

<![CDATA[time < to_date(#endTime#,'yyyy-mm-dd hh24:mi:ss')]]>

<lect>

查询的时候会报表名无效,如果将terminalTableName的值直接放在sql语句中就可以正常查出结果。请问如何解决?

交互模式:
select
I9 as depth
from @terminalTableName
绑定变量模式:
select
I9 as depth
from :terminalTableName