Problem solved – the symbol “(” appears when one of the following is required)
the
When creating a stored procedure today, I encountered a problem, as follows:
www.2cto.com
PROCEDURE QIUYUE.PRO_INSERT_DYNA_TABLE compile error
ERROR: PLS-00103: The symbol “(” occurred when one of the following was expected:
:= . ) , @ % default
character
The symbol “:=” is replaced with “(” to continue.
row: 3
Text: id in number(3)
the
Below is my stored procedure:
[sql]
create or replace procedure pro_insert_dyna_table
( www.2cto.com
id in number(3),
name in varchar2
)
is
str_sql varchar2(500);
begin
str_sql :='insert into pro_create_dyna_table values(:1,:2)';
execute immediate str_sql using id,name;
end pro_insert_dyna_table;
the
It is said to be a “(” problem, but I took a closer look, and it is still fine. Suddenly, I encountered such a problem when executing the PL program block in the morning:
[sql]
declare
sum number;
begin
execute immediate 'select count(*) from stu' into sum;
dbms_output.put_line(sum); –Wrong cursor position
end;
the
ORA-06550: line 5, column 25:
PLS-00103: Symbol “)” occurs when one of the following is required:
( www.2cto.com
the
It’s still the problem of brackets. I have been working on it for a long time in the morning, because I feel that there is no mistake because of “)” in a simple sentence. Later, inadvertently, I suddenly realized that sum is a keyword. so…
Was it the same in the afternoon?
In order to avoid this situation, I replaced the id and name with id1 and name1, but the result is still the same, dizzy!
Or because of a sudden idea, I realized that when creating a stored procedure, it is not possible to specify a precise type for the data type of the parameter, such as the use of number, and number(2) cannot be used in the stored procedure.
the
Summarize:
1. When defining variable names, be sure to note that variable names cannot be keywords
2. When creating a stored procedure, the data type of the parameter cannot specify the exact data type. For example, only number, varchar2 can be used, not varchar2(4)
the
the
Author yang15225094594
Problem solved – the symbol “(” appears when one of the following is required)
This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/problem-solved-the-symbol-appears-when-one-of-the-following-is-required/