I Defined SP1, Sp2 (sp=StoreProcedures)In Package Specification but I Implemented Sp1, sp2, sp3, sp4, sp5
then What type of Error You will find????

Answers were Sorted based on User's Feedback



I Defined SP1, Sp2 (sp=StoreProcedures)In Package Specification but I Implemented Sp1, sp2, sp3, sp4..

Answer / ramesh

Nothing Happend package body created with no  errors.
Ex:
 create or replace package jan
 is
 procedure sp1;
 procedure sp2;
 end;
PACKAGE CREATED

 create or replace package body jan as
 procedure sp1 as
 begin
 dbms_output.put_line('hello');
 end;
 procedure sp2 as
 begin
 dbms_output.put_line('how are you');
 end;
 procedure sp3 as
 begin
 dbms_output.put_line('ok');
 end sp3;
 procedure sp4 as
 begin
 dbms_output.put_line('ramesh');
 end sp4;
 end;
PACKAGE BODY CREATED

Is This Answer Correct ?    14 Yes 2 No

I Defined SP1, Sp2 (sp=StoreProcedures)In Package Specification but I Implemented Sp1, sp2, sp3, sp4..

Answer / ashokram s

As Ramesh said
when creating the package body with procs that are not declared in specification, no error will be throwed. But when executing you cant execute the undeclared procs:

SQL> SET SERVEROUTPUT ON;
SQL> EXEC jan.sp1;
hello

PL/SQL procedure successfully completed.

SQL> EXEC jan.sp2;
how are you

PL/SQL procedure successfully completed.

SQL> EXEC jan.sp3;
BEGIN jan.sp3; END;

*
ERROR at line 1:
ORA-06550: line 1, column 11:
PLS-00302: component 'SP3' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Is This Answer Correct ?    3 Yes 0 No

I Defined SP1, Sp2 (sp=StoreProcedures)In Package Specification but I Implemented Sp1, sp2, sp3, sp4..

Answer / abhijit

If you are saying SP defined in package specification then compiler will give an error PLS-00103.

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

What is the default value of CHAR type?

3 Answers   Bosch,


how to analyze tables with 'mysqlcheck'? : Sql dba

0 Answers  


Explain autonomous transaction.

0 Answers  


I am creating an index on Emp table Empno column,if u using this indexed column in ur SELECT stmt. where clause,then how do u know that yr index will be working or nor? Thanks Advance...

3 Answers  


what are the nonstandard string types? : Sql dba

0 Answers  






How toimport .dmp file in lower version of oracle from higher version ?

4 Answers   TCS,


How do you write an index?

0 Answers  


what are the disadvantages of mysql? : Sql dba

0 Answers  


Can you sum a count in sql?

0 Answers  


What is PL/SQL table ?

6 Answers  


Which query operators in sql is used for pattern matching?

0 Answers  


What is the syntax to add a record to a table?

0 Answers  


Categories