Oracle PLS-00103 error while doing INSERT

Asked

Viewed 759 times

2

I cannot understand this Oracle syntax error:

SET SERVEROUTPUT ON

DECLARE

v_idEmp INTEGER: = &numero_funcionario;
v_nome VARCHAR(30): = '&nome';
v_sobrenome VARCHAR(30): = '&sobrenome';
v_email VARCHAR(30): = '&email';
v_tel VARCHAR(15): = '&tel';
v_idCargo VARCHAR: = '&idCargo';
v_salario DOUBLE: = &salario;
v_comissao NUMBER(2): = 200;
v_managerId INTEGER: = &managerId;
v_deptoId INTEGER: = &deptoId;

BEGIN

INSERT INTO EMPLOYEES(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID)
VALUES(v_idEmp, 'v_nome', 'v_sobrenome', 'v_email', 'v_tel', sysdate, 'v_idCargo', v_salario, v_comissao, v_managerId, v_deptoId);


END;
/

Issues that error:

Error report - ORA-06550: row 8, column 20: PLS-00103: Found the symbol "=" when one of the following symbols was expected:

precision The symbol "precision" has been replaced by "=" for carry on. 06550. 00000 - "line %s, column %s: n%s" *Cause: Usually a PL/SQL Compilation error. *Action:

Anyone can help?

  • 1

    Oracle does not differentiate : = of :=?

  • Yeah, the operator is :=, the two symbols together. You cannot have this space between them.

  • Even without the space it indicates the same error. In fact the code is without the spaces, they appeared when placing it in the post.

1 answer

2

I think I have too many quotes ....

follows the proposed solution , I could not test however

SET SERVEROUTPUT ON

DECLARE

v_idEmp INTEGER := &numero_funcionario;
v_nome VARCHAR(30) := &nome;
v_sobrenome VARCHAR(30) := &sobrenome;
v_email VARCHAR(30) := &email;
v_tel VARCHAR(15) := &tel;
v_idCargo VARCHAR := &idCargo;
v_salario DOUBLE := &salario;
v_comissao NUMBER(2) := 200;
v_managerId INTEGER := &managerId;
v_deptoId INTEGER := &deptoId;

BEGIN

INSERT INTO EMPLOYEES(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID)
VALUES(v_idEmp, v_nome, v_sobrenome, v_email, v_tel, sysdate, v_idCargo, v_salario, v_comissao, v_managerId, v_deptoId);


END;
/
  • Obs not attuned to the : = correct for:=

  • Hello, the same error persists Bug report - ORA-06550: row 9, column 17: PLS-00103: Found the "=" symbol when one of the following symbols was expected: precision The "precision" symbol has been replaced by "=" to continue. 06550. 00000 - "line %s, column %s: n%s" *Cause: Usually a PL/SQL Compilation error. *Action:

  • I made an edit, try again

  • Still the same mistake, can you tell me if this symbol "precision" would be the size of the data? It indicates the error on line 9 where is the variable for the phone num.

  • Can be a value with size above the field limit;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.