Lines Matching defs:sql
128 static int dbd_freetds_select(apr_pool_t *pool, apr_dbd_t *sql,
133 if (sql->trans && (sql->trans->errnum != SUCCEED)) {
146 sql->err = freetds_exec(sql->proc, query, 1, NULL);
147 if (!dbd_freetds_is_success(sql->err)) {
148 if (sql->trans) {
149 sql->trans->errnum = sql->err;
154 sql->err = dbresults(sql->proc);
155 if (sql->err != SUCCEED) {
156 if (sql->trans) {
157 sql->trans->errnum = sql->err;
166 res->proc = sql->proc;
169 res->ntuples = dblastrow(sql->proc);
170 res->sz = dbnumcols(sql->proc);
171 apr_pool_cleanup_register(pool, sql->proc, clear_result,
179 cell->type = dbcoltype(sql->proc, i);
180 cell->len = dbcollen(sql->proc, i);
182 sql->err = dbbind(sql->proc, i, /*cell->type */ STRINGBIND, cell->len, cell->data);
183 if (sql->err != SUCCEED) {
186 if ((sql->err != SUCCEED) && (sql->trans != NULL)) {
187 sql->trans->errnum = sql->err;
191 return (sql->err == SUCCEED) ? 0 : 1;
242 static int dbd_freetds_pselect(apr_pool_t *pool, apr_dbd_t *sql,
249 return dbd_freetds_select(pool, sql, results, query, seek);
251 static int dbd_freetds_pvselect(apr_pool_t *pool, apr_dbd_t *sql,
259 if (sql->trans && sql->trans->errnum) {
260 return sql->trans->errnum;
269 return dbd_freetds_pselect(pool, sql, results, statement, seek, values);
271 static int dbd_freetds_query(apr_dbd_t *sql, int *nrows, const char *query);
272 static int dbd_freetds_pquery(apr_pool_t *pool, apr_dbd_t *sql,
278 return dbd_freetds_query(sql, nrows, query);
280 static int dbd_freetds_pvquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
286 if (sql->trans && sql->trans->errnum) {
287 return sql->trans->errnum;
295 return dbd_freetds_pquery(pool, sql, nrows, statement, values);
358 static const char *dbd_freetds_error(apr_dbd_t *sql, int n)
361 return apr_psprintf(sql->pool, "Error %d", sql->err);
364 static int dbd_freetds_query(apr_dbd_t *sql, int *nrows, const char *query)
366 if (sql->trans && sql->trans->errnum) {
367 return sql->trans->errnum;
370 sql->err = freetds_exec(sql->proc, query, 0, nrows);
372 if (sql->err != SUCCEED) {
373 if (sql->trans) {
374 sql->trans->errnum = sql->err;
382 apr_dbd_t *sql)
448 static int dbd_freetds_prepare(apr_pool_t *pool, apr_dbd_t *sql,
489 return (freetds_exec(sql->proc, pquery, 0, &i) == SUCCEED) ? 0 : 1;
624 apr_dbd_t *sql;
630 sql = apr_pcalloc(pool, sizeof (apr_dbd_t));
631 sql->pool = pool;
632 sql->proc = process;
633 sql->params = params;
634 return sql;
734 static int dbd_freetds_pvbquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
739 static int dbd_freetds_pbquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
746 static int dbd_freetds_pvbselect(apr_pool_t *pool, apr_dbd_t *sql,
753 static int dbd_freetds_pbselect(apr_pool_t *pool, apr_dbd_t *sql,