Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Detecting the existence of remote table.
Well I figured it out so, dont bother replying.
And since I am guilty of premature posting I will
share my code with anyone interested.
/*
DECLARE
datex date;
BEGIN
select sysdate into datex from your_table_at_remote_database.world where
rownum = 1;
/* SUCCESS - the table exists * * Do whatever code you like here.... * */
EXCEPTION
when OTHERS then
/* FAILURE - the table does not exist or no data exists in table. * * Do whatever code you like here... * */
END;
/
Mark Reichman wrote:
> > In PL/SQL I would like to detect the existence of > a table on a remote machine. (i.e. the remote machine > is alive and the table exists.) If it does exitst, I would > like to truncate my local copy and copy the data from the > remote machine into my table. If it doesnt exist, I want > to leave my local table alone and retry later. I can do > most of this off the top of my head. I cannot figure out > a way to detect the existance of the remote table before I > truncate and populate my local table. All database links > already exist and work. ThanksReceived on Fri Jul 09 1999 - 09:19:08 CDT
![]() |
![]() |