简体   繁体   中英

ORA-00911: invalid character in C#

I am aware there are many questions related to this issue. I almost reviewed all but no suggestions could solve my problem so far. I have a query like below and this gives me ORA-00911: invalid character error. I dont have semicolon at the end, no special characters inside the query. I could not figure out what the problem is. Any helps would be appreciated.

PS:I am using "System.Data.OracleClient" as provider. And there is no mistake in connection string because i can make work some other queries

orCmd2.Connection = orConnection;
                        orCmd2.CommandType = CommandType.Text;
                        orCmd2.CommandText = "select distinct  p.id,
p.tn,   p.ptar, s.bno, s.pid from a.t_srtalı s,
a.V_PVIEW  p where s.id=:id and s.pid=p.pid";

orCmd2.Parameters.AddWithValue("id", pid);
 orreader2 = orCmd2.ExecuteReader();

我认为t_sigortalı包含无效字符。

where s.pid=:pid and s.polid=p.polid"

You have a "=:" in a WHERE-Clause

WHERE S.PID = PID AND S.POLID = P.POLID

Maybe change your variable from PID to somthing like E_PID to mark it extern...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM