java.sql.SQLException: ORA-06550: 第 1 行, 第 62 列:
PLS-00103: 出现符号 "月"在需要下列之一时:
) , * & | = - + < / > at in
is mod remainder not rem => .. <an exponent (**)>
<> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_
between || member SUBMULTISET_
符号 "," 被替换为 "月" 后继续。
ORA-06550: 第 1 行, 第 93 列:
PLS-00103: 出现符号 ","在需要下列之一时:
( - + case mod new not null
others <an identifier> <a double-quoted delimited-identifier>
<a bind variable> avg count current exists max min prior sql
stddev sum variance execute forall
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:944)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3482)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3839)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1085)
..............................
因为自己的一个小小的失误被这个异常折腾了几天,问题就出在程序中调用存储过程的sql语句上:
sql = "{ call insert_user_to_all('"+ user.getUser_id() +"','"+ user.getUsername() +"','"+ user.getPassword() +"','"+ user.getSex() +"','"+ user.getBirthday() +"',"+ user.getPersonal_id() +",'"+ user.getIsmarry() +"',"+ user.getTel() +",'"+ user.getEmail() +"','"+ user.getIsrent() +"','"+ user.getCarplace_id() +"') }";
原来自己没有在"+ user.getUser_id() +"的两边加上单引号:‘’!当存入number类型字段时可以不加‘’,但是当存入字符串是必须得加‘’,否则报错!