当前位置: 代码迷 >> Oracle管理 >> query error:ORA-00911: 无效字符解决方法
  详细解决方案

query error:ORA-00911: 无效字符解决方法

热度:155   发布时间:2016-04-24 05:44:04.0
query error:ORA-00911: 无效字符
在运行这句的时候出现的ResultSet rs = dbc.executeQuery(sql);

private ConnOracle dbc = new ConnOracle();

public ResultSet executeQuery(String sql) {
  try {
  rs = getStatement().executeQuery(sql);
  } catch (SQLException ex) {
  System.err.println("query error:" + ex.getMessage());
  }
  return rs;
  }

------解决方案--------------------
ORA-00911 invalid character

Cause: Special characters are valid only in certain places. If special characters other than $, _, and # are used in a name and the name is not enclosed in double quotation marks ("), this message will be issued. One exception to this rule is for database names; in this case, double quotes are stripped out and ignored.

Action: Remove the invalid character from the statement or enclose the object name in double quotation marks.


------解决方案--------------------
把sql语句的内容贴到oracle 中运行一下就知道是哪里有问题了!
------解决方案--------------------
SQL?
引用楼主 wqfwuliao 的帖子:
在运行这句的时候出现的ResultSet rs = dbc.executeQuery(sql);

private ConnOracle dbc = new ConnOracle();

public ResultSet executeQuery(String sql) {
try {
rs = getStatement().executeQuery(sql);
} catch (SQLException ex) {
System.err.println("query error:" + ex.getMessage());
}
return rs;
}
  相关解决方案