Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Novice: Loading Stored Procedure

Re: Novice: Loading Stored Procedure

From: John Russell <netnews5_at_johnrussell.mailshell.com>
Date: Wed, 30 Apr 2003 04:05:53 GMT
Message-ID: <h1ntav8o631ugcsv8dicm2ddglgbn9jkai@4ax.com>


On 22 Apr 2003 10:02:54 -0700, gilgantic_at_yahoo.com (gilgantic) wrote:

>How do you load a Stored Procedure into the Oracle environment? Currently, the
>only way I go about doing this is copy/paste my PL/SQL code from a text file
>into the SQLPLUS prompts. From my basic Oracle knowledge, I thought there was
>a way for Oracle to load up an <file>.sql into it the environment. Then I
>could run "EXECUTE <procedure name>" from a command line and/or UNIX script.
>
>Thanks!
>Gil

In your .sql file, put CREATE OR REPLACE PROCEDURE ... statements instead of just BEGIN ... END blocks. Also CREATE OR REPLACE FUNCTION ... You'll still need to execute the procedures from SQL*Plus. If you have a Unix script, the script will need to call SQL*Plus and redirect or pipe the relevant commands to it.

When you get a bunch of interrelated procedures and functions, you'll want to look into the CREATE PACKAGE statement.

John

--
Photo gallery: http://www.pbase.com/john_russell/
Received on Tue Apr 29 2003 - 23:05:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US