0
votes

After executing it shows:

Compilation errors for PACKAGE BODY TEMP_PACKAGE

Error: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin end function pragma procedure Line: 17

create or replace package body TEMP_PACKAGE is

procedure insert_temp
(aaCode number,aaName varchar2, aaAddress varchar2, 
 aaPhone varchar2, aaState varchar2 ) 

 is
 begin
 INSERT INTO temp_employee_azizbek
 (code, aadName, aadAddress, aadPhone, aadState )
 VALUES (aaCode, aaName,aaAddress,aaPhone,aaState);

 end;

What is my mistake?

1
you are missing one end. Add one to the end of the script. you only have 1 for your procedure, but not for the whole package - Sudipta Mondal
Thank you, after adding extra end it compiled successfully ! - A. Aziz
If you format the code neatly with consistent indentation and use the extended end syntax (end insert_temp; end temp_package;) this type of error becomes harder to miss. - William Robertson

1 Answers

0
votes

an extra end is missing, and you need package definition (header) besides package body :

create or replace package TEMP_PACKAGE is
 procedure insert_temp(aaCode number,aaName varchar2, aaAddress varchar2, 
                       aaPhone varchar2, aaState varchar2 );
end TEMP_PACKAGE;
/
create or replace package body TEMP_PACKAGE is

procedure insert_temp(aaCode number,aaName varchar2, aaAddress varchar2, 
                      aaPhone varchar2, aaState varchar2 ) is
begin
 INSERT INTO temp_employee_azizbek
 (code, aadName, aadAddress, aadPhone, aadState )
 VALUES (aaCode, aaName,aaAddress,aaPhone,aaState);
end;
end TEMP_PACKAGE;
/