0
我正在一個Invalid column index
當我嘗試設置此查詢的參數in_cnt_date
:列索引無效PLSQL塊
public static final String CONTEXT = "DECLARE in_cnt_date DATE := TO_DATE('&'); " +
" hv_cnt_id NUMBER := 0; " +
" BEGIN DBMS_OUTPUT.ENABLE (NULL); " +
" INSERT INTO dt_contexts (CNT_ID, CNT_CONTEXT, CNT_TYPE, CNT_SOURCE, CNT_COMMENT, CNT_DATE, CNT_DATE_INSERT, CNT_DATE_UPDATE) VALUES (0, 'EPE_CONTEXT', 'ROUTE', 'bdd', 'Built from ROUTE', in_cnt_date, SYSDATE, SYSDATE); " +
" SELECT SEQ_DT_CNT_ID.CURRVAL INTO hv_cnt_id FROM DUAL; " +
" dbms_output.put_line(hv_cnt_id); " +
" EXCEPTION WHEN OTHERS THEN RAISE ; END;";
參數的設置:
CallableStatement cs = null;
ResultSet rs = null;
int contextId = 0;
try {
conn.setAutoCommit(false);
cs = conn.prepareCall(CONTEXT);
cs.setDate(1, (java.sql.Date) Route.datePrf);
你能幫忙?
這與您的[上一個問題]看起來相同(http://stackoverflow.com/questions/26182869/retrieve-anonymous-plsql-block-result) – 2014-10-06 09:34:18