rasdaman complete source
sqlerror.hh
Go to the documentation of this file.
1 #ifndef _SQLERROR_HH_
2 #define _SQLERROR_HH_
3 
4 /*
5 * This file is part of rasdaman community.
6 *
7 * Rasdaman community is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * Rasdaman community is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
21 rasdaman GmbH.
22 *
23 * For more information please see <http://www.rasdaman.org>
24 * or contact Peter Baumann via <baumann@rasdaman.com>.
25 */
26 /************************************************************************
27  *
28  *
29  * PURPOSE:
30  *
31  *
32  * COMMENTS:
33  *
34  ***********************************************************************/
35 
36 //@ManMemo: Module: {\bf reladminif}.
37 
38 /*@Doc:
39 
40  SQL Errors Handling
41 
42 */
43 #include <iostream>
44 using std::cout;
45 using std::endl;
46 
47 #include "raslib/error.hh"
48 
49 #ifdef BASEDB_DB2
50 #define generateException() generateExceptionn(sqlca)
51 
52 void generateExceptionn(struct sqlca&) throw (r_Error);
53 
54 /*@Doc:
55 generates a new r_Ebase_dbms exception and throws it.
56 */
57 
58 #define check(msg) checkk(msg, sqlca)
59 int checkk(const char* msg, struct sqlca& mysql) throw( r_Error );
60 /*@Doc:
61 returns sqlcode, prints error messages when appropriate.
62 the msg is inserted in the error message.
63 changes are not rolledback, nothing is done to the connection.
64 */
65 
66 #endif
67 
68 #ifdef BASEDB_ORACLE
69 void generateException() throw (r_Error);
70 /*@Doc:
71 generates a new r_Ebase_dbms exception and throws it.
72 */
73 
74 int check(const char* msg) throw (r_Error);
75 /*@Doc:
76 returns sqlcode, prints error messages when appropriate.
77 the msg is inserted in the error message.
78 changes are not rolledback, nothing is done to the connection.
79 */
80 
81 void printSQLError(void* err, int status);
82 void printSQLError(void* err) throw (r_Error);
83 /*@Doc:
84 This diplays cli errors.
85 */
86 #endif
87 
88 #ifdef BASEDB_INFORMIX
89 void generateException() throw (r_Error);
90 /*@Doc:
91 This generates exceptions.
92 */
93 
94 int check(const char* msg, bool displayWarning = false) throw (r_Error);
95 /*@Doc:
96 This diplays esql errors.
97 */
98 
99 void printSQLError(int error, const char*);
100 /*@Doc:
101 This diplays cli errors.
102 */
103 #endif
104 
105 #ifdef BASEDB_PGSQL
106 void generateException() throw (r_Error);
107 /*@Doc:
108 This generates exceptions.
109 */
110 
111 int check(const char* msg) throw (r_Error);
112 /*@Doc:
113 Display error message if SQL errors have occurred.
114 */
115 #endif
116 
117 #endif
118 
#define false
Definition: bool.h:23