3
<TITLE>class toSQL</TITLE>
5
<META NAME="Generator" CONTENT="KDOC ">
7
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
8
<TABLE WIDTH="100%" BORDER="0">
12
<TR><TD valign="top" align="left" cellspacing="10">
15
<TD valign="top" align="right" colspan="1">
16
This class handles an abstraction of SQL statements used by TOra to extract
17
information and manipulate data. <small><A HREF="#longdesc">More...</A></small></TD></TR>
21
<TR><TH>Definition</TH><TD><code>#include <<A HREF="tosql_h.html">tosql.h</A>></code></TD></TR>
22
<TR><TH><A HREF="full-list-toSQL.html">List of all Methods</A></TH></TR>
25
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
26
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
27
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
28
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
29
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
30
</TABLE></TD></TR></TABLE>
31
<h4>Public Types</h4><ul><LI>struct <A HREF="toSQL__version.html">version</A>
33
<LI>struct <A HREF="toSQL__definition.html">definition</A>
35
<LI>typedef std::map<QCString,definition> <A HREF="#ref3">sqlMap</A>
37
</ul><h4>Public Methods</h4><ul><LI>const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <b><A HREF="#ref23">operator ()</A></b> (const <A HREF="toConnection.html">toConnection</A> &conn) const
39
<LI>const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> & <b><A HREF="#ref24">name</A></b> (void) const
41
<LI> <b><A HREF="#ref25">toSQL</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,
42
const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &sql,
43
const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &description="",
44
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &ver="8.1",
45
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &provider="Oracle")
47
</ul><h4>Public Static Methods</h4><ul><LI>static bool <b><A HREF="#ref10">updateSQL</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,
48
const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &sql,
49
const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &description,
50
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &ver="8.1",
51
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &provider="Oracle",
54
<LI>static bool <b><A HREF="#ref11">deleteSQL</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,
55
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &ver,
56
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &provider="Oracle")
58
<LI>static <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <b><A HREF="#ref12">string</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,const <A HREF="toConnection.html">toConnection</A> &conn)
60
<LI>static <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <b><A HREF="#ref13">string</A></b> (const <A HREF="toSQL.html">toSQL</A> &sqldef,const <A HREF="toConnection.html">toConnection</A> &conn)
62
<LI>static <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <b><A HREF="#ref14">description</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name)
64
<LI>static <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <b><A HREF="#ref15">description</A></b> (const <A HREF="toSQL.html">toSQL</A> &sql)
66
<LI>static <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> <b><A HREF="#ref16">sql</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,const <A HREF="toConnection.html">toConnection</A> &conn)
68
<LI>static <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> <b><A HREF="#ref17">sql</A></b> (const <A HREF="toSQL.html">toSQL</A> &sqldef,const <A HREF="toConnection.html">toConnection</A> &conn)
70
<LI>static <A HREF="toSQL.html">toSQL</A> <b><A HREF="#ref18">sql</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name)
72
<LI>static std::list<<A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A>> <b><A HREF="#ref19">range</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &startWith)
74
<LI>static bool <b><A HREF="#ref20">saveSQL</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &file,bool all=false)
76
<LI>static void <b><A HREF="#ref21">loadSQL</A></b> (const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &file)
78
<LI>static const sqlMap & <b><A HREF="#ref22">definitions</A></b> (void)
80
</ul><h4>Public Members</h4><ul><LI>static const char * const <b><A HREF="#ref8">TOSQL_USERLIST</A></b></LI>
81
<LI>static const char * const <b><A HREF="#ref9">TOSQL_CREATEPLAN</A></b></LI>
82
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
83
This class handles an abstraction of SQL statements used by TOra to extract
84
information and manipulate data. This is usefull in two ways, first off you
85
can edit the strings using a handy editor inside TOra if you find bugs. Also
86
you can use different statements for different Oracle versions. You can also
87
add support for new versions of Oracle without any need for recompilation or
88
programming knowledge.
90
<p> All information about SQL statements are stored in one global static map which
91
contains a name, a description and one or several statements connected to one
94
<p> To determine which SQL to use the statement with the highest
95
version not above the current connection is used. If no statements below or
96
equal to the current version is available the lowest available is used.
98
<p> All strings are specific for a given database provider. No attempt to use
99
strings from other providers will be made.
101
<A NAME="toSQL__version.html"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>version</strong> <small>(struct)</small></td><td align="right"><h3><strong>version</strong></h3></td></tr></table><p></p><p>
102
Contains a statement with it's version.
104
<A NAME="toSQL__definition.html"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>definition</strong> <small>(struct)</small></td><td align="right"><h3><strong>definition</strong></h3></td></tr></table><p></p><p>
105
Definition of one toSQL statement with its description and versions.
107
<A NAME="sqlMap"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td>typedef std::map<<A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A>,definition> <strong>sqlMap</strong></td><td align="right"><h3><strong>sqlMap</strong></h3></td></tr></table><p></p><p> Type of map of statement names to statement definitions.
109
<A NAME="TOSQL_USERLIST"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>static const char * const <strong>TOSQL_USERLIST</strong>
110
</td><td align="right"><h3><strong>TOSQL_USERLIST</strong></h3></td></tr></table><p></p><A NAME="TOSQL_CREATEPLAN"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td>static const char * const <strong>TOSQL_CREATEPLAN</strong>
111
</td><td align="right"><h3><strong>TOSQL_CREATEPLAN</strong></h3></td></tr></table><p></p><A NAME="updateSQL"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>updateSQL</strong> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,
112
const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &sql,
113
const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &description,
114
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &ver="8.1",
115
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &provider="Oracle",
117
<br></td><td align="right"><h3><strong>updateSQL</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Update the map with new information.
119
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
120
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Name of this SQL statement.
122
<TR><TD align="left" valign="top"><i>sql</i></TD><TD align="left" valign="top">Statement to execute for this SQL.
124
<TR><TD align="left" valign="top"><i>description</i></TD><TD align="left" valign="top">Description of this SQL.
126
<TR><TD align="left" valign="top"><i>ver</i></TD><TD align="left" valign="top">Version of database this statement is meant for.
128
<TR><TD align="left" valign="top"><i>provider</i></TD><TD align="left" valign="top">Database provider this string is used for.
130
<TR><TD align="left" valign="top"><i>modified</i></TD><TD align="left" valign="top">Wether this is a modification or an addition to the map.
133
<p><b>Returns</b>: True if a new statement was saved, otherwise false.
135
<A NAME="deleteSQL"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>deleteSQL</strong> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,
136
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &ver,
137
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &provider="Oracle")
138
<br></td><td align="right"><h3><strong>deleteSQL</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Remove an SQL statement from a map. If the last version is removed
139
from a statement it's definition is also removed.
141
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
142
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Name to remove.
144
<TR><TD align="left" valign="top"><i>ver</i></TD><TD align="left" valign="top">Version to remove.
146
<TR><TD align="left" valign="top"><i>provider</i></TD><TD align="left" valign="top">Provider to delete.
149
<p><b>Returns</b>: True if a version was found to be removed.
151
<A NAME="string"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <strong>string</strong> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,const <A HREF="toConnection.html">toConnection</A> &conn)
152
<br></td><td align="right"><h3><strong>string</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Get the statement of an SQL.
154
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
155
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Name of statement.
157
<TR><TD align="left" valign="top"><i>conn</i></TD><TD align="left" valign="top">Connection to get version from.
160
<p><b>Returns</b>: String containing the statement.
162
<p><b>Throws</b>: QString, with, description, of, problem, fetching, string.</p>
163
<A NAME="string"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <strong>string</strong> (const <A HREF="toSQL.html">toSQL</A> &sqldef,const <A HREF="toConnection.html">toConnection</A> &conn)
164
<br></td><td align="right"><h3><strong>string</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Get the statement of an SQL.
166
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
167
<TR><TD align="left" valign="top"><i>sqlDef</i></TD><TD align="left" valign="top">SQL to get name of statement from.
169
<TR><TD align="left" valign="top"><i>conn</i></TD><TD align="left" valign="top">Connection to get version from.
172
<p><b>Returns</b>: String containing the statement.
174
<p><b>Throws</b>: QString, with, description, of, problem, fetching, string.</p>
175
<A NAME="description"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <strong>description</strong> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name)
176
<br></td><td align="right"><h3><strong>description</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Get description of an SQL.
178
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
179
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Name of SQL to get name from..
182
<p><b>Returns</b>: String containing description.
184
<p><b>Throws</b>: QString, with, description, of, problem, fetching, string.</p>
185
<A NAME="description"></A><A NAME="ref15"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <strong>description</strong> (const <A HREF="toSQL.html">toSQL</A> &sql)
186
<br></td><td align="right"><h3><strong>description</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Get description of an SQL.
188
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
189
<TR><TD align="left" valign="top"><i>sqlDef</i></TD><TD align="left" valign="top">SQL to get name of statement from.
192
<p><b>Returns</b>: String containing description.
194
<p><b>Throws</b>: QString, with, description, of, problem, fetching, string.</p>
195
<A NAME="sql"></A><A NAME="ref16"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> <strong>sql</strong> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,const <A HREF="toConnection.html">toConnection</A> &conn)
196
<br></td><td align="right"><h3><strong>sql</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Get the statement of an SQL.
198
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
199
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Name of statement.
201
<TR><TD align="left" valign="top"><i>conn</i></TD><TD align="left" valign="top">Connection to get version from.
204
<p><b>Returns</b>: String containing the statement.
206
<p><b>Throws</b>: QString, with, description, of, problem, fetching, string.</p>
207
<A NAME="sql"></A><A NAME="ref17"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> <strong>sql</strong> (const <A HREF="toSQL.html">toSQL</A> &sqldef,const <A HREF="toConnection.html">toConnection</A> &conn)
208
<br></td><td align="right"><h3><strong>sql</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Get the statement of an SQL.
210
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
211
<TR><TD align="left" valign="top"><i>sqlDef</i></TD><TD align="left" valign="top">SQL to get name of statement from.
213
<TR><TD align="left" valign="top"><i>conn</i></TD><TD align="left" valign="top">Connection to get version from.
216
<p><b>Returns</b>: String containing the statement.
218
<p><b>Throws</b>: QString, with, description, of, problem, fetching, string.</p>
219
<A NAME="sql"></A><A NAME="ref18"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <A HREF="toSQL.html">toSQL</A> <strong>sql</strong> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name)
220
<br></td><td align="right"><h3><strong>sql</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Get an SQL from a specified name.
222
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
223
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Name to get SQL for.
226
<p><b>Returns</b>: a toSQL object for given name.
228
<A NAME="range"></A><A NAME="ref19"></A><table width="100%"><tr bgcolor="#eeeeee"><td> std::list<<A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A>> <strong>range</strong> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &startWith)
229
<br></td><td align="right"><h3><strong>range</strong></h3></td></tr></table><p> <small>[static]</small></p><p>
230
Get all defined names that start with a given substring.
232
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
233
<TR><TD align="left" valign="top"><i>startWith</i></TD><TD align="left" valign="top">The string that the name should start with.
236
<p><b>Returns</b>: A list of names available.
238
<A NAME="saveSQL"></A><A NAME="ref20"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>saveSQL</strong> (const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &file,bool all=false)
239
<br></td><td align="right"><h3><strong>saveSQL</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Save SQL definitions to file.
241
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
242
<TR><TD align="left" valign="top"><i>file</i></TD><TD align="left" valign="top">Filename to save to.
244
<TR><TD align="left" valign="top"><i>all</i></TD><TD align="left" valign="top">If true all statements will be saved, otherwised only modified are saved.
247
<p><b>Returns</b>: True if saved successfully.
249
<A NAME="loadSQL"></A><A NAME="ref21"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void <strong>loadSQL</strong> (const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &file)
250
<br></td><td align="right"><h3><strong>loadSQL</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Load definitions from file.
252
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
253
<TR><TD align="left" valign="top"><i>file</i></TD><TD align="left" valign="top">Filename to load from.
256
<p><b>Throws</b>: s, QString, describing, the, problem, loading.</p>
257
<A NAME="definitions"></A><A NAME="ref22"></A><table width="100%"><tr bgcolor="#eeeeee"><td> const sqlMap & <strong>definitions</strong> (void)
258
<br></td><td align="right"><h3><strong>definitions</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Get the entire map of SQL definitions
260
<p><b>Returns</b>: A reference to the map of definitions.
262
<A NAME="operator%20()"></A><A NAME="ref23"></A><table width="100%"><tr bgcolor="#eeeeee"><td>const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> <strong>operator ()</strong> (const <A HREF="toConnection.html">toConnection</A> &conn)
263
<br></td><td align="right"><h3><strong>operator ()</strong></h3></td></tr></table><p> <small>[const]</small></p><p> Get the statement of an SQL.
265
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
266
<TR><TD align="left" valign="top"><i>conn</i></TD><TD align="left" valign="top">Connection to get version from.
269
<p><b>Returns</b>: String containing the statement.
271
<A NAME="name"></A><A NAME="ref24"></A><table width="100%"><tr bgcolor="#eeeeee"><td>const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> & <strong>name</strong> (void)
272
<br></td><td align="right"><h3><strong>name</strong></h3></td></tr></table><p> <small>[const]</small></p><p> Get name of this SQL.
274
<p><b>Returns</b>: Name.
276
<A NAME="toSQL"></A><A NAME="ref25"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>toSQL</strong> (const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &name,
277
const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &sql,
278
const <A HREF="/usr/lib/qt3/doc/html/qstring.html">QString</A> &description="",
279
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &ver="8.1",
280
const <A HREF="/usr/lib/qt3/doc/html/qcstring.html">QCString</A> &provider="Oracle")
281
<br></td><td align="right"><h3><strong>toSQL</strong></h3></td></tr></table><p></p><p> Create a new SQL. Observe that the only thing this does is insert the supplied
282
information into the definition map, deleting the SQL will not the information from
283
the defitinion map. Only one description can be made for each statement name.
285
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
286
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Name of SQL.
288
<TR><TD align="left" valign="top"><i>sql</i></TD><TD align="left" valign="top">Statement of this SQL.
290
<TR><TD align="left" valign="top"><i>description</i></TD><TD align="left" valign="top">Description of statement.
292
<TR><TD align="left" valign="top"><i>ver</i></TD><TD align="left" valign="top">Version this statement applies to.
294
<TR><TD align="left" valign="top"><i>provider</i></TD><TD align="left" valign="top">Provider this string is for.
299
<tr><td><small>Generated by: nneul on skyhawk on Wed Feb 23 19:49:58 2005, using kdoc 2.0a54.</small></td></tr>