sqlanywhere / node-sqlanywhere

SAP SQL Anywhere Database Client for Node
Apache License 2.0
39 stars 36 forks source link

Cannot Invoke Stored Procedure? #13

Closed nievu closed 8 years ago

nievu commented 8 years ago

Trying to create and invoke a stored procedure in node application. Could not find needed API to do so? Is it available?

gperrow-SAP commented 8 years ago

The exec function can be used to create a stored procedure and also to call one. Something like:

conn.exec( 'create procedure myproc() begin ... end', function( createErr ) {  
   if( createErr ) throw createErr;  
   conn.exec( 'call myproc()', function( callErr, result ) {  
      if( callErr ) throw callErr;  
      // result is the result set if the procedure returns one  
   });  
});
zkewal commented 6 years ago

How do we specify output args in stored procedure?