Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> INSERT in PL/SQL
Hi
I have discovered the following behaviour in PL/SQL. Is it possible to explain it?
Let's consider the following package:
create or replace package test as
procedure x;
end test;
/
create or replace package body test as
function y(param1 in number) return number;
procedure x is
begin
INSERT INTO T VALUES( y(1) );
end x;
function y(param1 in number) return number is begin
return (param1 * 2);
end y;
end test;
/
The package compiles without any problem, but when a call to procedure x is made,ORA-904 "invalid column name" error is generated in INSERT statement.
It starts to work when function y is declared in package specification (with appropriate pragma) and package qualifier is used in the call in the package body (i.e. the INSERT statement looks like following:
INSERT INTO T VALUES ( test.y(1) );
SY
Anton
P.S. Configuration:
Oracle7 Server Release 7.3.3.0.0 - Production Release
PL/SQL Release 2.3.3.0.0 - Production
Received on Wed May 06 1998 - 01:56:07 CDT
![]() |
![]() |