Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

SAPHANA:Unable to expose store procedure via ServerSide

$
0
0

Hi Experts

 

I am a beginner to server side java script(XSJS).                                     

I am trying to expose the .xsjs, file data containing StoreProcedure and access through web browser with the following url containing hostname,portnumber and package path as shown below:

 

"hostname:80<instance#>/testdemo/Demodata.xsjs"

 

and i am getting the following error when i am trying to access it.  

 

"This link seems to be broken

We could not find the resource you're trying to access.

It might be misspelled or currently unavailable"

 

 

I have created the following files in Project Explorer:

 

1.An Empty File with file extension .xsapp

2.A file with extension .xsaccess: 

 

 

            {

            "exposed":true,

            "authentication":[{"method":"LogonTicket"},{"method":"Basic"}]

            }

 

 

3.A file with file name Demodata.xsjs:

 

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

     var body = ''; 

     var conn = $.db.getConnection(); 

     var cst = conn.prepareCall('{CALL testdemo.TESTPROCEDURE(?,?)}');  

     if (cst.execute()) { 

     body = 'Ok'  + cst.getInteger(3); 

     }

     else

     { 

     body = 'Failed'; 

     } 

    cst.close();

    conn.commit();

    conn.close();

 

4.A Store procedure with name TEST_PROCEDURE in SQL console:

 

create procedure testdemo.TEST_PROCEDURE LANGUAGE SQL SCRIPT AS "TEST"

/********* Begin Procedure Script ************/

BEGIN

SELECT

           cStyID,

           cName,

           cDimension,

           cSea,

           cDes,

           cMCCod,

           cBrand,

     Avgpr,

           cFil,

           cCom,

           cWhs,

           cUse,

           dtDa,

           dtDat,

           Art,

           STyp,

           SVal,

           CreatBy,

           Crea,

           ModiBy,

           ModiDt,

           Log

FROM tblArticl;

END;

/********* End Procedure Script ************/

 

 

The procedure gets executed well and the result value is OK.

 

Below are the views:

 

Project Explorer View Below:

       ProjectExplorer.png

RepositoryViewBelow:

        Repository.png

NavigatorViewBelow:

NavigatorView.png

All the above files are committed and activated succesfully.But an error occured when I tried to access "hostname:80<instance#>/testdemo/Demodata.xsjs" it in browser.

 

What could be wrong here?

 

Any sample examples would be appreciated.

 

Thanks for your time

Koushik.


Viewing all articles
Browse latest Browse all 5653

Trending Articles



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