From e28d2c8032dd225dad200b290818819b4b69966a Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 19 Jan 2005 05:27:15 +0000 Subject: [PATCH] Take a stab at implementing out parameters for odbc --- ext/pdo_odbc/odbc_stmt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index f205e315ee..2ce017f1fa 100755 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -137,9 +137,11 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p } rc = SQLBindParameter(S->stmt, param->paramno+1, - SQL_PARAM_INPUT, ctype, sqltype, precision, scale, - Z_STRVAL_P(param->parameter), 0, - /* XXX: this has the wrong type for DB2 */ + param->max_value_len <= 0 ? SQL_PARAM_INPUT : SQL_PARAM_INPUT_OUTPUT, + ctype, sqltype, precision, scale, + Z_STRVAL_P(param->parameter), + param->max_value_len <= 0 ? 0 : param->max_value_len, + /* XXX: this has the wrong type for DB2 (should be SQLINTEGER*) */ &Z_STRLEN_P(param->parameter) ); -- 2.40.0