Skip to Content

stored procedure activation error with "TYPE" in hdbdd: "Could not create catalog object"

Hello i create the following hdbdd which works correctly and in which i insert (with csv file) two records. (See (1))
But by activating the stored procedure (See (2)), i obtain the error message: "Could not create catalog object: invalid column name; FIRSTNAME: line 20 col 6 (at pos 553)"
or
"Could not create catalog object: invalid identifier; NAME: line 20 col 6 (at pos 553)"

(2)_____________________________________________________
PROCEDURE "SCHEMA"."com.basf.dil_bn.zz_brlog.procedures::createEmployee" (
IN intab "SCHEMA"."XXX.XXX.XXX.Xpck::HDBDD.procedures.empl",
OUT outtab "SCHEMA"."com.basf.dil_bn.zpck::HDBDD.procedures.errors"
)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
--DEFAULT SCHEMA <default_schema_name>
--READS SQL DATA
AS

BEGIN
declare lv_empl_no Integer;declare lv_firstName String; declare lv_middleName String; declare lv_lastName String;declare lv_orgUnit String; declare lv_address_no Integer;

select --ID,
NAME.FIRSTNAME, NAME.MIDDLENAME, NAME.LASTNAME, ORGUNIT, ADDRESS.ID into --lv_empl_no,lv_firstName, lv_middleName, lv_lastName, lv_orgUnit, lv_address_no from :intab;
if :lv_lastName = '' then outtab = select 500 as http_status_code, 'Invalid last name ' || lv_firstName as error_message,'No Way! Last name field must not be empty' as detail from dummy;
else insert into "com.basf.dil_bn.zpck::ERHDL_TB_DDL.Employee" values ("com.basf.dil_bn.zpck::empl".NEXTVAL,lv_firstName, lv_middleName, lv_lastName,
lv_orgUnit,lv_address_no);
end if;
END;
(1)______________________________________________________
namespace XXX.XXX.XXX.Xpck;

@Schema : 'SCHEMA'
context HDBDD { type Name : String(80); type SString : String(100);
type FullName { firstName : Name;middleName : Name;lastName : Name; };

entity Employee { key id : Integer; name : FullName; orgUnit : Name; address : Association[0..1] to Address; //Association definition };

entity Address { key id : Integer; street : Name; number : Integer; zipCode : String(30); city : Name; countryCode : String(2); };

context procedures{
type empl { id : Integer; name : FullName; orgUnit : Name;
address : Association[0..1] to Address; //Association definition };
type errors { HTTP_STATUS_CODE: Integer; ERROR_MESSAGE : SString; DETAIL : SString;}; };

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 25, 2017 at 05:06 AM

    As your "... procedures.empl" type does not have columns like FIRSTNAME, MIDDLENAME, ... you get of course the errors you are seeing at the moment. Either you have to adjust your type (adding the fields) or adjust your procedure coding to match the type.

    Add comment
    10|10000 characters needed characters exceeded