본문 바로가기
반응형

Dev/DataBase40

[MariaDB] ERROR 1267 illegal mix of collations ... SQL Error 1267 illegal mix of collations (utf8mb4_general_ci, IMPLICIT) and (utf8mb4_unicode_ci, IMPLICIT) for operation '=' MariaDB에서 인의적 데이터를 만든 경우 DB의 정렬 기준과 테이블 컬럼의 정렬 기준이 다른 경우 발생합니다. DB의 정렬 속성이 테이블의 정렬 속성과 다른지 확인이 필요합니다. -- 오류 발생을 위해 CONVERT 사용 쿼리 WITH recursive downward AS ( -- 하향쿼리 SELECT CONVERT('ID-001', VARCHAR(100)) id, convert('', varchar(100)) pid UNION ALL SELECT convert(wfr_tgt_i.. 2023. 1. 16.
[MariaDB] ERROR 1406 (22001): Data too long for column 'id' at row 1 AWS-RDBS for MariaDB에서 어느 시점부터 발생 재귀 쿼리 일부에서 발생(? 데이터 속성 탓인가) ERROR 1406 (22001): Data too long for column 'str' at row 1 계층형(재귀) 쿼리에서 UNION을 통한 비특정 데이터 연결하는 과정에서 데이터 속성의 길이가 달라서 발생 오라클은 이런 건 없었던 것 같은데😥 비엄격 SQL 모드에서는 괜찮지만, 엄격 SQL모드에서는 오류 발생(STRICT_TRANS_TABLES 모드 활성화 시) -- 발생 소스 WITH RECURSIVE cte AS ( SELECT 1 AS n, 'abc' AS str UNION ALL SELECT n + 1, CONCAT(str, str) FROM cte WHERE n < 3 ) SE.. 2023. 1. 13.
ORACLE/MYSQL timestamp 구하기 MARIADB/MYSQL timestamp 구하는 방법 SELECT UNIX_TIMESTAMP() ; -- 1660795239 오라클 timestamp 구하는 방법 SELECT TRUNC((SYSDATE - DATE '1970-01-01' ) * 60 * 60 * 24) FROM DUAL -- 1660795239 2022. 8. 18.
ORA-14551: cannot perform a DML operation inside a query ORA-14551 cannot perform a DML operation inside a query Cause: DML operation like insert, update, delete or select-for-update cannot be performed inside a query or under a PDML slave. Action: Ensure that the offending DML operation is not performed or use an autonomous transaction to perform the DML operation within the query or PDML slave. Function 내부에서 DML 이 사용된 경우 발생하는 오류입니다. 함수에서 DML이 필요한 경우.. 2022. 8. 18.
반응형