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

Home -> Community -> Mailing Lists -> Oracle-L -> using SQL*Plus COPY command without a database link

using SQL*Plus COPY command without a database link

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Fri, 01 Jun 2001 12:12:45 -0700
Message-ID: <F001.00318627.20010601120324@fatcity.com>

The documentation on SQL*Plus' COPY command says the following:

<<
COPY { FROM username[/password]@net_service_name |

       TO username[/password]@net_service_name |
       FROM username[/password]@net_service_name
       TO username[/password]@net_service_name
     }

>>

(note - the above means that you can specify FROM or TO or both, but you have to specify at least one)

and

<<
net_service_name
Consists of a Net8 connection string. You must include a net_service_name clause in the COPY command. In the FROM clause, net_service_name represents the database at the source; in the TO clause, net_service_name represents the database at the destination.

>>

This syntax makes it necessary, if I want to COPY from one table to another IN THE SAME database, to create an entry for the database in an Oracle Names server or the TNSNAMES.ORA file (and also register that database with a listener).

Has anyone ever found a clever way of using the COPY command without specifying the "net_service_name"?

Or in other words, here is the problem I am trying to solve: I am writing a SQL*Plus script that I would like to be able to run on any database. The script will rename a table that has a column with datatype LONG, create a new version of the table, and move the data from the old table to the new table. For several reasons the script has to be written in SQL*Plus. Am I out of luck?



Jacques R. Kilchoer
(949) 754-8816
Quest Software, Inc.
8001 Irvine Center Drive
Irvine, California 92618
U.S.A.
http://www.quest.com Received on Fri Jun 01 2001 - 14:12:45 CDT

Original text of this message

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