I am trying to insert data from a text field which is of varchar2(8000) on sql server.I have created a similar column but of clob datatype on oracle db. can you please help me resolve the inconsistent datatypes issue and improve the performance of the query? PLease let me know if there is any other better way to insert huge text files for multiple rows.When I run the same query on sql server and oracle db(i.e select "Note" from TBL_NOTES@PPRLEG) the results are quickly retrieved. when I try to insert the data it takes a lot of time and it doesn't end.i should only give here the column that contain the clobs, and it should handle the rest.
CREATE OR REPLACE FUNCTION get_clob_data
(id in TBL_NOTES.id%TYPE,
REPORT_ID in TBL_NOTES.REPORT_ID%type,
UNIQUE_ID in TBL_NOTES.UNIQUE_ID%type,
USER_ID in TBL_NOTES.USER_ID%type,
DTS in TBL_NOTES.USERROLE%type,
USEREIN in TBL_NOTES.USERROLE%type
)
RETURN varchar2
IS
l_text varchar2(4000);
Type t_note_txt IS TABLE OF TBL_NOTES.NOTE%type;
v_notes t_note_txt;
BEGIN
SELECT ltrim(rtrim("NOTE"))NOTE
bulk collect into v_notes
FROM TBL_NOTES@PPRLEG;
for indx in 1..v_notes.count
loop
l_text := l_text || ' ' ||v_notes(indx);
end loop;
RETURN l_text;
END;
/