?
Solved

FTP using PL/SQL and call PL/SQL procedure from UNIX

Posted on 2003-02-20
4
Medium Priority
?
2,660 Views
Last Modified: 2013-12-12
How can I call a PL/SQL procedure from a UNIX script?
And it can be done at a scheduled time?
Can I send a file using FTP from a PL/SQL procedure?, if not how can I do it with a UNIX script?

Thanks in advance!
0
Comment
Question by:marchmx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Expert Comment

by:stemu2000
ID: 7989637
0
 
LVL 1

Accepted Solution

by:
benpung earned 300 total points
ID: 7989701
below is an example of a shell script that calls pl/sql procedures and scripts. this is done at a scheduled time by using the crontab on the unix server to initiate this shell script, which in turn calls the procedures. hope this helps some.


# . /oracle/local/scripts/oracle.kshrc needs to be ran in order
# for the SQL code to be understood.
. /oracle/local/scripts/oracle.kshrc

# Environment variables
DBINSTANCE=dev
LOGON_NAME=mylogon
LOGON_PASSWD=mypassword
XML_DIR="/home/ehsitdev"

# Change directory to the xml directory
cd $XML_DIR

# Connect to Oracle database
inst $DBINSTANCE

# Start sqlplus, log in to database, and initiate error log file
sqlplus -s $LOGON_NAME/$LOGON_PASSWD << SQLCMDS

     SET heading off
     SET termout on
     SET trimspool on
     SET feedback off
     SET serveroutput on

select to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') as "Process Start Time" from dual;
EXEC setMaxMemorySize_proc(200000000);
COMMIT;
EXEC bo_material_proc;
EXEC transform_expression_proc;
COMMIT;
@$HOME/insert_to_tmp.sql
COMMIT;
EXEC get_tmp_record_proc;
@$HOME/update_picklist.sql
@$HOME/update_op_uom.sql
COMMIT;
select to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') as "Process End Time" from dual;

EXIT
SQLCMDS
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 10146105
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept benpung's comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Henka
EE Cleanup Volunteer
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question