Trigger inserting CLOB in remote database

I ma using an after insert row level trigger to replicate a table into a remote database which has a CLOB column. This is not Oracle Replication, only a trigger. I have attempted numerous paths to achieve this with only partial successes. Is there a way to insert into the remote database when using a CLOB?
Trigger follows: (will not work when the table array values gets large; I know it will fail on iteration 14)
CREATE OR REPLACE TRIGGER COPYUP
INSERT ON "EVENT_DATA" FOR EACH ROW
DECLARE
TYPE t_buffer IS TABLE OF VARCHAR2(32500)
INDEX BY BINARY_INTEGER;
vcharBuf t_buffer;
vintReadlength integer := 1;
vintSendRead integer;
vintCntr integer := 0;
vintTotallength integer := 1;
vintBeginloc integer := 1;
vclobVal clob;
vintOffset integer := 32500;
vintLoop integer;
vnumError number;
vcharErrstr varchar2(200);
BEGIN
select :new.rawdata into vclobVal from dual;
vintTotallength := dbms_lob.getlength(vclobVal);
LOOP
if vintTotallength > vintOffset then
if ((vintCntr + 1) * vintOffset) < vintTotallength then
vintReadlength := vintOffset;
else
vintReadlength := (vintTotallength - (vintCntr * vintOffset));
end if;
else
vintReadlength := vintTotallength;
end if;
vintSendRead := vintReadlength;
-- dbms_output.put_line('COPYUP: vintReadlength: ' || vintReadlength || '.');
-- dbms_output.put_line('COPYUP: vintTotallength: ' || vintTotallength || '.');
-- dbms_output.put_line('COPYUP: vintCntr: ' || vintCntr || '.');
-- dbms_output.put_line('COPYUP: vintOffset: ' || vintOffset || '.');
-- dbms_output.put_line('COPYUP: vintBeginloc: ' || vintBeginloc || '.');
-- dbms_output.put_line('COPYUP: vintBeginlocSendRead: ' || vintSendRead || '.');
-- dbms_output.put_line('COPYUP: EventId: ' || :new.eventid || '.');
dbms_lob.read(vclobVal, vintSendRead, vintBeginloc, vcharBuf(vintCntr));
exit when ((vintBeginloc + vintReadlength) >= vintTotallength);
vintCntr := vintCntr + 1;
vintBeginloc := (vintCntr * vintReadLength) + 1;
END LOOP;
IF vintCntr = 0 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 1 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 2 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 3 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 4 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 5 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 6 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 7 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 8 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 9 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 10 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 11 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 12 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 13 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 14 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 15 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 16 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 17 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 18 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 19 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 20 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 21 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 22 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 23 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 24 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 25 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24)||vcharBuf(25),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 26 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24)||vcharBuf(25)||vcharBuf(26),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 27 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24)||vcharBuf(25)||vcharBuf(26)||vcharBuf(27),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 28 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24)||vcharBuf(25)||vcharBuf(26)||vcharBuf(27)||vcharBuf(28),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 29 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24)||vcharBuf(25)||vcharBuf(26)||vcharBuf(27)||vcharBuf(28)||vcharBuf(29),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 30 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24)||vcharBuf(25)||vcharBuf(26)||vcharBuf(27)||vcharBuf(28)||vcharBuf(29)||vcharBuf(30),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 31 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24)||vcharBuf(25)||vcharBuf(26)||vcharBuf(27)||vcharBuf(28)||vcharBuf(29)||vcharBuf(30)||vcharBuf(31),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSIF vintCntr = 32 THEN
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf(0)||vcharBuf(1)||vcharBuf(2)||vcharBuf(3)||vcharBuf(4)||vcharBuf(5)||vcharBuf(6)||vcharBuf(7)||vcharBuf(8)||vcharBuf(9)||vcharBuf(10)||vcharBuf(11)||vcharBuf(12)||vcharBuf(13)||vcharBuf(14)||vcharBuf(15)||vcharBuf(16)||vcharBuf(17)||vcharBuf(18)||vcharBuf(19)||vcharBuf(20)||vcharBuf(21)||vcharBuf(22)||vcharBuf(23)||vcharBuf(24)||vcharBuf(25)||vcharBuf(26)||vcharBuf(27)||vcharBuf(28)||vcharBuf(29)||vcharBuf(30)||vcharBuf(31)||vcharBuf(32),
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
ELSE
insert into ncars.trigger_events
(dt, ip, id, ival1, ival2, cval1, cval2)
values
(sysdate, :new.ip_address, :new.eventid, vintCntr,
vintTotallength, 'COPYUP', 'EVENT_DATA');
END IF;
EXCEPTION
when others then
vnumError := SQLCODE;
vcharErrstr := SUBSTR(SQLERRM, 1, 200);
insert into ncars.trigger_events
(dt, ip, id, ival1, ival2, cval1, cval2)
values
(sysdate, :new.ip_address, :new.eventid, vintCntr,
vnumError, 'COPYUP', vcharErrstr);
END COPYUP;

I aim to please any and all that wish to help. This is very similar to my original trigger. This trigger is constrained by the 32500 size.
CREATE OR REPLACE TRIGGER COPYUP
INSERT ON EVENT_DATA FOR EACH ROW
DECLARE
vcharBuf varchar2(32500);
vintTotallength integer := 1;
vclobVal clob;
BEGIN
select :new.rawdata into vclobVal from dual;
vintTotallength := dbms_lob.getlength(vclobVal);
dbms_lob.read(vclobVal, vintTotallength , 1, vcharBuf);
insert into event_data@ncarsdb2
(ids, ip_address, center,
detect_date, port, filter,
rawdata, eventid, lastupdate,
rulenum, priority, filtername)
values
(:new.ids, :new.ip_address, :new.center,
:new.detect_date, :new.port, :new.filter,
vcharBuf,
:new.eventid, :new.lastupdate,
:new.rulenum, :new.priority, :new.filtername);
END COPYUP;

Similar Messages

  • Inserting data in remote database with remote procedure

    Hi,
    I have a problem concerning inserting data in a remote database (10g) by using a remote procedure.
    I call the procedure from a 11g database just by doing:
    begin
    getlocalfilecontent@remoteserv(param)
    commit;
    end;
    And it wouldn't insert the data into the remote table.
    While when I execute the same procedure locally on that remote database (10g)
    It does insert the data I want.
    What could be causing the problem here, am I overseeing something?
    Edited by: user7634309 on 14-Aug-2009 02:14

    Already thanks for the fast replies
    The dblink works perfectly. I can select data etc with this dblink.
    The procedure on the remote database is the same.
    One other thing, when I execute the remote procedure on local database 2nd time I get the
    ORA-ERR: ORA-02041: client database did not begin a transaction.
    This could be fixed by doing a commit or rollback but still no inserting in remote table.
    So to sum it up:
    What doesn't work:(no inserting)
    On 11g server that calls remotely the procedure
    begin
    getlocalfilecontent@remoteserv(parameter);
    commit;
    end;
    What works(does insert)
    On 10g server calling the procedure locally
    begin
    getlocalfilecontent(param);
    commit;
    end;
    So everything is the same except on the 11g server I add the dblink spec behiind the procedurecall

  • Lock-ups while inserting to a remote database using a dblink

    Our application runs across multiple instances of Oracle 8i - 8.1.6.
    Throughout the day we run some batch processes to transfer data across these instances using dblinks. Ocassionally the process locks up and further investigation shows that the server from which we are pushing information out seems to have executed an insert statement on a remote instance (insert into test_table@tst_dblink select * from local_table) and is waiting for a return from the remote server while the remote instance seems to be hanging too. Oracle does not return any error but simply waits forever for the statement to finish.
    If anybody has experienced this before can you please share any information you may have on 1. how to prevent this from happening or 2. How to make oracle give up on the transaction, roll it back and raise an error?
    Thanks a lot....

    Well, certainly we need more info to fix the problem! couple of "system states" on both the machines when the job is hanging would help. couple of "stack trace" of the shadow process will also help. please call local oracle support with the system state and stack trace.
    Sounds like the job is hanging on some resource (lock,enque,latch,io...). oracle doesn't give up for few resources, like waiting on ST,latch, io etc. we have to kill the offending process if we want!!
    just my 2 cents :)
    G

  • Trying to insert CLOB data into Remote Table..

    Hi everyone,
    I think this question had already posted.But i am not able to figure out this problem..
    what i am trying to do is
    I have a table in the remote database with a CLOB column like this
    REMOTE_TABLE
    ============
    REMOTE_TABLE_ID (Populated with sequence)
    REMOTE_CLOB CLOB
    In my Local database i have to write a Procedure to gather some information on a particular record (My Requirement) and save that CLOB in the REMOTE_TABLE.
    I built that procedure like this
    Declare
    var_clob CLOB; /* I need to processs several records and keep all data in a clob
    begin
    /***** Processed several records in a local database and stored in the variable var_clob which i need to insert into remote database ****/
    Insert into remote_table@remote values (remote_table_seq.nextval,var_clob);
    /*** when i try to execute the above command i am getting the following error
    ORA-06550: line 6, column 105:
    PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables
    ORA-06550: line 6, column 1:
    PL/SQL: SQL Statement ignored *****/
    /***For a test i created the same table in local db****/
    Insert into local_table values (local_table_seq.nextval,var_clob);
    It is working fine and i am able to see the entire CLOB what i want.
    surprisingly if i pass some value instead of a varibale to the remote table like the following..
    Insert into remote_table@remote values (remote_table_seq.nextval,'Hiiiiiiiii');
    It is working fine...
    I tried the following too..
    decalre
    var_clob clob;
    begin
    var_clob := 'Hiiiiiiiiiiiiiii';
    Insert into remote_table@remote (remote_table_id) values (1);
    commit;
    update remote_table@remote set remote_clob = var_clob where remote_table_id = 1;
    commit;
    end
    I am getting the following error..
    ORA-22922: nonexistent LOB value
    ORA-02063: preceding line from CARDIO
    ORA-06512: at line 6
    Could someone please help me in fixing this issue..I need to process all the data to a variable like var_clob and insert that clob into remote table..
    Thanks in advance..
    phani

    Go to http://asktom.oracle.com and search for clob remote table
    also docs contain quite lot of info:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_working.htm#sthref97
    Gints Plivna
    http://www.gplivna.eu

  • Replicating clobs and blobs in a remote database across dblink

    9iR2
    When creating a materialized view in a warehouse pointing to a remote table in an OLTP environment, I got this error when trying to replicate a table with 3 clobs.
    ORA-22992: cannot use LOB locators selected from remote tables
    So, how does Oracle recommend replicating Blobs and Clobs in a remote database/warehouse? Evidently using materialized views doesnt work.

    MV replication is obsolete.
    Move to 10gR2 and use Streams.

  • Insert a blob in remote database using dblink

    i have a view (it has a BLOB column) from where i need to select the records. After selecting i need to insert it into a synonym in the remote database through a db link.
    if i execute the procedure i get error; ora-22992--cannot use LOB locators selected from remote table. My code is
    INSERT INTO [email protected]
    SELECT PID,RNO, PTYPE,blob_field
    FROM view;
    I dont wish to creat a temporary table and still wish to perform the above function.
    So is there any method to do this. I tried with DBMS_LOB.APPEND but it didnt work out. Any solution will be greatly appreciated.
    Thanks,
    -Nitin

    i have a view (it has a BLOB column) from where i need to select the records. After selecting i need to insert it into a synonym in the remote database through a db link.
    if i execute the procedure i get error; ora-22992--cannot use LOB locators selected from remote table. My code is
    INSERT INTO [email protected]
    SELECT PID,RNO, PTYPE,blob_field
    FROM view;
    I dont wish to creat a temporary table and still wish to perform the above function.
    So is there any method to do this. I tried with DBMS_LOB.APPEND but it didnt work out. Any solution will be greatly appreciated.
    Thanks,
    -Nitin

  • Copying CLOB data from remote database to local database

    How can i copy a CLOB data from a remote datbase table to a local database table ?
    i have a database link created from my local database to remote database, but looks like i cannot select a clob locator or clob data residing on a remote database through this link ?
    is there any way to do this ? anyone has a readily available code for doing this ? i need this very urgently, your help is greatly appreciated!
    thanks,
    SC.

    Is there a local to your pc database ???? Which is the db version of your pc(if there is)....and your server's database?????
    Simon

  • Error while Creating form on remote Database

    Hi All
    I m getting error while creating form on remote database thru
    Database link
    Line/Column Error
    7099/21 PLS-00454: with a returning into clause, the table
    expression cannot be remote or a subquery
    7099/9 PL/SQL: SQL Statement ignored
    7749/16 PLS-00454: with a returning into clause, the table
    expression cannot be remote or a subquery
    7749/9 PL/SQL: SQL Statement ignored
    and statement at line specified is insert statement. and at end
    of insert statement Returning caluse is there as follows
    RETURNING ROWID INTO "_ROWID";
    This returning clause is causing error. Does anybody knows how
    to handel it??
    Thanks
    Yogesh

    Yogesh
    I haven't seen the ora-03116 problem.
    What version of Portal are you running? Are the databases at the same version? Does your table have longs or anything strange in it?
    Can you query the table via the synonyms and link in sqlplus as the application schema? This is a good test because it eliminates Portal.
    You should try setting up synonyms etc for the emp table. If you still get the problem then Oracle may be able to replicate it. If not, then there's sth funny about your table maybe.
    I agree with Vishnu about creating everything in sqlplus. I create all my links and synonyms in sqlplus. They are all public. I have 2 synonyms: one takes you over the link the other takes you to the right schema. It's flexible and it works.
    data database: D grants to P (local schema) on table T
    public syn T = D.T (sys) (get the right schema)
    portal dbase : public db link to data database connecting as P
    public syn T = T@dblink (sys) (over the link)
    P is a schema created in both databases.
    Test is: P in portal dbase can "select * from T" and gets the right data.
    I never, ever refer to a schema when defining a form. ie. never P.T or D.T or whatever. I always refer simply to a synonym. For the above my form would be defined simply on the table T.
    Hope this helps
    Greg

  • Oracle VPD on Remote database using DBLINk

    Hi All,
    How can i apply row level security on a table that is available in another database using DBlink
    we have two databases PDSSM and EVTA, and i would like to apply row level security on a table in EVTA from a schema in PDSSM using dblink. MXODSADM IS A SCHEMA IN EVTA AND MXEMBARGO IS A SCHEMA IN PDSSM. there is a dblink(EVTA.GMM.COM) between mxembargo and mxodsadm.
    begin
    dbms_rls.add_policy (
    object_schema => 'MXODSADM',
    object_name => 'vehicle_retail_sale',
    policy_name => ' MXEMBARGO_EVTA_POLICY',
    function_schema =>'MXEMBARGO',
    policy_type => dbms_rls.SHARED_CONTEXT_SENSITIVE,
    --policy_type => dbms_rls.STATIC,
    policy_function => ' MXEMBARGO_EVTA_POLICY.MXEMBARGO_EVTA_PREDICATE',
    statement_types => 'select, insert,update,delete',
    update_check => TRUE,
    enable => TRUE,
    static_policy => TRUE
    end;
    I am a complete Database person and i need to do this in my application, can anyone provide me how can i do this using dblink.

    wojpik wrote:
    hello
    I have one short question to you.
    Is that possible to create view at remote database using dblink? Following syntax returns error
    create view ViewName@DbLinkDame (ColumnName) as
    (select 1 from dual )
    "ORA-00905:missing keyword"
    Is that possible at all?
    And particulary - is that possible when remote database is MSSQL and I am using heterogeneous services?
    I really appreciate your help
    best regards
    Wojtek
    Edited by: wojpik on Oct 21, 2009 3:59 AMI doubt you would be able to fire any ddl through database link. You have to connect to remote database to run any ddl even if it is Oracle or some other database.
    Regards
    Anurag

  • How to connect to a remote database in a lan??

    Hey guys......! I need to connect to a remote msaccess database in a lan and import its data into my mysql database.I know how to connect to a msaccess database using ODBC.But I don't know how to connect to a remote database without creating dsn in the machine where database is.One thing more...I want to know, how can I import data into my mysql database?? Is there any query for that or simply I have to select data from msaccess database and insert into tables of my database??Please, send me the source code in the forum itself and explain also.This is the last feature of my project.So I need to do it as soon as possible.

    If the mdb file in LAN, Just map the network drive.[Windows Explorer/Tools/Map Network Drive] in your system from which we need to access the remote mdb. Then go to ODBC Data Source Admin.. and create a new data source[Microsoft Access Driver] . After clicking the Select button, you will find a Network Drive will be visible on your Drives drop down. Select the map Drive, If not visible then just click the Network button there and map the network path where the mdb files reside. And use the JdbdOdbcDriver class to connect from java.

  • Replicate some tables from local database server to Remote database sever

    how can i replicate some tables from local database server(Oracle 8.1.7 on windows 2000 server) to a remote database server(Oracle 8.1.7 on Sun Solaris)
    whenever there is some insertion or updation on the table of base(main) database it should get updated to the remote database server
    or
    on time base for example: every 2 hours
    please help me!!!!

    It all depends on waht you are going to do with the data on the remote.
    if tehre are no updates there, creating a simple materialized view on the remote to pull it's data from the local should suffice.
    If there are updates on the remote, you will more than likely want to look into either Multi-master replication, or updatable materialized views.

  • Remote database problem with Geometry data type

    Hello!
    I'm trying to insert and update a spatial table in a remote database. The syntax looks like:
    insert into tableA@remotedb (col1, col2)
    select col1, col2 from tableA
    where col3='abc';
    This works fine with regular tables. But when I try it on spatial tables, I get this error:
    'remote operations not permitted on object tables or user-defined type columns'.
    My table contains geometry datatype and user-defined datatype. Does anyone know how to solve this problem?
    Thanks!

    I created 2 temp tables in the remote db. One contains MDSYS.SDO_Geometry column without user-defined column; the other one has user-defined column without MDSYS.SDO_Geometry. Both got the same error, ORA-22804: remote operations not permitted on object tables or user-defined type columns.
    But strangly, I tried to insert into a local table from a remote table with MDSYS.SDO_Geometry column, and it worked! And I tried the same thing with user-defined column, but it didn't work.
    I wonder why insert sdo_geometry column from local db to remote db didn't work, but it worked the other way round. And inserting user-defined column between db didn't work at all!

  • How to send e-mail with an attachment from remote database server.???

    Hi All,
    I have tried the simple mail sending and with the attachment using UTL_SMTP. But the problem is , it is sending the mail with attachment of the file name i give, it takes and creates that file and sends as attachment not from the actual file location. I am trying to attach the file which i stored in remote database server.
    The following code I tried. But not worked for attachment
    DECLARE
       v_From       VARCHAR2(80) := '[email protected]';
       v_Recipient  VARCHAR2(80) := '[email protected]';
       v_Subject    VARCHAR2(80) := 'test subject';
       v_Mail_Host  VARCHAR2(30) := 'pop3.somedomain.com';
       v_Mail_Conn  utl_smtp.Connection;
       crlf         VARCHAR2(2)  := chr(13)||chr(10);
    BEGIN
      v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
      utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
      utl_smtp.Mail(v_Mail_Conn, v_From);
      utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
      utl_smtp.Data(v_Mail_Conn,
        'Date: '   || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
        'From: '   || v_From || crlf ||
        'Subject: '|| v_Subject || crlf ||
        'To: '     || v_Recipient || crlf ||
        'MIME-Version: 1.0'|| crlf ||     -- Use MIME mail standard
        'Content-Type: multipart/mixed;'|| crlf ||
        ' boundary="-----SECBOUND"'|| crlf ||
        crlf ||
        '-------SECBOUND'|| crlf ||
        'Content-Type: text/html;'|| crlf ||
        'Content-Transfer_Encoding: 7bit'|| crlf ||
        crlf ||
        'some message text'|| crlf ||     -- Message body
        'more message text'|| crlf ||
        crlf ||
        '-------SECBOUND'|| crlf ||
        'Content-Type: text/html;'|| crlf ||
        ' name="Fund Authorization report"'|| crlf ||
        'Content-Transfer_Encoding: 8bit'|| crlf ||
        'Content-Disposition: attachment;'|| crlf ||
        ' filename="/usr/tmp/Test.html"'|| crlf ||
        crlf ||
        'HTML Attachment'|| crlf ||     -- Content of attachment
        crlf ||
        '-------SECBOUND--'               -- End MIME mail
      utl_smtp.Quit(v_mail_conn);
    EXCEPTION
      WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
        raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
    END;How can I attach a file which is stored in database server and send it in a mail.
    Please someone help me in this.
    Thanks,
    Alaka.

    Try this code
    Regards Salim.
    CREATE OR REPLACE TRIGGER EmailOnServerErr AFTER SERVERERROR ON DATABASE
    DECLARE
       mail_conn       UTL_SMTP.connection;
       crlf            VARCHAR2(2) := chr(13)||chr(10);
       msg             VARCHAR2(32760);
       sid_name        VARCHAR2(16);
       bdump_dest      VARCHAR2(128);
       smtp_relay      VARCHAR2(32) := 'MyMailRelay';
       recipient_address  VARCHAR2(64) := '[email protected]';
       sender_address     VARCHAR2(64) := '[email protected]';
       mail_port       NUMBER := 25;
       log_file_handle UTL_FILE.FILE_TYPE;
       log_file_dir    VARCHAR2(256) := 'ERR_LOG_DIR';
       log_file_name   VARCHAR2(256) := 'OracleErrors.log';
       maxlinesize     NUMBER := 32767;
       session_rec     sys.v_$session%ROWTYPE;
       audit_rec       sys.dba_audit_trail%ROWTYPE;
       auditing        BOOLEAN;
       LinesOfSQL      BINARY_INTEGER;
       offending_sql   DBMS_STANDARD.ora_name_list_t;
       CURSOR bdump_cur IS
          SELECT TRIM(value)
          FROM v$parameter
          WHERE name = 'background_dump_dest'
       CURSOR sid_cur IS
          SELECT TRIM(instance_name)
          FROM v$instance
       CURSOR session_cur IS
          SELECT s.*
          FROM v$session s
          WHERE s.sid = dbms_support.mysid
       CURSOR audit_trail_cur(AUDSID IN NUMBER) IS
          SELECT *
          FROM dba_audit_trail
          WHERE sessionid = AUDSID
    BEGIN
       IF (USER = 'SYSTEM' OR USER = 'SYS') THEN
          -- Ignore this error
          NULL;
       ELSIF IS_SERVERERROR (1034) THEN
          -- Ignore this error
          NULL;
       ELSE
          -- get the sid
          OPEN sid_cur;
          FETCH sid_cur INTO sid_name;
          CLOSE sid_cur;
          -- get the location of the alert log
          OPEN bdump_cur;
          FETCH bdump_cur INTO bdump_dest;
          CLOSE bdump_cur;
          -- get the session information
          OPEN session_cur;
          FETCH session_cur INTO session_rec;
          CLOSE session_cur;
          -- get the audit_trail information if it exists
          OPEN audit_trail_cur(session_rec.audsid);
          FETCH audit_trail_cur INTO audit_rec;
          auditing := audit_trail_cur%FOUND;
          CLOSE audit_trail_cur;
          IF session_rec.program = 'MyProgram.exe' THEN
             NULL;  -- ignore actions from MyProgram - that's where I do maintenance
          ELSE
             -- compose the message
             msg := 'Subject: Oracle error '||' on '||sid_name||crlf;
             msg := msg||'To: '||recipient_address||crlf;
             msg := msg||'For more information see the alert log file located at:'||crlf;
             msg := msg||bdump_dest||'/alert_'||sid_name||'.log'||crlf;
             msg := msg||'or the error log file: $'||log_file_dir||'/'||log_file_name||crlf;
             msg := msg||'Error Time='||TO_CHAR(SYSDATE,'DD-Mon-YYYY HH24:MI:SS')||crlf;
             msg := msg||DBMS_UTILITY.FORMAT_CALL_STACK||crlf;
             LinesOfSQL := sql_txt(offending_sql);
             msg := msg||'Offending SQL is:'||crlf;
             FOR loop_counter IN offending_sql.FIRST..offending_sql.LAST
             LOOP
                msg := msg||offending_sql(loop_counter);
             END LOOP;
             msg := msg||crlf||'----- PL/SQL Error Stack -----'||crlf;
             msg := msg||DBMS_UTILITY.FORMAT_ERROR_STACK||crlf;
             msg := msg||'V$SESSION.SADDR='   ||session_rec.saddr   ||crlf;
             msg := msg||'V$SESSION.SID='     ||session_rec.sid     ||crlf;
             msg := msg||'V$SESSION.SERIAL#=' ||session_rec.serial# ||crlf;
             msg := msg||'V$SESSION.AUDSID='  ||session_rec.audsid  ||crlf;
             msg := msg||'V$SESSION.PADDR='   ||session_rec.paddr   ||crlf;
             msg := msg||'V$SESSION.USER#='   ||session_rec.user#   ||crlf;
             msg := msg||'V$SESSION.USERNAME='||session_rec.username||crlf;
             msg := msg||'V$SESSION.COMMAND=' ||session_rec.command ||crlf;
             msg := msg||'V$SESSION.OWNERID=' ||session_rec.ownerid ||crlf;
             msg := msg||'V$SESSION.TADDR='   ||NVL(session_rec.taddr   ,'Null')||crlf;
             msg := msg||'V$SESSION.LOCKWAIT='||NVL(session_rec.lockwait,'Null')||crlf;
             msg := msg||'V$SESSION.STATUS='  ||NVL(session_rec.status  ,'Null')||crlf;
             msg := msg||'V$SESSION.SERVER='  ||NVL(session_rec.server  ,'Null')||crlf;
             msg := msg||'V$SESSION.SCHEMA#=' ||session_rec.schema#||crlf;
             msg := msg||'V$SESSION.SCHEMANAME=' ||NVL(session_rec.schemaname,'Null')||crlf;
             msg := msg||'V$SESSION.OSUSER='     ||NVL(session_rec.osuser    ,'Null')||crlf;
             msg := msg||'V$SESSION.PROCESS='    ||NVL(session_rec.process   ,'Null')||crlf;
             msg := msg||'V$SESSION.MACHINE='    ||NVL(session_rec.machine   ,'Null')||crlf;
             msg := msg||'V$SESSION.TERMINAL='   ||NVL(session_rec.terminal  ,'Null')||crlf;
             msg := msg||'V$SESSION.PROGRAM='    ||NVL(session_rec.program   ,'Null')||crlf;
             msg := msg||'V$SESSION.TYPE='       ||NVL(session_rec.type      ,'Null')||crlf;
             msg := msg||'V$SESSION.SQL_ADDRESS='    ||session_rec.sql_address  ||crlf;
             msg := msg||'V$SESSION.SQL_HASH_VALUE=' ||NVL(TO_CHAR(session_rec.sql_hash_value) ,'Null')||crlf;
             msg := msg||'V$SESSION.PREV_SQL_ADDR='  ||session_rec.prev_sql_addr||crlf;
             msg := msg||'V$SESSION.PREV_HASH_VALUE='||NVL(TO_CHAR(session_rec.prev_hash_value),'Null')||crlf;
             msg := msg||'V$SESSION.MODULE='     ||NVL(session_rec.module              ,'Null')||crlf;
             msg := msg||'V$SESSION.MODULE_HASH='||NVL(TO_CHAR(session_rec.module_hash),'Null')||crlf;
             msg := msg||'V$SESSION.ACTION='     ||NVL(session_rec.action              ,'Null')||crlf;
             msg := msg||'V$SESSION.ACTION_HASH='||NVL(TO_CHAR(session_rec.action_hash),'Null')||crlf;
             msg := msg||'V$SESSION.CLIENT_INFO='||NVL(session_rec.client_info         ,'Null')||crlf;
             msg := msg||'V$SESSION.FIXED_TABLE_SEQUENCE='||NVL(TO_CHAR(session_rec.fixed_table_sequence),'Null')||crlf;
             msg := msg||'V$SESSION.ROW_WAIT_OBJ#='  ||NVL(TO_CHAR(session_rec.row_wait_obj#)  ,'Null')||crlf;
             msg := msg||'V$SESSION.ROW_WAIT_FILE#=' ||NVL(TO_CHAR(session_rec.row_wait_file#) ,'Null')||crlf;
             msg := msg||'V$SESSION.ROW_WAIT_BLOCK#='||NVL(TO_CHAR(session_rec.row_wait_block#),'Null')||crlf;
             msg := msg||'V$SESSION.ROW_WAIT_ROW#='  ||NVL(TO_CHAR(session_rec.row_wait_row#)  ,'Null')||crlf;
             msg := msg||'V$SESSION.LOGON_TIME='     ||NVL(TO_CHAR(session_rec.logon_time,'DD-Mon-YYYY HH24:MI:SS'),'Null')||crlf;
             msg := msg||'V$SESSION.LAST_CALL_ET='   ||NVL(TO_CHAR(session_rec.last_call_et)   ,'Null')||crlf;
             msg := msg||'V$SESSION.PDML_ENABLED='   ||NVL(session_rec.pdml_enabled   ,'Null')||crlf;
             msg := msg||'V$SESSION.FAILOVER_TYPE='  ||NVL(session_rec.failover_type  ,'Null')||crlf;
             msg := msg||'V$SESSION.FAILOVER_METHOD='||NVL(session_rec.failover_method,'Null')||crlf;
             msg := msg||'V$SESSION.FAILED_OVER='    ||NVL(session_rec.failed_over    ,'Null')||crlf;
             msg := msg||'V$SESSION.RESOURCE_CONSUMER_GROUP='||NVL(session_rec.resource_consumer_group,'Null')||crlf;
             msg := msg||'V$SESSION.PDML_STATUS='    ||NVL(session_rec.pdml_status    ,'Null')||crlf;
             msg := msg||'V$SESSION.PDDL_STATUS='    ||NVL(session_rec.pddl_status    ,'Null')||crlf;
             msg := msg||'V$SESSION.PQ_STATUS='      ||NVL(session_rec.pq_status      ,'Null')||crlf;
             IF auditing THEN
                msg := msg||'DBA_AUDIT_TRAIL.OS_USERNAME='  ||NVL(audit_rec.os_username,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.USERNAME='     ||NVL(audit_rec.username   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.USERHOST='     ||NVL(audit_rec.userhost   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.TERMINAL='     ||NVL(audit_rec.terminal   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.TIMESTAMP='    ||TO_CHAR(audit_rec.timestamp,'DD-Mon-YYYY HH24:MI:SS')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.OWNER='        ||NVL(audit_rec.owner      ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.OBJ_NAME='     ||NVL(audit_rec.obj_name   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.ACTION='       ||audit_rec.action   ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.ACTION_NAME='  ||NVL(audit_rec.action_name   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.NEW_OWNER='    ||NVL(audit_rec.new_owner     ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.NEW_NAME='     ||NVL(audit_rec.new_name      ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.OBJ_PRIVILEGE='||NVL(audit_rec.obj_privilege ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.SYS_PRIVILEGE='||NVL(audit_rec.sys_privilege ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.ADMIN_OPTION=' ||NVL(audit_rec.admin_option  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.GRANTEE='      ||NVL(audit_rec.grantee       ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.AUDIT_OPTION=' ||NVL(audit_rec.audit_option  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.SES_ACTIONS='  ||NVL(audit_rec.ses_actions   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_TIME='  ||NVL(TO_CHAR(audit_rec.logoff_time)  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_LREAD=' ||NVL(TO_CHAR(audit_rec.logoff_lread) ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_PREAD=' ||NVL(TO_CHAR(audit_rec.logoff_pread) ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_LWRITE='||NVL(TO_CHAR(audit_rec.logoff_lwrite),'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_DLOCK=' ||NVL(audit_rec.logoff_dlock  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.COMMENT_TEXT=' ||NVL(audit_rec.comment_text  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.SESSIONID='    ||audit_rec.sessionid   ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.ENTRYID='      ||audit_rec.entryid     ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.STATEMENTID='  ||audit_rec.statementid ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.RETURNCODE='   ||audit_rec.returncode  ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.PRIV_USED='    ||NVL(audit_rec.priv_used,'Null')||crlf;
             END IF;
             msg := msg||'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'||crlf||crlf;
             -- write the message to the error log file
             log_file_handle := UTL_FILE.FOPEN (log_file_dir, log_file_name, 'A',maxlinesize);
             UTL_FILE.PUT_LINE(log_file_handle,msg);
             UTL_FILE.FCLOSE(log_file_handle);
             -- send the message by Email
             mail_conn := UTL_SMTP.open_connection(smtp_relay, mail_port);
             UTL_SMTP.HELO(mail_conn, smtp_relay);
             UTL_SMTP.MAIL(mail_conn, sender_address);
             UTL_SMTP.RCPT(mail_conn, recipient_address);
             UTL_SMTP.DATA(mail_conn, msg);
             UTL_SMTP.QUIT(mail_conn);
          END IF; -- client_program = MyProgram.exe
       END IF;
    END;
    /

  • Display BLOB from remote database

    Context: We are offloading documents (pdf) from our OLTP database to a dedicated 'output database.' These documents must be displayed from the application on our OLTP database using a database link. Various posts show that querying a BLOB from a remote database can best be implemented using a query on the remote table and an insert on a local (temporary) table. So far, so good. The idea is to display this BLOB using wpg_docload.download_file.
    BUT:
    When trying to display the pdf from this global temporary table an error occurs:
    ORA-14453: attempt to use a LOB of a temporary table, whose data has already been purged
    When trying to display from a normal table and issuing a rollback after wpg_docload.download_file results in another error:
    ORA-22922: nonexistent LOB value
    When trying to display from a normal table and not removing the record in any way, its works fine. Only I now have a garbage collection issue, because the remote date remain in my local (preferably temporary) table.
    It seems to me that mod_plsql needs an active session to display my pdf.
    Does anyone have an explanation for this behaviour and maybe a solution for my problem?
    Environment:
    local: 10.2.0.4.0
    remote: 11.1.0.7.0
    pdf size: ca. 150kB
    code used:
    PROCEDURE show_doc (p_nta_id IN NUMBER
    ,p_sessie IN NUMBER
    IS
    t_lob BLOB;
    t_lob2 BLOB := empty_blob();
    t_mime VARCHAR2(100);
    BEGIN
    -- copy BLOB into local global temp table
    INSERT INTO mvs_tmp_notaprint_bestanden
    npv_nta_id
    , npv_npe_sessie
    , mime_type
    , bestand
    ) -- from remote table
    SELECT npd.npv_nta_id
    ,npd.npv_npe_sessie
    ,npd.mime_type
    ,npd.bestand
    FROM mvs_notaprint_bestanden@marc npd
    WHERE npd.npv_nta_id ; = p_nta_id
    AND npd.npv_npe_sessie = p_sessie
    -- show BLOB from local global temp table
    SELECT t.bestand
    , t.mime_type
    INTO t_lob
    , t_mime
    FROM mvs_tmp_notaprint_bestanden t
    WHERE t.npv_nta_id ; = p_nta_id
    AND t.npv_npe_sessie ; = p_sessie
    t_lob2 := t_lob; -- buffer BLOB
    owa_util.mime_header(t_mime , FALSE );
    owa_util.http_header_close;
    wpg_docload.download_file(t_lob2);
    END show_doc;

    Andrew,
    thank you, the 'preserve rows' did the trick.
    Every query from a browser (even in the same browser session) is a new Oracle session, so the copied records in the global temporary table are gone after the page is displayed.
    Am I correct in assuming that each call from the browser results in a new Oracle session? I did a few tests and found for each call a different sessionid.
    Sincerly,
    Arne Suverein
    Edited by: Arne Suverein on Aug 18, 2009 3:35 PM

  • Getting LONG RAW from remote database

    Hi,
    I have a table in my local database that has a LONG RAW column . I have another table of similar structure in a remote database (so it has LONG RAW as well). I would like to transfer data including LONG RAW data from the remote database into the local database table using PL/SQL. I know it is not possible to copy LONG RAW over dblink directly. Can anyone suggest an approach to accomplish this?
    The local table cannot be changed to BLOB, but I have the flexibility to change the remote table to use BLOB. So, can anyone tell me if the following solution would work. If so, can you shed some light on what PL/SQL libraries to use or can you provide me with some sample code to implement steps 3 and 4 below?:
    1. Change the remote table to use BLOB
    2. Create a new temporary table with BLOB in the local database.
    3. Copy data using PL/SQL from remote BLOB to local temporary table BLOB.
    4. Copy data using PL/SQL from BLOB to LONG RAW within the local database from temporary table (w/ BLOB) to the actual target table (w/ LONG RAW).
    I think step 3 can be a direct Insert-Select from remote table (I'll try this myself), but not sure how to go about step 4.
    Thanks for your help.

    There is a chapter in the Oracle Application Developer's Guide on calling external procedures
    I don't know enough about VB and the available VB APIs to know for sure. I would assume that VB could be configured to generate a DLL with a C call specification. I would also assume that there was a VB API that would allow you to manipulate LONG RAW and BLOB data. Unfortunately, though, I don't know which VB API's have that functionality.
    Justin

Maybe you are looking for

  • Dynamic Positioning of Objects in a Grid (rows and columns) with AS3 Tutorial

    The topic of a dynamic positioning of objects in a right grid (rows and columns) comes up often so I decided to post an AS3 solution here: http://flashascript.wordpress.com/2010/12/25/arranging-objects-into-2d-dynamic-grid-with-a ctionscript-3/

  • ITunes can't sync my videos into my iDevices anymore!! :((

    Hey guys, My iTunes (v10.3.1.55) can successfully sync everything to my iPhone4/iPad2 except the new added videos (movies tab) though they're mp4 100% compatible!! even though they just don't appear in their playlists anymore FYI, I tried the followi

  • Query Output Issues

    Oracle: 10.2g with my_tab as (select 99999 player_id, 'John Smith' player_name, 'Bulls' team_name, 16 points, 1 sequence from dual union all                 select 99999 player_id, 'John Smith' player_name, 'Pistons' team_name, 4 points, 2 sequence f

  • @@TRANCOUNT gives unexpected value

    -- When I run this SQL, the value of @@TRANCOUNT = 0 both before and after -- the insert statement. So, why does the value of 2 get written to the -- table? I would expect a 1 to be written to the table, not 2. SET IMPLICIT_TRANSACTIONS OFF CREATE TA

  • How do i switch from dutch store to belgium store

    well, that's actually my question... how do i switch from dutch store to belgium store?