[cx-oracle-users] Copying tables between two schemas? SQ*PLUS (Mark Harrison)
Brought to you by:
atuining
From: Robert L. <rlu...@pi...> - 2011-11-28 22:14:37
|
>windows, you can use "sqlplus @foo" You can also do the above in unix It would be better to separate your sql*plus commands from the invocation of SQL*PLus. Recommend that you always use sqlplus @foo for all production code. >sqlplus -S -L scott/tiger@myorcl Embedding user name and password in a script file is dangerous. Recommend that put them in a separate file and read them in. This way can change them w/out changing your scripts. -- Below is original email Here's how to automate sqlplus in a shell script. I'm not familiar with the copy command, so it just uses a simple select command. If you need to do this in windows, you can use "sqlplus @foo" and put the commands in the file foo.sql $ cat auto-sqlplus #!/bin/sh sqlplus -S -L scott/tiger@myorcl <<. select 2+2 from dual; . $ chmod +x auto-sqlplus $ ./auto-sqlplus 2+2 ---------- 4 |