Home » SQL & PL/SQL » SQL & PL/SQL » one-time-only Procedure
one-time-only Procedure [message #329297] Tue, 24 June 2008 23:49 Go to next message
ramya29p
Messages: 146
Registered: November 2007
Location: Chennai
Senior Member
Hi... I am Trying to Create One-time-Only Procedure But i am getting error... Can any one please tell me is this code is correct or not.....?

SQL> create or replace package emp_pkg as
  2  function f_fun1 return number;
  3  end emp_pkg;
  4  /

Package created.

SQL> create or replace package body emp_pkg as
  2  a number;
  3  function f_fun1 retrun number is
  4  begin
  5  return 10;
  6  end f_fun1;
  7  begin
  8  dbms_output.put_line('Executing one-time-only');
  9  end emp_pkg;
 10  /

Warning: Package Body created with compilation errors.

Re: one-time-only Procedure [message #329302 is a reply to message #329297] Wed, 25 June 2008 00:12 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
If you type "show errors" after you get that error message you can see what is wrong:
SQL> show errors
Errors for PACKAGE BODY EMP_PKG:

LINE/COL ERROR
-------- -----------------------------------------------------------------
3/19     PLS-00103: Encountered the symbol "RETRUN" when expecting one of
         the following:
         ( return
         The symbol "return was inserted before "RETRUN" to continue.


An alternative is to select from user_errors.

[Updated on: Wed, 25 June 2008 00:13]

Report message to a moderator

Re: one-time-only Procedure [message #329467 is a reply to message #329297] Wed, 25 June 2008 08:52 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
It's completely off-topic.

I am more curious to know from where you got this phrase
Quote:
I am Trying to Create One-time-Only Procedure

Regards

Raj
Re: one-time-only Procedure [message #330191 is a reply to message #329467] Fri, 27 June 2008 18:39 Go to previous message
Barbara Boehmer
Messages: 9088
Registered: November 2002
Location: California, USA
Senior Member
S.Rajaram wrote on Wed, 25 June 2008 06:52
It's completely off-topic.

I am more curious to know from where you got this phrase
Quote:
I am Trying to Create One-time-Only Procedure

Regards

Raj


In the student guide from an 8i "Develop PL/SQL Program Units" class that I took at Oracle years ago, there is a section entitled "creating a one-time-only procedure", which is what they called it back then. Current documentation refers to it as the "initialization part" of the package.

Previous Topic: ORA-00936: missing expression
Next Topic: HOW DO I DO A COUNT ON PT ID
Goto Forum:
  


Current Time: Fri Apr 19 11:31:55 CDT 2024