0

I have a procedure named student_id

 procedure student_id ( v_surname  in varchar2,  
                        v_name in varchar2,  
                        v_date_birth in varchar2,
                        v_gender in varchar2,
                        v_state in varchar2)  is l_student_id varchar2;
 begin
 l_student_id :=  par_surname(v_surname)       ||'-'||
                  par_name(v_name)             ||'-'||
                  par_date_birht(v_date_birth) ||'-'||
                  par_gender(v_gender)         ||'-'||
                  par_state(v_state);
 dbms_output.put_line('Student ID :  ' ||  l_student_id);
end student_id;

What my expected output should be after I will write the values :

(Student ID : JOHN-SMITH-170692-M-CALIFORNIA)

Error I get:

Error with beginning of line: 291  in the command -
procedure cod_fiscale ( v_surname  in varchar2,
Report error -
unknown command   

Error with beginning of line : 292 in the command -
                        v_name  in varchar2,
Report error -
unknown command  

Error with beginning of line : 293 in the command -
                        v_date_birth  in varchar2,
Report error -
unknown command    

Error with beginning of line : 294 in the command -
                        v_gender  in varchar2,
Report error -
unknown command    

SP2-0044:to get the list of known commands, enter HELP
and enter EXIT to exit.
Error with beginning of line : 295 in the command -
                        v_state  in varchar2) is l_student_id varchar2;
Report error -
unknown command    

Error with beginning of line : 296 in the command -
begin
 l_student_id :=  par_surname(v_surname)       ||'-'||
                  par_name(v_name)             ||'-'||
                  par_date_birht(v_date_birth) ||'-'||
                  par_gender(v_gender)         ||'-'||
                  par_state(v_state);
 dbms_output.put_line('Student ID :  ' ||  l_student_id);
end student_id;
Report error -
ORA-06550: line 9, column 25:
PLS-00103: Found symbol   "" 
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

I roughly translated the error I got because it was in another language.

*Note: This isn't a standalone procedure, this code is related to my previous question.

Found at :How to write a PL/SQL procedure with x input parameters and input/ouput of x parameters combined*

What is my error here? What is the cause of the error?

Silent Storm
  • 21
  • 1
  • 3
  • If this is a standalone procedure, you need to add a `CREATE` (or, more likely, a `CREATE OR REPLACE`) in front of the word `PROCEDURE` – Boneist May 04 '21 at 11:31
  • I forgot to mention it, it isnt a standalone procedure. There are 5 functions and this procedure "unite" the 5 functions. Too see better, I will link my previous question that is related to this. https://stackoverflow.com/questions/67372067/how-to-write-a-pl-sql-procedure-with-x-input-parameters-and-input-ouput-of-x-par – Silent Storm May 04 '21 at 11:35

1 Answers1

0

Without seeing the rest of your package, I can spot one issue:

procedure student_id ( v_surname  in varchar2,  
                        v_name in varchar2,  
                        v_date_birth in varchar2,
                        v_gender in varchar2,
                        v_state in varchar2)  is
  l_student_id varchar2; -- you need to declare the length of your variable
begin
  ...

You've declared the type of your variable, but you haven't said how long it needs to be. It should be something like:

l_student_id varchar2(400);

although you should change the 400 to the right value for the expected maximum length of the values that will be stored in that variable.

Boneist
  • 22,910
  • 1
  • 25
  • 40
  • I also get an error after begin, I get this: Errore(398,23): PLS-00103:Found symbol "name" instead of i: . ( * % & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset Il simbolo "." it is substituted to permit name to continue(?) I roughly translated it, I get that error for all the next parameters( surname,gender, ecc) – Silent Storm May 04 '21 at 12:17
  • I suggest you edit your question to provide the full package listing. I can't take what you've provided and debug it myself, because there isn't enough context available. The new issue might lie elsewhere in your package. – Boneist May 04 '21 at 13:50