Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Detecting the existence of remote table.

Re: Detecting the existence of remote table.

From: Mark Reichman <reichmam_at_rl.af.mil>
Date: Fri, 09 Jul 1999 10:19:08 -0400
Message-ID: <378604DC.6A16A15A@rl.af.mil>


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. Thanks
Received on Fri Jul 09 1999 - 09:19:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US