0

我有一个脚本化的计算视图,我正在尝试激活它,但是,每次我尝试激活时,我都会收到错误“未定义的 typeCode:-1.

代码如下:

/********* Begin Procedure Script ************/ 
BEGIN 

  vins = CE_OLAP_VIEW("_SYS_BIC"."wepredict.martyn.indico.automotive/AN_VEHICLESALES",
  ["CarlineID", "ModelYearID", "ProfileAge", SUM("NoOfVINs") AS "NoOfVINs"]);

  vins_proj = CE_PROJECTION(:vins, 
  ["CarlineID", "ModelYearID", "ProfileAge" AS "Day", "NoOfVINs"]);

  profiles = CE_CALC_VIEW("_SYS_BIC"."wepredict.martyn.indico.automotive/CA_PROFILES_CARLINECATEGORY",
  ["CarlineID", "CategoryID", "Day", "SeverityPercent"]);

  vin_svy_pcs = CE_JOIN(:vins_proj, :profiles, ["CarlineID", "CategoryID", "Day"],
  ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID", "Day", "NoOfVINs", "SeverityPercent"]);


  vin_earned_pos = CE_PROJECTION(:vin_svy_pcs, 
  ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID", "Day", "NoOfVINs", 
  "SeverityPercent" AS "Maturity",
  CE_CALC('("NoOfVINs" * "Maturity")', double) AS "EarnedPolicies"]);


  results = CE_AGGREGATION(:vin_earned_pos, 
  [SUM("NoOfVINs") AS "NoOfVINs", SUM("Maturity") AS "Maturity", SUM("EarnedPolicies") AS "EarnedPolicies"],
  ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID"]);


  var_out = CE_PROJECTION(:results,
  ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID", "NoOfVINs", "EarnedPolicies", "Maturity"]);

END /********* End Procedure Script ************/

激活错误如下:

ERROR      wepredict/martyn/indico/automotive/CA_EARNINGS_CARLINEMODELYEARCATEGORY.calculationview
           Internal deployment of object failed;Repository: Encountered an error in repository runtime extension;Internal Error:Deploy Calculation View: SQL: transaction rolled back by an internal error: Join attributes not found in variable: CategoryID: line 13 col 61 (at pos 763)
Set Schema DDL statement: set schema "SYSTEM"
Type DDL: create type "_SYS_BIC"."wepredict.martyn.indico.automotive/CA_EARNINGS_CARLINEMODELYEARCATEGORY/proc/tabletype/VAR_OUT" as table ("ManufacturerID" INTEGER, "CarlineID" INTEGER, "ModelYearID" INTEGER, "CategoryID" INTEGER, "NoOfVINs" INTEGER, "EarnedPolicies" DOUBLE, "Maturity" DOUBLE)
Procedure DDL: create procedure "_SYS_BIC"."wepredict.martyn.indico.automotive/CA_EARNINGS_CARLINEMODELYEARCATEGORY/proc" ( OUT var_out "_SYS_BIC"."wepredict.martyn.indico.automotive/CA_EARNINGS_CARLINEMODELYEARCATEGORY/proc/tabletype/VAR_OUT" ) language sqlscript sql security definer reads sql data as /********* Begin Procedure Script ************/ 
BEGIN 

  vins = CE_OLAP_VIEW("_SYS_BIC"."wepredict.martyn.indico.automotive/AN_VEHICLESALES",
  ["CarlineID", "ModelYearID", "ProfileAge", SUM("NoOfVINs") AS "NoOfVINs"]);

  vins_proj = CE_PROJECTION(:vins, 
  ["CarlineID", "ModelYearID", "ProfileAge" AS "Day", "NoOfVINs"]);

  profiles = CE_CALC_VIEW("_SYS_BIC"."wepredict.martyn.indico.automotive/CA_PROFILES_CARLINECATEGORY",
  ["CarlineID", "CategoryID", "Day", "SeverityPercent"]);

  vin_svy_pcs = CE_JOIN(:vins_proj, :profiles, ["CarlineID", "CategoryID", "Day"],
  ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID", "Day", "NoOfVINs", "SeverityPercent"]);


  vin_earned_pos = CE_PROJECTION(:vin_svy_pcs, 
  ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID", "Day", "NoOfVINs", 
  "SeverityPercent" AS "Maturity",
  CE_CALC('("NoOfVINs" * "Maturity")', double) AS "EarnedPolicies"]);


  results = CE_AGGREGATION(:vin_earned_pos, 
  [SUM("NoOfVINs") AS "NoOfVINs", SUM("Maturity") AS "Maturity", SUM("EarnedPolicies") AS "EarnedPolicies"],
  ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID"]);


  var_out = CE_PROJECTION(:results,
  ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID", "NoOfVINs", "EarnedPolicies", "Maturity"]);

END /********* End Procedure Script ************/

请任何人都可以帮助我解决可能是什么问题以及如何解决它?

非常感谢,

马丁。

4

1 回答 1

1

CategoryID 不在 vins_proj 中,因此不能在语句中加入 CategoryID

vin_svy_pcs = CE_JOIN(:vins_proj, :profiles, ["CarlineID", "CategoryID", "Day"],
   ["ManufacturerID", "CarlineID", "ModelYearID", "CategoryID", "Day", "NoOfVINs",
   "SeverityPercent"]); 
于 2014-03-24T18:04:16.280 回答