-- @testpoint: opengauss关键字Lc_Collate(非保留),作为存储过程名,部分测试点合理报错
--关键字不带引号-成功
drop procedure if exists Lc_Collate;
SQL SUCCESS
create procedure Lc_Collate(
section     number(6),
salary_sum out number(8,2),
staffs_count out integer)
is
begin
    select sum(salary), count(*) into salary_sum, staffs_count from staffs where section_id = section;
end;
/
SQL SUCCESS
--关键字带双引号-成功
drop procedure if exists "Lc_Collate";
SQL SUCCESS
create procedure "Lc_Collate"(
section     number(6),
salary_sum out number(8,2),
staffs_count out integer)
is
begin
    select sum(salary), count(*) into salary_sum, staffs_count from staffs where section_id = section;
end;
/
SQL SUCCESS
--关键字带单引号-合理报错
drop procedure if exists 'Lc_Collate';
?.*ERROR: syntax error at or near "'Lc_Collate'".*
?.*Position: .*
create procedure 'Lc_Collate'(
section     number(6),
salary_sum out number(8,2),
staffs_count out integer)
is
begin
    select sum(salary), count(*) into salary_sum, staffs_count from staffs where section_id = section;
end;
/
?.*ERROR: syntax error at or near "'Lc_Collate'".*
?.*Position: .*
--关键字带反引号-合理报错
drop procedure if exists `Lc_Collate`;
?.*ERROR: syntax error at or near "`".*
?.*Position: .*
create procedure `Lc_Collate`(
section     number(6),
salary_sum out number(8,2),
staffs_count out integer)
is
begin
    select sum(salary), count(*) into salary_sum, staffs_count from staffs where section_id = section;
end;
/
?.*ERROR: syntax error at or near "`".*
?.*Position: .*
--清理环境
drop procedure if exists lc_Collate(section numeric, out salary_sum numeric, out staffs_count integer);
SQL SUCCESS
drop procedure if exists "Lc_Collate"(section numeric, out salary_sum numeric, out staffs_count integer);
SQL SUCCESS