db_oracle/dbase.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Oracle module core functions
00005  *
00006  * Copyright (C) 2007,2008 TRUNK MOBILE
00007  *
00008  * This file is part of Kamailio, a free SIP server.
00009  *
00010  * Kamailio is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * Kamailio is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  */
00024 
00025 
00026 #ifndef DBASE_H
00027 #define DBASE_H
00028 
00029 
00030 #include "../../db/db_con.h"
00031 #include "../../db/db_res.h"
00032 #include "../../db/db_key.h"
00033 #include "../../db/db_op.h"
00034 #include "../../db/db_val.h"
00035 
00036 
00037 /*
00038  * Initialize database connection
00039  */
00040 db_con_t* db_oracle_init(const str* _sqlurl);
00041 
00042 
00043 /*
00044  * Close a database connection
00045  */
00046 void db_oracle_close(db_con_t* _h);
00047 
00048 
00049 /*
00050  * Free all memory allocated by get_result
00051  */
00052 int db_oracle_free_result(db_con_t* _h, db_res_t* _r);
00053 
00054 
00055 /*
00056  * Do a query
00057  */
00058 int db_oracle_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
00059       const db_val_t* _v, const db_key_t* _c, int _n, int _nc,
00060       const db_key_t _o, db_res_t** _r);
00061 
00062 
00063 /*
00064  * Raw SQL query
00065  */
00066 int db_oracle_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r);
00067 
00068 
00069 /*
00070  * Insert a row into table
00071  */
00072 int db_oracle_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
00073       int _n);
00074 
00075 
00076 /*
00077  * Delete a row from table
00078  */
00079 int db_oracle_delete(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
00080       const db_val_t* _v, int _n);
00081 
00082 
00083 /*
00084  * Update a row in table
00085  */
00086 int db_oracle_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
00087       const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv,
00088       int _n, int _un);
00089 
00090 
00091 /*
00092  * Store name of table that will be used by
00093  * subsequent database functions
00094  */
00095 int db_oracle_use_table(db_con_t* _h, const str* _t);
00096 
00097 
00098 /*
00099  * Make error message. Always return negative value
00100  */
00101 int sql_buf_small(void);
00102 
00103 #endif /* DBASE_H */

Generated on Tue May 22 14:00:25 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6