Home > Enterprise >  Why am I receiving the PSL-00103 Error in Oracle SQL?
Why am I receiving the PSL-00103 Error in Oracle SQL?

Time:04-20

I am trying to make a procedure that would insert a row into a table in Oracle SQL. However, I can't figure out a solid reason on why this issue exists when I write any type of procedure.

I have tried changing the syntax around a couple of times, but I still don't know how to remedy the issue.

Errors given:

Error at line 1: PLS-00103: Encountered the symbol ")" when expecting one of the following: in out table ... columns long double ref char time timestamp interval date binary national character nchar
Error at line 5: PL/SQL: SQL Statement ignored Error at line 6: PL/SQL: ORA-00984: column not allowed here

Code:

create or replace procedure insert_category(
    category_name_param in categories.category_name%type)
as
begin
    insert into categories (category_id, category_name)
    values (category_id, category_name_param);
end;

CodePudding user response:

It seems that procedure lacks in yet another parameter; see if this helps (I presumed that such a column exists in the table; can't be sure as you didn't post table description):

create or replace procedure insert_category(
    category_name_param in categories.category_name%type,
    category_id_param   in categories.category_id%type      --> this
   )
as
begin
    insert into categories 
      (category_id, 
       category_name)
    values 
      (category_id_param,                                   --> this 
       category_name_param);
end;
  • Related