Reputation: 91
i do not know where the bug is. I must write the procedure where the 1 specific row will be chaned. Everytime i lunched it, wrote me:
Errors: PROCEDURE RENAME_FLYTICKET Line/Col: 1/65 PLS-00103: Encountered the symbol "(" when expecting one of the following:
:= . ) , @ % default character The symbol ":=" was substituted for "(" to continue.
CREATE OR REPLACE PROCEDURE rename_flyticket (code_ticket INTEGER, new_id varchar2(50)) AS
BEGIN
UPDATE Flyticket SET id = new_id WHERE flyticketcode = code_ticket;
COMMIT;
END;
Upvotes: 1
Views: 442
Reputation: 222502
I think that the syntax you want is:
create or replace procedure rename_flyticket (
p_code_ticket in integer,
p_new_id in varchar2
)
as
begin
update flyticket set id = p_new_id where flyticketcode = p_code_ticket;
commit;
end;
/
The main problem with the original code is that the datatypes do not take length/precision. So VARCHAR2(50)
should be just VARCHAR2
.
I also added the IN
keyword for parameters (that’s the default when not specified, but I find it is better to be explicit about that).
Upvotes: 2