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?
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.