본문 바로가기

Error

오류: INSERT 구문에 target columns 보다 더 많은 표현식이 존재하고 있다

 

 

PutSQL[id=5da0c1da-0186-1000-0a0a-09e5160d93e1] Failed to update database for FlowFile[filename=load_20230216.json] due to 오류: 현재 트랜잭션은 중지되어 있습니다. 이 트랜잭션을 종료하기 전까지는 모든 명령이 무시될 것입니다; it is possible that retrying the operation will succeed, so routing to retry: org.postgresql.util.PSQLException: 오류: 현재 트랜잭션은 중지되어 있습니다. 이 트랜잭션을 종료하기 전까지는 모든 명령이 무시될 것입니다
- Caused by: org.postgresql.util.PSQLException: 오류: INSERT 구문에 target columns 보다 더 많은 표현식이 존재하고 있다

 

 

 

수정 전)

 

insert into nifi.company_20230216(region_se,country_nm,exp_plc_nm,entprs_eng_nm,exp_yy,load_de)
values('${region}','${country}','${exp_plc}','${entprs_kor}','${entprs_eng}','${exp}','${time}')

 

 

 

수정 후)

 

insert into nifi.company_20230216(region_se,country_nm,exp_plc_nm, entprs_kor_nm,entprs_eng_nm,exp_yy,load_de)
values('${region}','${country}','${exp_plc}','${entprs_kor}','${entprs_eng}','${exp}','${time}')

 

 

 

 

DB에 데이터 적재 연습 중 에러가 발생하였고, insert 문을 확인 해보았더니 컬럼 하나를 빼먹었다

 

내가 왜 그랬지?ㅎ...

 

쿼리문 작성시 꼼꼼하게 작성하기🥲