에러코드
VARCHAR2(10 byte) will support up to 10 bytes of data, which could be as few as two characters in a multi-byte character sets.
상황
DBeaver에서 ID, NAME의 Type이 VARCHAR2(10)으로 보이는데, 컬럼 사이즈를 보여주는 우리 서비스의 화면에서는 VARCHAR2(40)으로 보임.
해결
직접 DB 접속해서 보니 VARCHAR2(10) 이 아닌 VARCHAR2(10 CHAR) 로 CHAR가 붙어 있었음
SQL> desc tableName;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NOT NULL VARCHAR2(10 CHAR)
NAME VARCHAR2(10 CHAR)
AGE NUMBER(2)
CREATE_AT TIMESTAMP(6)
VARCHAR2(10 byte)
will support up to 10 bytes of data, which could be as few as two characters in a multi-byte character sets.
VARCHAR2(10 char)
could support as much as 40 bytes of information and will support to up 10 characters of data.
-> 10 char 이기 때문에 40byte여서 40반환이 맞음
참고
Difference between varchar2(10), varchar2(10 byte) and varchar2(10 char)
'tools' 카테고리의 다른 글
Public Key Retrieval is not allowed 에러 해결 (0) | 2022.06.28 |
---|