oracle insert 질문합니다.(부적절한 열 인덱스) 0 4 2,355

by 너구링 [2016.05.20 14:35:15]


int check=-1;
		String sql="";
		try {
			try {
				conn = ConnectionManager.getConnection();
			} catch (NamingException e) {
				e.printStackTrace();
			}

			sql += "  INSERT INTO TABLE1";
			sql += "  (INCIDENT_ID,  ";
			sql += "  STRT_STD_LINK_ID,  ";
			sql += " STOP_STD_LINK_ID,  ";
			sql += "  STRT_INFO_OFFR_ID,  ";
			sql += "  STOP_INFO_OFFR_ID,  ";
			sql += "   STRT_NODE_ID,  ";
			sql += "   STOP_NODE_ID,  ";
			sql += "   STRTDATE,  ";
			sql += "   STOPDATE,  ";
			sql += " REGDATE,  ";
			sql += " INCIDENT_DVSN,  ";
			sql += " OTBR_CAUS,  ";
			sql += " OTBR_CONTENTS,  ";
			sql += " OTBR_DIR,  ";
			sql += " INCIDENTCODE,  ";
			sql += " INVOLVEDCODE,  ";
			sql += " STATUSCODE,  ";
			sql += " HUMANFATAL,  ";
			sql += " HUMANINJURY,  ";
			sql += " DAMAGECODE,  ";
			sql += " STRTDISTANCE,  ";
			sql += " STOPDISTANCE,  ";
			sql += " PLANCODE,  ";
			sql += " PLANDTLCODE,  ";
			sql += " ROADWAYCODE,  ";
			sql += " LANEBLOCK,  ";
			sql += " SHOULDBLOCK,  ";
			sql += " STRT_ITS_LINK_ID,  ";
			sql += " STOP_ITS_LINK_ID,  ";
			sql += " VMS_DSPL,  ";
			sql += " VMS_DSPL_TEXT)  ";
			sql += " VALUES  ";
			sql += "  (	?,  ";
			sql += "  	?,  ";
			sql += "  	?,  ";
			sql += " 		NULL,  ";
			sql += " 		NULL,  ";
			sql += " 		?,  ";
			sql += " 		?,  ";
			sql += " 		TO_CHAR('?', 'YYYY-MM-DD HH24:MI'),  ";
			sql += "  	TO_CHAR('?,' 'YYYY-MM-DD HH24:MI'),  ";
			sql += "  	TO_CHAR('20160201', 'YYYY-MM-DD HH24:MI'), ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	NULL,  ";
			sql += "  	'N',  ";
			sql += " 		NULL)   ";

			pstmt = conn.prepareStatement(sql);
			pstmt.setString(1, incident_id);
			pstmt.setString(2, strt_node_id);
			pstmt.setString(3, stop_node_id);
			pstmt.setString(4, strt_std_link_id);
			pstmt.setString(5,  stop_std_link_id);
			pstmt.setString(6, strtdate);
			pstmt.setString(7, stopdate);
			
			check = pstmt.executeUpdate();

 

 

(부적절한 열 인덱스) >>날짜부분인것 같은데...조언 부탁드립니다. 

by 푸르른 [2016.05.20 14:50:18]

'?' 따옴표 필요없지 않나요 ?..


by 마농 [2016.05.20 15:42:57]

오~~~

"매의 눈" 을 가지셨군요. ^^


by 우리집아찌 [2016.05.20 15:41:56]
SELECT TO_DATE('2016-02-01 12:24', 'YYYY-MM-DD HH24:MI') FROM DUAL

-- 해달 컬럼이 DATE  TYPE 이시면

 


by 너구링 [2016.05.20 15:51:42]

답변 감사합니다. 위에분들 말씀다 맞고.. 날짜 파라미터가 0으로 넘어오고 있었네요..... 

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입