Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

HANA xs "update" procedure causing error in the .xsodata service

$
0
0

Hello everyone,

 

I am following the tutorial

Develop Your First SAP HANA Native Application on SAP HANA Cloud Platform Using the SAP HANA Web-based Development Workbench

Version 1.0 | June 2014 | Bertram Ganz, Jens Glander, Monika Kaiser, SAP AG

found at http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9063f922-81e2-3110-c9b9-b4b0c119956e?QuickLink=index&…

 

After having a working version of the tutorial, I decided to extend it by adding an extra column to the Person entity and adding new procedures for deleting or updating a table entry. The delete procedure works correctly, however when I try to update an existing entry, I cannot activate my .xsodata service; the following error appears:


11:17:33 >> Error while activating:
Invalid procedure or parameter list in procedure "p1941225060trial.myinstance.perslist.procedures::updatePerson".

 

The contents of the pers.xsodata file are:

 

service {

  "p1941225060trial.myinstance.perslist.data::mymodel.person" as "Persons"

  create using "p1941225060trial.myinstance.perslist.procedures::createPerson"

  update using "p1941225060trial.myinstance.perslist.procedures::updatePerson"

  delete using "p1941225060trial.myinstance.perslist.procedures::deletePerson";

}

 

The updatePerson procedure looks like this:

 

PROCEDURE

  "_SYS_BIC"."p1941225060trial.myinstance.perslist.procedures::updatePerson" (

  IN intab "_SYS_BIC"."p1941225060trial.myinstance.perslist.data::mymodel.procedures.pers",

  OUT outtab "_SYS_BIC"."p1941225060trial.myinstance.perslist.data::mymodel.procedures.pers"

  )

  LANGUAGE SQLSCRIPT

  SQL SECURITY INVOKER AS

  --DEFAULT SCHEMA <schema>

  --READS SQL DATA AS

begin

 

 

declare lv_pers_no string;

declare lv_firstname string;

declare lv_lastname string;

declare lv_age integer;

 

 

 

select ID, FIRSTNAME, LASTNAME, AGE into lv_pers_no, lv_firstname, lv_lastname, lv_age from :intab;

 

 

 

if :lv_pers_no = '' then

else

  outtab = select lv_pers_no as ID,

  lv_firstname as FIRSTNAME,

  lv_lastname as LASTNAME,

  lv_age as AGE from "p1941225060trial.myinstance.perslist.data::mymodel.person";

    update "p1941225060trial.myinstance.perslist.data::mymodel.person" set FIRSTNAME = lv_firstname, LASTNAME = lv_lastname, AGE = lv_age

        where ID = lv_pers_no;

end if;

 

 

end;

note: please ignore the useless "if" branch, I have been trying to implement multiple versions of this procedure; at one point it was the error handling branch with a different OUT parameter for the process - an error table

 

In a related discussion (Is the Update and Delete working in XSODATA CRUD SP6 or above?), it was suggested that both the input and output parameter for the procedure should be the table structure. In my example, the table structure looks as follows:

 

type pers {

            ID: String(10);

            FIRSTNAME: SString;

            LASTNAME: SString;

            AGE: Integer;

        };

 

I have a feeling that something from the procedure definition is wrong, hence why I get the aforementioned error. Can anyone help me with this problem?

 

Thank you in advance,

Istvan.


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>