]> granicus.if.org Git - php/commitdiff
picky picky.
authorWez Furlong <wez@php.net>
Fri, 21 Jan 2005 06:11:10 +0000 (06:11 +0000)
committerWez Furlong <wez@php.net>
Fri, 21 Jan 2005 06:11:10 +0000 (06:11 +0000)
Lets make those OUTPUT rather than INPUT-OUTPUT.
We need some flag from the user if they want that.

ext/pdo_odbc/odbc_stmt.c

index 2ce017f1fa7b9562c1d46dad6c7020e17b1d7df5..93f2cdcd2e0326c1d5fa4b2ac2009de4694b72f3 100755 (executable)
@@ -135,17 +135,20 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
                                } else {
                                        ctype = SQL_C_CHAR;
                                }
-
                                rc = SQLBindParameter(S->stmt, param->paramno+1,
-                                               param->max_value_len <= 0 ? SQL_PARAM_INPUT : SQL_PARAM_INPUT_OUTPUT,
+                                               param->max_value_len <= 0 ? SQL_PARAM_INPUT : SQL_PARAM_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)
                                                );
-                               
-                               return 1;
+       
+                               if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
+                                       return 1;
+                               }
+                               pdo_odbc_stmt_error("SQLBindParameter");
+                               return 0;
                }
        }
        return 1;