Re: [External] : sqlcl Copy
Date: Thu, 23 Sep 2021 11:54:28 -0300
Message-ID: <CAEX1xDWyHKcwx_B48476JScd2D-p-3-h-865XQkvCOSU3U1k0A_at_mail.gmail.com>
Hello,
_at_Charlotte
Could the TO parameter be missing ? Let´s analyze the error message and
the syntax from the command.
"A missing FROM or TO clause uses the current SQL*Plus connection"
I think TO is mandatory, even if using a create table.
"usage: COPY FROM <db> TO <db> <opt> <table> { (<cols>) } USING <sel>"
again, it could be: COPY FROM _at_DB1 *TO* _at_db2 using create
test_table select * from dual;
In all your examples, the TO parameter is not there.
" SQL> copy from
Maybe you can try it, obeying the syntax from "usage: COPY FROM <db>
TO <db> <opt> <table> { (<cols>) } USING <sel>"
SQL> copy from
So, you can try it.
regards,
angelo
On Thu, 23 Sept 2021 at 06:00, Charlotte Hammond <
dmarc-noreply_at_freelists.org> wrote:
> Thanks Jeff.
/_at_(DESCRIPTION=(LOAD_BALANCE=OFF)(FAILOVER=ON)(CONNECT_TIMEOUT=10)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=source_host1))(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=source_host2)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=source_host3)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=SOURCEDB)))
create test_table using select * from dual; "
/_at_(DESCRIPTION=(LOAD_BALANCE=OFF)(FAILOVER=ON)(CONNECT_TIMEOUT=10)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=source_host1))(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=source_host2)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=source_host3)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=SOURCEDB)))
*TO* _at_DESTDB (or _at_description whatever) *USING *create test_table
using select * from dual;
>
> I've tried both without success. Here's the commands and output I've
> tried (same result both with and without the -oci flag):
>
> SQL> connect /_at_SOURCEDB <-- Checking passwordless connection with wallet to source
> Connected.
> SQL> connect /_at_DESTDB <-- Passwordless connection with wallet to dest
> Connected.
> SQL> copy from /_at_SOURCEDB create test_table using select * from dual;
>
> usage: COPY FROM <db> TO <db> <opt> <table> { (<cols>) } USING <sel>
> <db> : database string, e.g., hr/your_password_at_d:chicago-mktg
> <opt> : ONE of the keywords: APPEND, CREATE, INSERT, REPLACE,
> APPEND_BYTE, CREATE_BYTE or REPLACE_BYTE
> <table>: name of the destination table
> <cols> : a comma-separated list of destination column aliases
> <sel> : any valid SQL SELECT statement
> A missing FROM or TO clause uses the current SQL*Plus connection.
>
>
> or
>
> SQ> connect /_at_(DESCRIPTION=(LOAD_BALANCE=OFF)(FAILOVER=ON)(CONNECT_TIMEOUT=10)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=source_host1)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=(HOST=source_host2)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=(HOST=source_host3)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=SOURCEDB)))
> Connected.
> SQL> connect /_at_(DESCRIPTION=(LOAD_BALANCE=OFF)(FAILOVER=ON)(CONNECT_TIMEOUT=10)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=dest_host1)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=dest_host2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=DESTDB)))
> Connected.
> SQL> copy from /_at_(DESCRIPTION=(LOAD_BALANCE=OFF)(FAILOVER=ON)(CONNECT_TIMEOUT=10)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=source_host1))(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=source_host2)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=source_host3)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=SOURCEDB))) create test_table using select * from dual;
> usage: COPY FROM <db> TO <db> <opt> <table> { (<cols>) } USING <sel>
> <db> : database string, e.g., hr/your_password_at_d:chicago-mktg
> <opt> : ONE of the keywords: APPEND, CREATE, INSERT, REPLACE,
> APPEND_BYTE, CREATE_BYTE or REPLACE_BYTE
> <table>: name of the destination table
> <cols> : a comma-separated list of destination column aliases
> <sel> : any valid SQL SELECT statement
> A missing FROM or TO clause uses the current SQL*Plus connection.
>
>
>
>
>
>
>
>
>
> Thank You!
> Charlotte
>
>
>
>
> On Wednesday, September 22, 2021, 11:30:25 PM GMT+1, Jeff Smith <
> jeff.d.smith_at_oracle.com> wrote:
>
>
> I’m honestly not sure..in your copy command are you using a fully
> qualified jdbc URL that contains all the necessary wallet info, or are you
> relying on an OCI (thick) connection for an $ORACLE_HOME that already has
> TLS configured?
>
> Jeff
>
>
>
> *From:* oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> *On
> Behalf Of *Charlotte Hammond
> *Sent:* Wednesday, September 22, 2021 6:12 PM
> *To:* oracle-l_at_freelists.org
> *Subject:* [External] : sqlcl Copy
>
>
>
> Hello Everyone,
>
>
>
> Just a quick question - is the Oracle wallet supported by the COPY command
> in SQLcl? I can't get it to work but I'm not sure if it's not supported
> or if I'm just doing something wrong.
>
>
>
> Thank You!
>
> Charlotte
>
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Sep 23 2021 - 16:54:28 CEST