Home > database >  Query script, suggesting the open the statement in the string is null or length is zero
Query script, suggesting the open the statement in the string is null or length is zero

Time:10-10

The source code is as follows:
The CREATE OR REPLACE Procedure sRptRPT10020000002723
(SysOrgCode In VarChar2,
SysUserId In Number,
SysUserCode In VarChar2,
SysUserName In VarChar2,
UParamvs_BgnDate in Date,
UParamvs_EndDate in Date,
Result_Set Out pxt_db. CCurType)
Is
Vs_BgnDate varchar2 (10); -- -- -- -- -- -- -- -- define the start date
Vs_EndDate varchar2 (10); -- -- -- -- -- -- -- -- define the end date
Vs_YYYYMM varchar2 (6); -- -- -- -- -- -- -- -- table variables
Vs_sql varchar2 (8000); -- -- -- -- -- -- -- -- defined characters

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
define a variable
The begin

Vs_BgnDate:=to_char (vs_BgnDate, 'MM - DD YYYY -');
Vs_EndDate:=to_char (vs_EndDate, 'MM - DD YYYY -');


Vs_YYYYMM:=substr (vs_BgnDate, 1, 4) | | substr (vs_EndDate, 6, 2);

If pxt_db. Exist_Object (upper (' tSalPluDetail '| | vs_YYYYMM),' synonym ', ' ') then
Vs_sql:='SELECT depcode, depname plucode, pluname,
The sum (xscount) as xscount,
The sum (price) as price,
The sum (fsprice) as fsprice,
The sum (HXTotal) as HXTotal,
The sum (CxTotal) as CxTotal,
The sum (hmtotal) as hmtotal,
ROUND (100, 2 (hmtotal/hxtotal) *) as mltotal
The FROM tSalPluDetail | | vs_YYYYMM)
WHERE rptdate BETWEEN "' | | vs_BgnDate | | ' ' 'and' ' '| | vs_EndDate | |'" '
Group by depcode, depname plucode pluname,
ROUND (100, 2 (hmtotal/hxtotal) *) ';
End the if;

The open result_set for (vs_sql);

End sRptRPT10020000002723;
Query error:

How do you solve this problem

CodePudding user response:

The open result_set for (vs_sql);
You write this sentence outside the if, vs_sql not assigned to the value, the length is not zero,
  • Related