Re: Novice: Loading Stored Procedure

From: Frank <fvanbortel_at_netscape.net>
Date: Tue, 22 Apr 2003 19:46:21 +0200
Message-ID: <3EA57FED.6080903_at_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> _at_[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 _at_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 _at_test.pks (mostly followed by _at_test.pkb)

-- 
Regards, Frank van Bortel
Received on Tue Apr 22 2003 - 19:46:21 CEST

Original text of this message