浏览 2738 次
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2007-10-24
//create sequence allSQL.append("CREATE SEQUENCE USERTABLE_"+tableid+"_SEQ") .append(" START WITH 1 ") .append(" INCREMENT BY 1 ") .append(" NOMINVALUE ") .append(" NOMAXVALUE ") .append(" NOCYCLE ") .append(" CACHE 20 ") .append(" ORDER \n commit;"); updateSql = allSQL.toString(); logger.debug("创建序列======="+updateSql); allSQL.delete(0, allSQL.length()); updateObject("createTableSequenceTrigger", updateSql); //create trigger allSQL.append("CREATE OR REPLACE TRIGGER USERTABLE_"+tableid+"_SETID BEFORE\n"); allSQL.append("INSERT ON USERTABLE_").append(tableid).append(" FOR EACH ROW DECLARE\n"); allSQL.append(" next_id NUMBER;\n"); allSQL.append(" BEGIN\n"); allSQL.append(" SELECT USERTABLE_").append(tableid).append("_SEQ.NEXTVAL\n"); allSQL.append(" INTO next_id\n"); allSQL.append(" FROM dual;\n"); allSQL.append(" :new.ID := next_id;\n"); allSQL.append(" END;"); updateSql = allSQL.toString(); logger.debug("执行触发器创建======================="+updateSql); allSQL.delete(0, allSQL.length()); updateObject("createTableSequenceTrigger", updateSql); 在IBATIS中的SQL语句为 <update id="createTableSequenceTrigger" parameterClass="string"> <![CDATA[ $updateSql$ ]]> </update> 报出错误为: SqlMapClient operation; unca tegorized SQLException for SQL []; SQL state [null]; error code [17041]; --- The error occurred in config/lzda/designer/sqlmap/designer.xml. --- The error occurred while applying a parameter map. --- Check the FORM_DESIGNER.createTableSequenceTrigger-InlineParameterMap. --- Check the statement (update failed). --- Cause: java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 1; nested excepti on is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in config/lzda/designer/sqlmap/designer.xml. --- The error occurred while applying a parameter map. --- Check the FORM_DESIGNER.createTableSequenceTrigger-InlineParameterMap. --- Check the statement (update failed). 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |