Skip to Content

Stored Procedure need an Array as output

Hi Experts,

I need to use a procedure, with an array as output.

How would you do this?

PROCEDURE "TBASE_PUBLIC"."development...procedures::procGetLabordateForPatient" (

IN patientID integer,

out rs_labordatum "TBASE_PUBLIC"."development...data::TBASE_TT.Procedures.ttLabordate"

)

LANGUAGE SQLSCRIPT

SQL SECURITY INVOKER

--DEFAULT SCHEMA <default_schema_name>

READS SQL DATA AS

BEGIN

rs_labordatum =

SELECT

L."PatientID",

L."Datum"

FROM "TBASE_PUBLIC"."development...data::TBASE.cds.Labor" L

WHERE

L."PatientID" = :patientID

ORDER BY L."Datum" DESC

;

END

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Apr 07, 2016 at 08:38 AM

    Hello Dirk,

    what is the question here? An output parameter can have a primitive or table typed parameter. Type "array" (as you can use it in the SQLScript logic) cannot be used for out parameters. Arrays have to be unnested in tables.

    But what I can see from your procedure logic you are already returning a table typed parameter. Is that not sufficient for your?

    Regards,

    Florian

    Add comment
    10|10000 characters needed characters exceeded

    • Okay, I've to do it by myself.

      We have an application with a lot of tables.

      A lot of the display logic we are doing with odata.

      OData is a little bit magic in our opinion, its not so tangible. Sometimes it's so easy that we want believe it. 😊

      We have a lot of requirements where we're not sure, how to do it with odata at this moment.

      This is why we try to find out what else we can do with xsjs.

      With release SPS12 we want to move to xs advanced and we thought it would be better to use more native javascript, so we can cut and paste a lot of things. (so we can use the real node.js power)


      If you think different, let me know!

      BR

      Dirk