/scripts/ahub.form.attachments.js
0

[XS OData] how to get DB connection for the Query operation(HTTP get method) in XSJS

Mar 24, 2017 at 06:19 AM

177

avatar image
Former Member

Hello,

Is there any way to get database connection for xsodata service query operation (HTTP get method)? such as write operation (create/update/detele):

test.xsodata:

service namespace "namespace" {

"Schmea"."Table" // Table or View

as "Content" // Optional entity alias

create using "namespace:connection.xsjslib::setSession";

}

connection.xsjslib:

function setSession(param){

var sql = 'insert into table values()';

var pStmt = param.connection.prepareStatement(sql);

pStmt.executeUpdate();

pStmt.close();

}

Because I need to set the variable to this database connection to filter data in calculation view.

for example:

param.connection.prepareStatement("set session 'user'='manager'");

Thanks,

Eric

10 |10000 characters needed characters left characters exceeded

Did you find solution to this?

0
Former Member

As confirmed, the query operation is read-only. so user cannot get the db connection.

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers

Skip to Content