Document Type | Technical Information
Category | Interface/Integration
Document Number | TIITI024
Overview
When there are restrictions on calling Tibero functions from Oracle to Tibero via DBLink, the following workaround is provided.
NoteWhen querying a Tibero view from Oracle, a workaround was applied so that the result is obtained by passing through LINK of LINK.In Tibero, when creating a view, varchar2 columns are allocated the maximum size (65536), which Oracle recognizes as LONG type. The workaround is to limit the column length using the CAST function when creating the view.
Method
Create a view in Tibero that can select Oracle columns.
1. Create Test Functions
CREATE OR REPLACE FUNCTION FN_T5_TEST RETURN NUMBER IS V_NUMBER NUMBER; BEGIN SELECT FUNC_NO INTO V_NUMBER FROM T1_TIB; RETURN V_NUMBER; END; / DROP FUNCTION FN_T5_TEST CREATE OR REPLACE FUNCTION FN_T5_TEST_2 RETURN VARCHAR2 IS V_TEXT VARCHAR2(20); BEGIN SELECT โORACLEโ INTO V_TEXT FROM DUAL; RETURN V_TEXT; END; /
2. Query Before Workaround
SELECT FN_T5_TEST AS NUM, FN_T5_TEST_2 AS TEXT FROM DUAL@OT_0627;
3. Query After Workaround
CREATE OR REPLACE VIEW VW_T5_TEST AS SELECT FN_T5_TEST AS NUM , cast(FN_T5_TEST_2 as varchar(20)) AS TEXT FROM DUAL; select * from t4_ora where ORA_TEST_TEXT in (SELECT text FROM VW_T5_TEST@OT_0627);