]> granicus.if.org Git - php/commitdiff
Take a stab at implementing out parameters for odbc
authorWez Furlong <wez@php.net>
Wed, 19 Jan 2005 05:27:15 +0000 (05:27 +0000)
committerWez Furlong <wez@php.net>
Wed, 19 Jan 2005 05:27:15 +0000 (05:27 +0000)
ext/pdo_odbc/odbc_stmt.c

index f205e315eed555df24f5a5e30ef03dad6dc81a8b..2ce017f1fa7b9562c1d46dad6c7020e17b1d7df5 100755 (executable)
@@ -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)
                                                );