cancel
Showing results for 
Search instead for 
Did you mean: 

Pass parameters to stored procedure from javascript

Hi there!

Can someone tell me how to pass parameters to a stored procedure from javascript

here is my test SP

this is my .cds code

this is my js, i want to call test from this function but application not getting deployed

this.on('test', async () => { try { const a = req.data; let dbQuery = `Call "test"(A => ?)` let result = await cds.run(dbQuery, {a}); console.log(result); return true; } catch (error) { return false } })

Thanks..

0 Kudos

Can you please share some detail on "application not getting deployed"? If possible please attach the log of the failed deployment here.

Accepted Solutions (0)

Answers (1)

Answers (1)

vansyckel
Employee
Employee
0 Kudos

Hi amitpotdukhe,

Use positional arguments as described here.

Best,
Sebastian