how to use copy command in strored procedure.
<b>copy from scott/tiger[[@]]orcl replace emp using select * from emp</b>
Kindly reply me ASAP
Regards
Haseeb
COPY COMMAND
-
- Posts: 18
- Joined: Fri Sep 19, 2008 1:11 am
- Location: Pakistan
CREATE OR REPLACE PROCEDURE COPY_EMP as
job_no number;
BEGIN
dbms_job.submit(job_no,'copy from scott/tiger[@]orcl replace emp using select * from emp;',
SYSDATE,'SYSDATE+(60/(24*60*60))');
COMMIT;
END;
The above procedure created without any error.
But it does'nt execute.
Kindly guide me ASAP.
Regards
Haseeb
job_no number;
BEGIN
dbms_job.submit(job_no,'copy from scott/tiger[@]orcl replace emp using select * from emp;',
SYSDATE,'SYSDATE+(60/(24*60*60))');
COMMIT;
END;
The above procedure created without any error.
But it does'nt execute.
Kindly guide me ASAP.
Regards
Haseeb
Hi Haseeb
The COPY command is a sqlplus command only. It is facilitated by the fact that sqlplus can connect to different databases simultaneously. PLSQL cannot.
I'm giving an example to use it as a shell script hope it could be helpful.
Amir
#!/bin/sh
sqlplus -s user/password[@]prod_db <<EOF
copy from scott/tiger[@]orcl replace emp using select * from emp
exit
EOF
The COPY command is a sqlplus command only. It is facilitated by the fact that sqlplus can connect to different databases simultaneously. PLSQL cannot.
I'm giving an example to use it as a shell script hope it could be helpful.
Amir
#!/bin/sh
sqlplus -s user/password[@]prod_db <<EOF
copy from scott/tiger[@]orcl replace emp using select * from emp
exit
EOF
Who is online
Users browsing this forum: No registered users and 9 guests