Hi,
I am new to HANA , I am trying to learn it , please help me ,
How we can check database error traces for additional details ?
SQL Script:-
CREATE PROCEDURE _SYS_BIC.get_pi_quantity_ce (
IN InvoicingStatus NVARCHAR(1),
OUT pi_quantity tt_pi_quantity )
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
READS SQL DATA AS
BEGIN
/*****************************
Write your procedure logic
*****************************/
lt_po =
CE_COLUMN_TABLE("SAP_HANA_EPM_DEMO"."sap.hana.democontent.epm.data::purchaseOrder",
["PurchaseOrderId", "CreatedAt", "PartnerId","InvoicingStatus"]);
lt_po_proj = CE_PROJECTION (:lt_po,
["PurchaseOrderId", "CreatedAt", "PartnerId" , "InvoicingStatus" ],
'"InvoicingStatus" = :InvoicingStatus' );
lt_pi =
CE_COLUMN_TABLE("SAP_HANA_EPM_DEMO"."sap.hana.democontent.epm.data::purchaseOrderItem",
["PurchaseOrderItem", "Currency", "GrossAmount","ProductId","Quantity","QuantityUnit"]);
pi_quantity = CE_JOIN(:lt_po_proj, :lt_pi, [ " PurchaseOrderId " ],
["PurchaseOrderId", "CreatedAt", "PartnerId", "InvoicingStatus",
"PurchaseOrderItem" , "Currency", "GrossAmount" , "ProductId" , "Quantity" , "QuantityUnit"]);
END;
Local table types .........
create type tt_pi_quantity as table (
PurchaseOrderId NVARCHAR(10),
CreatedAt DATE ,
PartnerId NVARCHAR(10),
InvoicingStatus Nvarchar(1),
PurchaseOrderItem NVARCHAR(10),
Currency nVARCHAR(5),
GrossAmount DECIMAL(15,2),
ProductId NvARCHAR(10),
Quantity DECIMAL(13,3),
QuantityUnit NvARCHAR(3)
)
I am getting following error ......................
I have checked each every line , but I have no clue why I am getting that error
ERROR workshop/sessiona/00/procedures/get_pi_quantity_ce.procedure
Repository: Internal error during statement execution, please see the database error traces for additional details;error executing statement; Join attribute must be available in projection list: PurchaseOrderId : line 19 col 49 (at pos 1024) at ptime/query/checker/proc_check_cefunc.cc:410
ERROR workshop/sessiona/00/procedures/get_pi_quantity_ce.procedure
Repository: Encountered an error in repository runtime extension;object was not activated due to previous activation errors
ERROR workshop/sessiona/00/procedures/get_pi_quantity_ce.procedure
Object potentially broken due to transaction rollback.
ERROR exception 40177:
repository/base/activation/activator.cpp:828
Object potentially broken due to transaction rollback.