Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: pl/sql compile error
hi,
you cannot define/restrict parameters in procedures, functions as well. try this:
SQLWKS> create table cover_area( 2> STATION_ID CHAR(6) , 3> AREA_CODE CHAR(5) not null, 4> primary key (station_id) 5> );
2> begin 3> insert into cover_area values(station_id, area_code); 4> end; 5> /
SQLWKS> begin 2> init_cover_area('123456','12345'); 3> end; 4> /
2>
STATIO AREA_
------ -----
123456 12345
1 row selected.
regards
Hakan
junfan wrote:
>
> Hi all
>
> I am a newbie to oracle. I just try to code some pl/sql program but
> frustrated by some simple mistakes as follows
>
> SQL> drop table cover_area;
>
> Table dropped.
>
> SQL> create table cover_area(
> 2 STATION_ID CHAR(6) references station,
> 3 AREA_CODE CHAR(5) not null,
> 4 primary key (station_id)
> 5 );
>
> Table created.
> SQL> create or replace procedure init_cover_area (station_id char(6),
> 2 area_code char(5)) as
> 3 begin
> 4 insert into cover_area values(station_id, area_code);
> 5 end;
> 6 /
>
> Warning: Procedure created with compilation errors.
>
> SQL> call init_cover_area('123456','12345');
> call init_cover_area('123456','12345')
> *
> ERROR at line 1:
> ORA-06575: Package or function INIT_COVER_AREA is in an invalid state
>
> I will be appreciated for any instruction.
>
> Regards
Received on Fri Jun 23 2000 - 00:00:00 CDT
![]() |
![]() |