cancel
Showing results for 
Search instead for 
Did you mean: 

Passing table type value to procedure from XSJS

0 Kudos

Hello,

I have gone through few blogs for this issue. But did not find any solution.

How to pass the value from XSJS to a table type input parameter in procedure?

XS Callling Stored Proc with multiple values in input param

I am facing issue in procedure while inserting values into the table. Please find the code below.

PROCEDURE "TEST"."insertSales" (
IN SALESDATA "TEST"."test.model.SalesProj::SALES.SalesType" )
	LANGUAGE SQLSCRIPT
	SQL SECURITY INVOKER 
	DEFAULT SCHEMA "TEST" AS
BEGIN
	INSERT INTO "TEST"."test.model.SalesProj::SALES.Sales"
	(SELECT * FROM :SALESDATA); 
END;

I am passing sales data in this JSON format

salesCreate= conn.loadProcedure('TEST', 'insertSales');

rs = salesCreate([{SALESORDER: "1000000001", COMPANYNAME: "Test Comp", PRODUCTID: "Mat1"}]);

Please let me know if I am missing anything here.

Thank you.

pfefferf
Active Contributor
0 Kudos

What error do you get?

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

Why then not just doing a commit (conn.commit). Using the $.hdb interface the autocommit mode is disabled.

0 Kudos

I am extremely sorry, Florian. I don't know how did I missed the commit statement.

Thank you so much for your time.

Answers (1)

Answers (1)

0 Kudos

Hello Florian,

I am sorry. I am not getting any error. But data is not added in the table.

Thank you.