[해커톤] Row import failed with error: ("Out of range value for column 'min_price' at row 1", 1264)

nayoon·2021년 4월 27일
1

woori-hackathon

목록 보기
1/3

해커톤을 나가서 MySQL에 data import를 하던 도중 , Row import failed with error: ("Out of range value for column 'min_price' at row 1", 1264) 와 같은 에러를 만나게 되었다.

구글링을 해보니

나의 경우에는 값이 1억 이상이라서 에러가 나는 거 같다.

정말이다..!

문제를 해결해보겠다..

기존 코드

    @Column(name="min_price", nullable=false)
    private Integer minPrice;

    @Column(name="max_price", nullable=false)
    private Integer maxPrice;

BigDecimal로 변경 후

    @Column(name="min_price", nullable=false)
    private BigDecimal minPrice;

    @Column(name="max_price", nullable=false)
    private BigDecimal maxPrice;

decimal(19, 2)라니.. 과하게 커졌다..

그치만 일단 계속 간다..!

MySQL import 결과

820개 record가 전부 잘 들어갔다.

profile
뚜벅뚜벅 열심히 공부하는 개발자

1개의 댓글

comment-user-thumbnail
2021년 4월 29일

오오오 감사합니다 ^^!

답글 달기