用PrepareStatement对象在sql语句 的insert中怎样实现id的自增长,我的代码如下可是有错误 请指教 谢谢
createorreplacetriggerS_INTERVIEW_IDbeforeinsertonINTERVIEW_INFOreferencingoldasoldne...
create or replace trigger S_INTERVIEW_ID
before insert on INTERVIEW_INFO
referencing old as old new as new for each row
begin
new.INTERVIEW_ID=S_INTERVIEW_ID.nextval;
end;
sql
.append("insert into INTERVIEW_INFO ( INTERVIEW_ID,INTERVIEWEE_NAME, INTERVIEWEE_SEX,");
sql
.append("INTERVIEWEE_POSITION,GRADUATION_DATE, EDU_BACKGROUND, FOREIGN_LANG, FOREIGN_MEMO,");
sql
.append(" BUSTRIP_FLAG, BUSTRIP_TIME,DEPT_DEVELOP, OUTSOURCING_FLAG, LEAVE_REASON, BIRTH_YEAR, ");
sql
.append("NATIVE_PLACE, BGFRIEND_FLAG,BGFRIEND_PLACE, DESAIRED_SALARY, BEFORE_SALARY, WORK_TIME, ");
sql.append("COMPACT_STATUS, TECHNICAL_REVIEW,OVERALL_MERIT, FINAL_RESULT, JAPAN_LEVEL)");
sql.append("values (S_INTERVIEW_ID.Nextval,?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,");
sql.append("?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
提示错误为“java.sql.SQLException: 无效的列索引” 展开
before insert on INTERVIEW_INFO
referencing old as old new as new for each row
begin
new.INTERVIEW_ID=S_INTERVIEW_ID.nextval;
end;
sql
.append("insert into INTERVIEW_INFO ( INTERVIEW_ID,INTERVIEWEE_NAME, INTERVIEWEE_SEX,");
sql
.append("INTERVIEWEE_POSITION,GRADUATION_DATE, EDU_BACKGROUND, FOREIGN_LANG, FOREIGN_MEMO,");
sql
.append(" BUSTRIP_FLAG, BUSTRIP_TIME,DEPT_DEVELOP, OUTSOURCING_FLAG, LEAVE_REASON, BIRTH_YEAR, ");
sql
.append("NATIVE_PLACE, BGFRIEND_FLAG,BGFRIEND_PLACE, DESAIRED_SALARY, BEFORE_SALARY, WORK_TIME, ");
sql.append("COMPACT_STATUS, TECHNICAL_REVIEW,OVERALL_MERIT, FINAL_RESULT, JAPAN_LEVEL)");
sql.append("values (S_INTERVIEW_ID.Nextval,?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,");
sql.append("?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
提示错误为“java.sql.SQLException: 无效的列索引” 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询