Document Type | Technical Information
Category | Interface/Integration
Document Number | TIITI021
Overview
This provides a workaround that can be applied when there are restrictions on updating after type conversion in Tibero using DBLink from Oracle to Tibero.
NoteIn this document, the operation was performed by converting to PL/SQL form and receiving the transformed value as a parameter.
Method
1. Create Test Table
CREATE TABLE T3_TIB (DT_CD VARCHAR(20), DT_STAMP VARCHAR(20) ,DT DATE); INSERT INTO T3_TIB VALUES (‘1′,’20201300’, SYSDATE); INSERT INTO T3_TIB VALUES (‘1′,’20201400’, SYSDATE); INSERT INTO T3_TIB VALUES (‘0′,’20201500’, SYSDATE); INSERT INTO T3_TIB VALUES (‘1′,’20201600’, SYSDATE);
2. Apply Workaround Query
-- Query before workaround
UPDATE T3_TIB@OT_0627
SET DT_STAMP = TO_CHAR(SYSDATE,’YYYYMMDD’)
,DT = SYSDATE
WHERE DT_CD=’1′;
-- Query after workaround
DECLARE
D1 CHAR(8);
D2 DATE;
BEGIN
SELECT TO_CHAR(SYSDATE,’YYYYMMDD’) INTO D1 FROM DUAL;
SELECT SYSDATE INTO D2 FROM DUAL;
UPDATE T3_TIB@OT_0627
SET DT_STAMP = D1
,DT = D2
WHERE DT_CD=’1′;
COMMIT;
END;
/