|
-
Fair point. The error I am getting is
ORA-20000: ORU-10028:line length overflow, limit of 255 chars per line
ORA-06512: at "myproc", line 24
The procedure code is below. I've highlighted the relevant portions. If I make V_string less than 255 then it isn't long enough for my query :
CREATE OR REPLACE PROCEDURE myproc IS
v_string varchar2(2000);
cursor get_file_date is
select to_char(trunc(sysdate) - rownum,'YYYYMMDD') file_date
From all_objects
Where rownum between 1 and 31;
BEGIN
For A in get_file_date
Loop
V_String:='insert into localtable Select * from '||
'"remotetable'||a.file_date||'"'||'@remotedb b '||
'where not exists '||
'(select * from localtable a '||
'where a.fielda = b."fielda" '||chr(10)||
'and a.fielda = b."fieldb" '||
'and a.fieldc = b."fieldc" '||
'and (a.fieldd = b."fieldd" '||
'and (a.fielde = b."fielde" '||
'and (a.fieldf = b."fieldf" ';
dbms_output.put_line(' V String is '||V_string);
Execute Immediate v_string;
Commit;
End Loop;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END myproc;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|