1

I keep getting these problems when all I wanted was to display the maximum salary of an employee in a job id

ORA-06550: line 12, column 6:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 8, column 6:
PL/SQL: SQL Statement ignored

Here's my code:

DECLARE
    lvc_jb_id VARCHAR2;
    lvn_max_sal NUMBER;
BEGIN
    SELECT max(salary), job_id
    INTO lvn_max_sal, lvc_jb_id
    FROM EMPLOYEES 
    group by job_id
    DBMS_OUTPUT.PUT_LINE('MAX SALARY for job_id is'|| lvn_max_sal);
    DBMS_OUTPUT.PUT_LINE('job id '|| lvc_jb_id);
END;

Can anyone tell what I did wrong?

4

1 回答 1

2

指定字符串的大小。例如:lvc_jb_id VARCHAR2(50);

用分号结束选择查询。现在它应该可以工作了。

于 2012-11-25T16:34:44.187 回答