3
* TOra - An Oracle Toolkit for DBA's and developers
4
* Copyright (C) 2003-2005 Quest Software, Inc
5
* Portions Copyright (C) 2005 Other Contributors
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; only version 2 of
10
* the License is valid for this program.
12
* This program 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.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
* As a special exception, you have permission to link this program
22
* with the Oracle Client libraries and distribute executables, as long
23
* as you follow the requirements of the GNU GPL in regard to all of the
24
* software in the executable aside from Oracle client libraries.
26
* Specifically you are not permitted to link this program with the
27
* Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
28
* And you are not permitted to distribute binaries compiled against
29
* these libraries without written consent from Quest Software, Inc.
30
* Observe that this does not disallow linking to the Qt Free Edition.
32
* You may link this product with any GPL'd Qt library such as Qt/Free
34
* All trademarks belong to their respective owners.
2
/* BEGIN_COMMON_COPYRIGHT_HEADER
4
* TOra - An Oracle Toolkit for DBA's and developers
6
* Shared/mixed copyright is held throughout files in this product
8
* Portions Copyright (C) 2000-2001 Underscore AB
9
* Portions Copyright (C) 2003-2005 Quest Software, Inc.
10
* Portions Copyright (C) 2004-2008 Numerous Other Contributors
12
* This program is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public License
14
* as published by the Free Software Foundation; only version 2 of
15
* the License is valid for this program.
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
* As a special exception, you have permission to link this program
27
* with the Oracle Client libraries and distribute executables, as long
28
* as you follow the requirements of the GNU GPL in regard to all of the
29
* software in the executable aside from Oracle client libraries.
31
* Specifically you are not permitted to link this program with the
32
* Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
33
* And you are not permitted to distribute binaries compiled against
36
* You may link this product with any GPL'd Qt library.
38
* All trademarks belong to their respective owners.
40
* END_COMMON_COPYRIGHT_HEADER */
53
58
const char * const toSQL::TOSQL_USERLIST = "Global:UserList";
54
59
const char * const toSQL::TOSQL_CREATEPLAN = "Global:CreatePlan";
56
toSQL::toSQL(const QCString &name,
61
toSQL::toSQL(const QString &name,
57
62
const QString &sql,
58
63
const QString &description,
60
const QCString &provider)
65
const QString &provider)
63
68
updateSQL(name, sql, description, ver, provider, false);
66
toSQL::toSQL(const QCString &name)
71
toSQL::toSQL(const QString &name)
180
toSQL toSQL::sql(const QCString &name)
180
toSQL toSQL::sql(const QString &name)
183
183
sqlMap::iterator i = Definitions->find(name);
184
184
if (i != Definitions->end())
186
throw qApp->translate("toSQL", "Tried to get unknown SQL (%1)").arg(name);
186
throw qApp->translate("toSQL", "Tried to get unknown SQL (%1)").arg(QString(name));
189
QString toSQL::string(const QCString &name,
189
QString toSQL::string(const QString &name,
190
190
const toConnection &conn)
193
QCString ver = conn.version();
194
QCString prov = conn.provider();
193
QString ver = conn.version();
194
QString prov = conn.provider();
196
196
bool quit = false;
227
throw qApp->translate("toSQL", "Tried to get unknown SQL (%1)").arg(name);
227
throw qApp->translate("toSQL", "Tried to get unknown SQL (%1)").arg(QString(name));
230
230
bool toSQL::saveSQL(const QString &filename, bool all)
235
235
QRegExp backslash(QString::fromLatin1("\\"));
236
236
QRegExp newline(QString::fromLatin1("\n"));
237
237
for (sqlMap::iterator i = Definitions->begin();i != Definitions->end();i++)
240
240
definition &def = (*i).second;
241
QCString name = (*i).first;
241
QString name = (*i).first;
242
242
if (def.Modified || all)
244
QCString line = name;
246
246
QString t = def.Description;
247
247
t.replace(backslash, QString::fromLatin1("\\\\"));