node-odbc
node-odbc copied to clipboard
Rewrite call procedure
This PR changes the procedure workflow from:
SQLProcedures
-> SQLProcedureColumns
-> SQLExecDirect
to
SQLPrepare
-> SQLDescribeParam
-> SQLBind
-> SQLExecDirect
This will allow users to call a procedure with just the procedure name, even if that procedure exists in multiple schemas/libraries.
Will this allow CLOB parameters on procedure calls? See #355 for context
Hi Mark,
Just curious how close you are to releasing this change?
Thanks! Brandon
Would it make sense to use the old code path for drivers that don't support IPD?
Given the problems we've had with it, I think it'd be a better idea to design a way to have the user specify the direction as-needed.
Maybe something like:
// IN, OUT, INOUT exported by the node-odbc package
params = [
{ data: 1, direction: IN },
{ data: undefined, direction: OUT },
{ data: 'hello', direction: INOUT },
}
const result = await connection.callProcedure(null, null, 'MY_PROC', params);
Not sure if it actually matters on OUT vs INOUT. If not, it could be simplified by just binding them both as INOUT and then the direction field could be changed to a boolean is_output
. Although, now that I'm thinking about it could just bind everything as INOUT in that case and not even worry about it. But that all hinges on whether database drivers are ok with binding that way.