Skip to Content
0

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

Apr 11, 2017 at 04:19 PM

72

avatar image
Former Member

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"."XXX.XXX.XXX.Xz_XXlog.procedures::createEmployee" (
IN intab "SCHEMA"."XXX.XXX.XXX.Xpck::C.procedures.empl",
OUT outtab "SCHEMA"."XXX.XXX.XXX..Xpck::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 "XXX.XXX.XXX.Xpck::XXX.XXX.XXX..Employee" values ("XXX.XXX.XXX.Xpck::empl".NEXTVAL,lv_firstName, lv_middleName, lv_lastName,
lv_orgUnit,lv_address_no);
end if;
END;
(1) hdbdd______________________________________________________
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;}; };

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers