an autosys or unix shell script to execute an oralce stored procedure

Posted on 2006-06-06
Last Modified: 2012-06-21
I have an oracle server which has a package TEST_FILES and one of the procedures  is

,p_Error_Type                   OUT ERROR_MESSAGES.ERROR_TYPE%TYPE
,c_rs out c_Cursor

how can I run shell script or schedule this in autosys every day at 3:30 and read the p_Error_Number that this stored procedure outputs. Check this error number.

Question by:tech_question
    1 Comment
    LVL 6

    Accepted Solution

    1 - create a script with this contents:

    sqlplus oracleuser/password@database <<end
    spool /tmp/result.txt

      here you place the oracle plsql block

    spool off

    2 -    chmod 777 yourscript

    3 -    ./yourscript

                 ( the output will be at /tmp/result.txt )

    4 - place in crontab, in order to run everday at 3:30 :
        crontab -e

     30 03 * * * /yourdir/yourscript

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
    This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now