David
David

Reputation: 1

attempting to do an update procedure but getting error - PL/SQL: ORA-00933:

create or replace PROCEDURE update_con
(
    c_id in       lds_consultant.consultant_id%type,
    cation in        lds_consultant.location%type,
    s_area in lds_consultant.specialist_area%type
)
IS
BEGIN
UPDATE lds_consultant 
SET 
location = cation
specialist_area =  s_area
WHERE consultant_id = c_id;
END;

Hello, I'm new to SQL and trying to create a procedure to update the specified table but for some reason it doesn't seem to work. If anyone could help it would be appreciated.

Upvotes: 0

Views: 40

Answers (1)

kara
kara

Reputation: 3455

You're missing a comma, between your modifiers

CREATE OR REPLACE PROCEDURE update_con (
    c_id     IN lds_consultant.consultant_id%TYPE,
    cation   IN lds_consultant.location%TYPE,
    s_area   IN lds_consultant.specialist_area%TYPE)
IS
BEGIN
    UPDATE
           lds_consultant -- Your Table
       SET
           location = cation, -- comma-seperated list of modifiers
           specialist_area = s_area
     WHERE
           consultant_id = c_id -- condition to filter rows
       ;
END;

Ora-00933 can be troubleshootet very simple. Check the row your error told you. Take the statement and check it stand-alone:

UPDATE lds_consultant
   SET location = cation, specialist_area = s_area
 WHERE consultant_id = c_id;

Upvotes: 1

Related Questions