Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

"XS Procedures API" -> Calling Procedures with Arguments that Reference an Existing Table

Hi,

I try to get familiar with "XS Procedures API" (SPS09).

http://help.sap.com/hana/SAP_HANA_Developer_Guide_for_SAP_HANA_Web_Workbench_en.pdf

"Calling Procedures with Arguments that Reference an Existing Table"

"The WITH OVERVIEW expression also allows you to write the results of a procedure into a global temporary table; that is, a table that is truncated at session close. To use XS Procedures to write the results of a procedure into a global temporary table, you do not specify a name for the result table; you include an empty string (''), as illustrated in the following example:

var conn = $.db.getConnection(); resCall = getRating(rating, 3, '', conn); // {"RESULT": [{"variable":"RESULT","table":"\"SCHEMA\". \"RESULT_5270ECB8F7061B7EE10000000A379516\""}]} "

My question is how can I query the temporary table, after I called the Procedures.

If I debug the procedures I can see the entries of the table (ex_value). But  how can I see the entries of the global temporary table?

Does anyone has a simple example, where I can check the steps after calling a procedures?

Thanks for your help,

Dirk

Tags:
replied

Hello Dirk,

cause you are on SPS09 you can of course use the new $.hdb interface.

Here sample xsjs for the sample procedure above producing the same result than the xsjs with the "old" code:

var oConnection = $.hdb.getConnection();

var fnProcedure = oConnection.loadProcedure("TEST", "test.procedures::test_for_xsjs_xsproc");

var result = fnProcedure();

var activeObjects = result.ET_ACTIVE_OBJECT;

var sResult = "";

for (var i = 0; i < activeObjects.length; i++) {

    sResult += activeObjects[i].OBJECT_NAME + "</br>";

}

$.response.contentType = "text/html";

$.response.setBody(sResult);

Best Regards,

Florian

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question