Hi Everyone,
I am getting the following error message:
ORA-02019: connection description for remote database not found
ORA-02063: preceding line from ECGM
I am working in a database called ECSM. I set up a link called ECGM. I have been writing stored procedures to take data from ECSM and update tables in ECGM. I have over 100 procedures so far that are doing this without a hitch. But, I have encountered this error now for one procedure that I have written. Here is my code:
CREATE OR REPLACE PROCEDURE ERWIN.CONVERTCONTATTPHONE AS
ERROR_LOGIDY NUMBER;
ERROR_NUM INT;
v_ErrorCode NUMBER;
v_ErrorText VARCHAR2(200);
cursor c_phone is
select c.contactattorneyidy, c.phonenumber, c.phoneext,c.phonetypepid, c.primaryphoneind, a.attorneycontactidy
from tcontattphone c, tattorneycontact@ecgm a
where c.contactattorneyidy = a.attorneycontactidy
and c.primaryphoneind = 'Y';
begin
for i in c_phone loop
update TATTORNEYCONTACT@ecgm set
PHONENUMBER1 = i.phonenumber,
PHONEEXT1 = i.phoneext,
PHONETYPE1 = i.phonetypepid
where ATTORNEYCONTACTIDY = i.CONTACTATTORNEYIDY;
end loop;
commit;
EXCEPTION
WHEN OTHERS THEN
v_ErrorCode := SQLCODE;
v_ErrorText := substr(sqlerrm, 1, 200);
ROLLBACK;
SELECT SEQ_ERROR_LOG.NextVal INTO ERROR_NUM FROM dual;
SELECT SEQ_TERROR_LOG.NextVal INTO ERROR_LOGIDY FROM dual;
INSERT INTO TERROR_LOG (ERROR_LOGIDY, ERROR_ID, TEXT, CODE, OBJECT_NAME, RECORDDATE, USERNAME)
VALUES (ERROR_LOGIDY, ERROR_NUM, v_ErrorText, v_ErrorCode, 'CONVERTCONTATTPHONE', SYSDATE,'CONVERSION');
COMMIT;
END;
All of my procedures are written this way (aliases have not been a problem). I have tried pulling the select statement out of the cursor as follows...
select c.contactattorneyidy, c.phonenumber, c.phoneext,c.phonetypepid, c.primaryphoneind, a.attorneycontactidy
from tcontattphone c, tattorneycontact@ecgm a
where c.contactattorneyidy = a.attorneycontactidy
and c.primaryphoneind = 'Y';
and I get results returned to me. I can't figure it out! If anybody can offer any suggestions I would be greatly appreciative!
Thanks!
Stephany
I am getting the following error message:
ORA-02019: connection description for remote database not found
ORA-02063: preceding line from ECGM
I am working in a database called ECSM. I set up a link called ECGM. I have been writing stored procedures to take data from ECSM and update tables in ECGM. I have over 100 procedures so far that are doing this without a hitch. But, I have encountered this error now for one procedure that I have written. Here is my code:
CREATE OR REPLACE PROCEDURE ERWIN.CONVERTCONTATTPHONE AS
ERROR_LOGIDY NUMBER;
ERROR_NUM INT;
v_ErrorCode NUMBER;
v_ErrorText VARCHAR2(200);
cursor c_phone is
select c.contactattorneyidy, c.phonenumber, c.phoneext,c.phonetypepid, c.primaryphoneind, a.attorneycontactidy
from tcontattphone c, tattorneycontact@ecgm a
where c.contactattorneyidy = a.attorneycontactidy
and c.primaryphoneind = 'Y';
begin
for i in c_phone loop
update TATTORNEYCONTACT@ecgm set
PHONENUMBER1 = i.phonenumber,
PHONEEXT1 = i.phoneext,
PHONETYPE1 = i.phonetypepid
where ATTORNEYCONTACTIDY = i.CONTACTATTORNEYIDY;
end loop;
commit;
EXCEPTION
WHEN OTHERS THEN
v_ErrorCode := SQLCODE;
v_ErrorText := substr(sqlerrm, 1, 200);
ROLLBACK;
SELECT SEQ_ERROR_LOG.NextVal INTO ERROR_NUM FROM dual;
SELECT SEQ_TERROR_LOG.NextVal INTO ERROR_LOGIDY FROM dual;
INSERT INTO TERROR_LOG (ERROR_LOGIDY, ERROR_ID, TEXT, CODE, OBJECT_NAME, RECORDDATE, USERNAME)
VALUES (ERROR_LOGIDY, ERROR_NUM, v_ErrorText, v_ErrorCode, 'CONVERTCONTATTPHONE', SYSDATE,'CONVERSION');
COMMIT;
END;
All of my procedures are written this way (aliases have not been a problem). I have tried pulling the select statement out of the cursor as follows...
select c.contactattorneyidy, c.phonenumber, c.phoneext,c.phonetypepid, c.primaryphoneind, a.attorneycontactidy
from tcontattphone c, tattorneycontact@ecgm a
where c.contactattorneyidy = a.attorneycontactidy
and c.primaryphoneind = 'Y';
and I get results returned to me. I can't figure it out! If anybody can offer any suggestions I would be greatly appreciative!
Thanks!
Stephany