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;
/