cancel
Showing results for 
Search instead for 
Did you mean: 

Call procedure with overview from xsjs

roberto_falk
Participant
0 Kudos

Hi Experts,

I'm facing a problem when calling a procedure with overview from my web app. See here below the procedure:

create procedure "WEB".save" (in name varchar(100), in lastname varchar(100), out person "PERSON")

  LANGUAGE SQLSCRIPT

  SQL SECURITY INVOKER

  DEFAULT SCHEMA "WEB"

  AS

BEGIN

    PERSON = select :name as NAME, :lastname as LASTNAME from dummy;

END;

Using the with overview statement, the procedure should fill the OUT parameter that I'm informing with the result. When I call it from studio directly, works fine:

call "WEB"."save"('Roberto', 'Falk', WEB.person) with overview;

Here, table WEB.person is filled correctly, but when I call it from the xsjs, the table is not filled, and my try / catch in the xsjs file do not shows any errors.

Here how I'm calling from the xsjs file:

var conn  = $.db.getConnection();

var pc = conn.prepareCall("CALL \"WEB\".\"save\"('Web1', 'Web2', WEB.person) with overview");

pc.execute();

pc.close();                                                                         

conn.close();

Any ideas? I thought that might be an authorization issue, but the thing is that I'm connected with the same user in both tests.

Thanks and regards,

Roberto Falk

Accepted Solutions (1)

Accepted Solutions (1)

roberto_falk
Participant
0 Kudos

Hi All,

a conn.commit(); solved the problem. I remembered that studio usually autocommits, so, commiting in the xsjs file solved the problem.

Thanks anyway.

Best regards,

Roberto Falk

Answers (0)