일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- Format
- 2018AG
- Premier League
- lfc
- Liverpool
- DATALENGTH
- 물류 #WMS #SI
- 리버풀
- Brighton and Hove Albion
- 1819시즌
- 축구
- WHERE조건
- LiV
- 데이터크기
- 홍보전화
- 조건실행
- 프리미어리그
- clob
- 순위
- 18-19 PL
- YNWA
- mssql
- diary
- function
- 4000자
- daily
- 일기
- 18-19
- date
- 같지않음
- Today
- Total
MinBangHome
CLOB 컬럼 사이즈 이슈 본문
CLOB 컬럼 내에 데이터 업데이트 시
ORA-01704: 문자열이 너무 깁니다
01704. 00000 - "string literal too long"
*Cause: The string literal is longer than 4000 characters.
*Action: Use a string literal of at most 4000 characters.
Longer values may only be entered using bind variables.
이슈 발생.
- 해결 방법
* update set clob_col = TO_CLOB(dbms_lob.substr(내용,4000,1)) || TO_CLOB( dbms_lob.substr(내용,4000,1))
DBMS_LOB을 쓴 이유는 기존 clob 컬럼을 불러오는 일도 있을 경우
직접 입력이라면 같은 내용을 붙여넣거나 변수처리한뒤 뒤쪽은 4000, 4001로 4001번째 부터 4000개 를 잘라내는 방법
update 테이블
Set clob컬럼 = TO_CLOB(4000자글자까지) ||TO_CLOB( 4000자넘어가는글자까지 이어붙이기)
;
두번하는 방법도 있습니다.
update 테이블
Set clob = 4000글자까지
;
update 테이블
Set clob = clob컬럼 || 4000글자넘어가는글자
;
UPDATE TESTCLOB SET C_COL = TO_CLOB('A') || TO_CLOB('B3') ;
그냥 UPDATE하면
SQL 오류: ORA-01704: 문자열이 너무 깁니다
01704. 00000 - "string literal too long"
*Cause: The string literal is longer than 4000 characters.
*Action: Use a string literal of at most 4000 characters.
Longer values may only be entered using bind variables.
,
TO_CLOB없이 그냥 || 로 묶어주면
SQL 오류: ORA-01489: 문자열 연결의 결과가 너무 깁니다
01489. 00000 - "result of string concatenation is too long"
*Cause: String concatenation result is more than the maximum size.
*Action: Make sure that the result is less than the maximum size.
TO_CLOB 로 || 할경우
1 행 이(가) 업데이트되었습니다.
- 출처
'Develop > DB' 카테고리의 다른 글
[MS SQL] <>, != (같지않음) 비교연산자 사용 (0) | 2024.01.18 |
---|---|
[MS SQL] 현재 날짜 포맷 Function 생성 및 사용 (0) | 2023.12.28 |
[MS SQL] 날짜 포맷 Function 생성 및 사용 (0) | 2023.12.28 |
[MS SQL] 문자열 길이, 데이터 크기 확인 (0) | 2023.12.28 |
CLOB & BLOB (0) | 2020.03.05 |