* Query table for specified rows * _h: structure representing database connection * _k: key names * _op: operators * _v: values of the keys that must match * _c: column names to return * _n: number of key=values pairs to compare * _nc: number of columns to return * _o: order by the specified column */
| 355 | * _o: order by the specified column |
| 356 | */ |
| 357 | int db_oracle_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op, |
| 358 | const db_val_t* _v, const db_key_t* _c, int _n, int _nc, |
| 359 | const db_key_t _o, db_res_t** _r) |
| 360 | { |
| 361 | query_data_t cb; |
| 362 | OCIStmt* reshp; |
| 363 | int rc; |
| 364 | |
| 365 | if (!_h || !CON_TABLE(_h) || !_r) { |
| 366 | LM_ERR("invalid parameter value\n"); |
| 367 | return -1; |
| 368 | } |
| 369 | |
| 370 | cb._rs = &reshp; |
| 371 | cb._v = _v; |
| 372 | cb._n = _n; |
| 373 | cb._w = NULL; |
| 374 | cb._nw = 0; |
| 375 | CON_ORA(_h)->pqdata = &cb; |
| 376 | CON_ORA(_h)->bindpos = 0; |
| 377 | CON_RESET_CURR_PS(_h); /* no prepared statements support */ |
| 378 | rc = db_do_query(_h, _k, _op, _v, _c, _n, _nc, _o, _r, |
| 379 | db_oracle_val2str, db_oracle_submit_query, db_oracle_store_result); |
| 380 | CON_ORA(_h)->pqdata = NULL; /* paranoid for next call */ |
| 381 | return rc; |
| 382 | } |
| 383 | |
| 384 | |
| 385 | /* |
nothing calls this directly
no test coverage detected