开发者

Using "$" in Oracle queries being run from C#

开发者 https://www.devze.com 2023-02-11 07:33 出处:网络
I want to run an Oracle query which is somewhat like: SELE开发者_Go百科CT * FROM v$sql WHERE ......

I want to run an Oracle query which is somewhat like:

SELE开发者_Go百科CT * 
  FROM v$sql 
 WHERE ......

But when I use "v$sql" in C#, I am getting an error "Invalid character".

When I remove that part of the query and replace it with some other table name, it is running fine.


I'm not familiar with C# but try putting v$sql in double quotes: "V$SQL"

Double quotes makes Oracle case sensitive so it needs to be uppercase.

Or try a synonym:

create synonym  my_v_sql for sys.V_$SQL;
or 
create public synonym  my_v_sql for sys.V_$SQL;

0

精彩评论

暂无评论...
验证码 换一张
取 消