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: Frank <fvanbortel_at_netscape.net>
Date: Tue, 22 Apr 2003 19:46:21 +0200
Message-ID: <3EA57FED.6080903@netscape.net>


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

save your code in a file, and then:
SQL> @[your file name]

It must have an extension, or else oracle will assume it has the (default) extension of .sql.
So, you cannot use test as filename, because @test makes oracle search for test.sql (in the current directory, and the all directories, defined in SQLPATH).
You could use pkb (for Package Bodies) and pks (package spec) as extensions, along with .trg (triggers), .fnc (functions), .prc (procedures), etc, etc.

If your file is called test.pks, use @test.pks (mostly followed by @test.pkb)

-- 
Regards, Frank van Bortel
Received on Tue Apr 22 2003 - 12:46:21 CDT

Original text of this message

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