Query Tool (using ODBC) 4.1 Readme
Thank you for using Query Tool (using ODBC) 4.1.
Contents
· Command Line Options and Usage
· Batches
· Known Problems and Workarounds
· Known Limitations and Workarounds
· File List and Uninstall Information
· Site Licenses, Pricing, and Ordering Information
·
Warranty
Query Tool (using ODBC) 4.1 is a Universal
Data Access (UDA) tool. It lets you query ODBC data sources, author SQL scripts
and queries, return query results to a grid or free-form text, retrieve ODBC
driver information, execute multiple SQL scripts or stored procedures
simultaneously, and more.
Running
the application:
Run QTODBC.EXE from the folder where you extracted
the files.
[A separate ADO version is also available.
Please visit http://gpoulose.home.att.net/
for more information.]
Windows XP or later
Windows 2000 Professional
Windows NT WKS 4.0 w/ sp3 or later¹
Windows Me
Windows 98/95¹
¹Requires
Microsoft Office 2000 or later.
Command Line Options and Usage
Usage:
QTODBC.EXE
[-C <ODBC connect string>]
[-f <filename to open>]
¹
[-F <file list to load
separated by pipe (|)>]
¹
[-e <filename to open and
execute>]
²
[-E <file list to load and
execute separated by pipe (|)>]
²
Examples:
..\QTODBC.EXE
/C "DSN=<MY_DSN>"
-f "<..\test.sql>"
/C "DSN=<MY_DSN>"
-E "<..\1.sql|..\2.sql|..\3.sql>"
-C
"DSN=<MY_DSN>;UID=<UID>;PWD=<PWD>"
/C "Driver={SQL
Server};Server=<Server>"
/C "Driver={Oracle ODBC
Driver};DBQ=<Server>"
/C "Driver={IBM DB2 ODBC
Driver};DBALIAS=<DBALIAS>"
Tip: Connection String may be copied from
within the application by right clicking on the Schema window pane root node
and choosing Connection String.
¹Analogus
to dropping of file(s) onto the application.
²Application runs in minimized state once
the file(s) is/are loaded and exits after the query execution if the
autocommit transaction mode is on and,
if there are no errors.
Query Tool recognizes the keyword GO
as the default
batch separator. Users can change this value by choosing Current Connection
Options from the Query menu or by choosing Options and New Connections from the
Tools menu. The latter option is persistent for new connections.
Users must follow the rules for batches.
For example: The scope of a local (user-defined) variable is limited to a batch
and cannot be referenced after a query batch separator or in another batch, and
so forth. Note that a SQL statement or a comment cannot occupy the same line as
a query batch separator. Also note that comments such as '/**/' cannot span
across multiple batches.
Oracle scenario:
CREATE
TABLE t1 (c1 number(10,2))
GO
DECLARE
var1
number(10,2);
GO
BEGIN
var1 := 7000; /*yields an error. var1 is
out of scope*/
INSERT INTO t1 VALUES (var1);
END;
GO
SELECT c1
FROM t1
GO
/*demonstrates
invoking Oracle procedures
using
Oracle native syntax and ODBC syntax*/
CREATE
TABLE proc_test (c1 number)
GO
INSERT
INTO proc_test VALUES (1)
GO
INSERT
INTO proc_test VALUES (2)
GO
INSERT
INTO proc_test VALUES (3)
GO
CREATE
PROCEDURE del_proc_test (id IN number)
AS
BEGIN
DELETE FROM proc_test WHERE c1 = id;
END
del_proc_test;
GO
/*use
Oracle native syntax to invoke the procedure*/
BEGIN
del_proc_test (1);
END;
GO
/*use ODBC
syntax to invoke the procedure*/
{CALL
del_proc_test (2)}
GO
SELECT *
FROM proc_test
GO
SELECT
'Only one row is left out' FROM dual
GO
DROP TABLE
proc_test
GO
DROP
PROCEDURE del_proc_test
The following example demonstrates how to use an Oracle PL/SQL package to retrieve resultsets from an Oracle stored procedure using Microsoft ODBC Driver for Oracle version 2.0 or higher.
The PL/SQL code
below defines a package containing two procedures that return different
resultsets, and then provides two ways to return resultsets from the package.
To invoke the
procedure, use the following syntax:
Note: The <max-records-requested>
parameter must be greater than or equal to the number of rows present in the
resultset. Otherwise, Oracle returns an error that is passed to the user by the
driver.
PL/SQL records
cannot be used as array parameters. Each array parameter can represent only one
column of a database table.
Note that the Microsoft ODBC driver for Oracle 2.0 or higher does have
a special feature of returning multiple resultsets from packages/procedures.
The driver itself does not support returning multiple
resultsets on a single statement.
DB2 scenario:
-- DB2
supports multiple resultsets
CREATE TABLE t1 (c1 int);
INSERT INTO t1 VALUES (7);
SELECT c1
FROM t1;
GO
CREATE
VIEW myView
AS
SELECT c1
FROM t1;
GO
SELECT *
FROM myView;
GO
CREATE
PROCEDURE my_procedure
(IN value_param int)
LANGUAGE SQL
BEGIN
INSERT INTO t1 VALUES (value_param);
END
GO
{CALL
my_procedure (7)} -- execute the procedure
GO
CREATE
PROCEDURE t1_result_set()
LANGUAGE SQL
RESULT SETS 1
BEGIN
DECLARE c1 CURSOR WITH RETURN FOR
SELECT * FROM t1;
OPEN c1;
END
GO
{CALL
t1_result_set ()} -- execute the procedure
GO
SQL Server scenario:
-- SQL
Server supports multiple resultsets
USE tempdb
--
also see item #1 in the Known
Problems and Workarounds sectionGO
IF
EXISTS(SELECT name FROM sysobjects WHERE id = OBJECT_ID('t1'))
DROP TABLE t1
GO
CREATE
TABLE t1 (c1 int)
INSERT
INTO t1 VALUES (7)
SELECT c1
FROM t1
GO
IF
EXISTS(SELECT name FROM sysobjects WHERE id = OBJECT_ID('sp_test_proc'))
DROP PROC sp_test_proc
GO
CREATE
PROC sp_test_proc
AS
SET
NOCOUNT ON
INSERT
INTO t1 VALUES (8)
SELECT c1
FROM t1
GO
sp_test_proc
GO
SELECT
@@VERSION
sp_help t1
/*yields an error. EXECUTE keyword is required if the
statement is not the first
statement in the batch*/
GO
IF
EXISTS(SELECT name FROM sysobjects WHERE id = OBJECT_ID('sp_test_proc'))
DROP PROC sp_test_proc
GO
CREATE
PROC sp_test_proc
(@n int
OUTPUT)
AS
SET @n =
7000
GO
DECLARE @n
int
SET @n =
-1
GO
EXECUTE
sp_test_proc @n OUTPUT /*yields an error. @n is out of scope*/
SELECT @n
GO
Scenario: Data source/driver does not support multiple resultsets.
CREATE
TABLE t1 (c1 int)
GO
INSERT
INTO t1 VALUES (7)
GO
INSERT
INTO t1 VALUES (8)
GO
SELECT c1
FROM t1
GO
Note that not all data sources and/or
drivers support '/**/' and/or '--' comment syntaxes.
Transactions
By default Query Tool operates in
autocommit transaction mode on. Users can override this behavior by initiating
a transaction programmatically either explicitly or implicitly or by choosing
Options and New Connections from the Tools menu and unchecking the Autocommit
check box found under Transactions thereby
initiating a transaction implicitly.
SQL Server scenario:
DB2 Scenario:
In
DB2, a transaction is started implicitly with the first executable SQL
statement and ends with a COMMIT or ROLLBACK or ends when the
program terminates and, only when the autocommit transaction mode is off.
Choose
Options and New Connections from the Tools menu and uncheck the Autocommit
check box found under Transactions and connect to an DB2 data source to
initiate an implicit transaction.
Oracle Scenario:
Non-repeatable Read: Transaction T1 retrieves a
row; then transaction T2 updates that row and T1 retrieves the "same"
row again. T1 has now effectively retrieved the "same" row twice and
has seen two different values for it.
Phantoms: T1 reads a set of rows that satisfy
certain search conditions. T2 then insert one or more rows that satisfy the
same search condition. If T1 repeats the read, it will see rows that did not
exist previously - "phantoms".
Scalar
Functions are useful if you are writing portable SQL statements across
different data sources. ODBC specifies
the following types of scalar functions:
·
Time,
Date, and Interval Functions
·
Explicit
Data Type Conversion Function
The escape sequence for calling a scalar function
is:
Scalar
functions operate on the column(s) of a resultset and/or the column(s) that
restrict row(s) of a resultset. To determine which scalar functions are
supported by a driver, choose ODBC Driver Info from the Help menu and go
through the SQL Functions list found under Functions tab.
The
following two examples illustrate the use of a scalar function CONVERT. These examples assume the existence of a table
called employees, with an empno column of type SQL_SMALLINT and an empname column of type SQL_CHAR.
If
you specify the following SQL statement:
·
A driver for ORACLE
translates the SQL statement to:
·
A driver for SQL
Server translates the SQL statement to:
If
you specify the following SQL statement:
·
A driver for ORACLE
translates the SQL statement to:
·
A driver for SQL
Server translates the SQL statement to:
·
A driver for Ingres
translates the SQL statement to:
SELECT ABS(empno), INT2(empname) FROM employees WHERE empno
<> 0
To return the SQL string as translated by the
driver without running the query, choose Retrieve Native SQL from the Query
menu.
Users
can mix calls to scalar functions that use native syntax and calls to scalar
functions that use ODBC syntax. For example, assume that we have a table called
customers with a column name and names are stored as a
last name, a comma, and a first name. The following SQL statement creates a
resultset of last names of customers in the customers table. The statement
uses the ODBC scalar function SUBSTRING and the SQL
Server scalar function CHARINDEX and will execute correctly only on SQL Server.
For
maximum interoperability, users should use the CONVERT scalar function to make sure the output of a scalar
function is the required type.
Tip:
To guard against the unintentional use of non-portable SQL extensions, turn on
the FIPS¹ FLAGGER and go through the messages in the
Messages window pane.
SQL Server
scenario:
Oracle
scenario:
¹Federal
Information Processing Standard (FIPS). Standards that apply to computer
systems purchased by the United States government. Each FIPS standard is
defined by the National
Institute of Standards and Technology (NIST). The current standard for SQL
products is FIPS 127-2, which is based on the ANSI SQL-92 standard. ANSI SQL-92
is aligned with ISO/IEC SQL-92.
ODBC aligns with the following
specifications and standards that deal with the Call-Level Interface (CLI).
(The ODBC features are a superset of each of these standards.)
·
The X/Open CAE Specification "Data Management: SQL
Call-Level Interface (CLI)"
·
ANSI/ISO/IEC 9075-3:1995 (E) Call-Level Interface
(SQL/CLI)
Known Problems and Workarounds
1.
In the case of SQL Server, the T-SQL keyword USE
may not switch
the database context to the specified database. To workaround this problem,
either use the combo box provided on the toolbar to change the database context
or place the USE <database>
statement in a
separate batch.
2.
In the case of ORACLE, the following errors may appear when the
application is launched from a location that exceed eight characters and/or
when it contain special characters:
When using Oracle ODBC driver:
When using Microsoft ODBC driver
for Oracle:
To fix the above problems, choose a short
location (less than or equal to eight characters) that do not contain any
special characters besides making sure that Oracle TNS Listener Service is
running.
For better performance, set Include
SYNONYMS in SQL Columns (found under Performance group box) to False (0) using
the ODBC administrator for the data source.
3.
Date fields may not be formatted correctly when exporting grid
results to Excel by choosing Save As
from the File menu or by choosing Save Selection by right clicking on the grid
and when you opt to have the data exported to Excel. To workaround this
problem, manually format the date fields from within Excel.
4.
When you copy grid data and paste it into Excel, Excel may show a
weird character between each column. To workaround this problem, use a new
instance of Excel.
5.
Using very large resultset(s) can cause problems when scrolling
the grid. When you drag the thumbtrack to the bottom of the vertical scrollbar,
the thumbtrack might jump back to the top. This happens whenever the top row of
the grid would have been greater than 65,535. To workaround this problem, limit
the resultset to fewer than 65,536 records. While the grid can display more
rows, you cannot use the thumbtrack to scroll past this number.
6.
Windows NT/Me/98/95 specific:
When you right-click in the Query/Grid/Results/Messages
window pane while a context menu is displayed you may not be able to track the
context menu at the position where you clicked. To workaround this problem,
first dismiss the context menu and then do a right-click.
7. The application may go to an indeterminate state or
may end up in a fatal crash if you attempt to retrieve more than 2 million
(2,000,000) or so rows. There is no workaround for this problem currently.
8. The “DSN-less” logins found under File menu and
Connect sub-menu is invoked with minimal ODBC driver-specific <keyword=value> pairs. And, you may not be able to connect to some
databases using the specified “DSN-less” login. To workaround the problem,
first define a Data Source Name (DSN) using the ODBC Data Source Administrator
found under Tools menu and then use the defined DSN by choosing Data Source
from the File menu and Connect sub-menu.
9. The Edit Find in Files operation may return
incorrect results if the file searched contain lines longer than the character
maximum the application can handle. To workaround the problem, perform the Find
in Files operation with Output file names only on. Once the results are
displayed choose Next Error Batch/Tag from the Edit menu or press F4 or double
click on the filename in the Results window pane, follow the onscreen
instructions (if, any), and press F3 to find the subsequent occurrence(s)
within the same file. The Find in Files operation can be invoked by pressing
Ctrl+Shift+F.
10. The application may hang, if there is/are any open
transaction(s) on a connection or connections and, when attempting to use the
Schema browser on the same connection or connections on the same data source.
To workaround the problem, first commit or rollback the transaction on the
connection or connections on the same data source and then use the Schema
browser on the same connection or connections on the same data source. Also see
Transactions.
Known Limitations and Workarounds
1.
The Results in Text option found under the Query menu is good only
for retrieving Procedure/View text. If this option is not selected, results
will be shown in grid by default.
2.
The maximum number of results grid generated is limited to 1,500.
3.
The total number of connections is limited to 512.
4.
The maximum number of Schema window pane items that can be printed
is limited to 1,820 (approx.).
5.
The maximum number of Grid rows that can be printed is limited to
2,046 (approx.)¹.
6.
The maximum number of SQL URL links that can be added to the Help
menu is limited to 512.
7.
The edit control used in this application is limited to 16 MB
(16,777,215 bytes) of text.
8.
The maximum number of “DSN-less” Logins is limited to 512.
Unless otherwise noted, the above
limitations depend on the available system resources and the operating system.
¹Tip:
To print a resultset with more than 2,046 rows, choose Save As from the File
menu and opt to have the data exported to Excel automatically.
1.
Connection Pooling is not supported. This behavior is by design.
If a connection fails during a query processing, the Multiple Document
Interface (MDI) child window that holds the connection is unusable. You can
workaround this problem by choosing New from the File menu without doing an
explicit Connect from the File menu.
2.
Retrieving Unicode data (International characters) is not
supported currently. To workaround this problem, please consider using Query
Tool (using ADO) 4.1.
3.
Print previewing of Query window pane, Results window pane (in
text mode), and Messages window pane is not supported currently.
File List and Uninstall
Information
Default "Unzip To
Folder":
C:\Tools\QTODBC40
File name, Version, File date, and
Size:
QTODBC.EXE, 4.1.0.5, 10/26/2002, 988 KB
ODI.DLL, 2.0.0.8, 10/26/2002, 308 KB
UINSTQTO.EXE 2.0.1.0, 08/03/2002, 48 KB
MSVCRT.DLL, 6.1.8924.0, 05/04/2001, 285 KB
MSHFLXGD.OCX, 6.0.88.4, 5/22/2000, 429 KB
QryTool.reg, 1 KB
Readme.htm, 167 KB
OrderForm.txt, 3 KB
Uninstall Information:
1. Run
..\QTODBC40\UINSTQTO.EXE.
2. Delete
..\QTODBC40.
Site Licenses, Pricing, and
Ordering Information
Site Licenses:
A site license for Query Tool (using ODBC)
4.1 entitles an organization to receive one copy of the distribution package
and duplicate the software as necessary for use inside or outside the
organization on the specified number of computers. See the table below for site
license pricing.
[Note: Customers who bought version 3.5 on or before February 18, 2002 and
wishing to upgrade to version 4.1 may contact the author at gpoulose@att.net to request a new product ID. Please indicate
version 3.5 product ID in your e-mail. All other version 3.5 customers please
see the table below for upgrade pricing.]
Pricing:
Single copy: US $25.00 (upgrade price US $18.00) each
2 to 9 computers: $20.00 (upgrade price $15.00) each
10 to 49 computers: $16.00 (upgrade price $12.00) each
50 to 499 computers: $12.00 (upgrade price $9.00) each
500 to 999 computers: $10.00 (upgrade price $8.00) each
Over 1000 computers: $7.00 (upgrade price $6.00) each
PayPal
customers outside the United States, please add 3.9% + US $0.30 fee.
PayPal
customers within the United States, please add 2.9% + US $0.30 fee.
New York residents, please add 8.25% sales tax.
Discounts upto
25% is available for Federal, State, and Local Governments, and Educational
Institutions (US customers only).
Diskette order(s) will be shipped within five business days after they are received via the US mail.
Upgrades are
free upto version 5.0.0.0.
Ordering Information:
To order, send the completed Order Form and a check or a bank/personal/postal money
order. Postal money order must be in US dollars only.
Customers outside the United States,
please use the Currency
Converter to calculate the foreign equivalent and enclose a check for the
calculated amount.
PayPal
customers, please use the e-mail ID gpoulose@att.net
to send the payment. Please make sure that you also send the completed Order Form as an attachment to gpoulose@att.net.
Payment address:
George Poulose
50 Rinaldi Blvd.
Unit #7-C
Poughkeepsie, NY 12601-2911
USA
Credit card orders are not accepted. When
payment is received you will be sent a Product ID.
Customer information is considered
confidential and will not be shared or distributed to any third party.
If you have any comments, please send it
to: gpoulose@att.net
If you encounter a problem, please visit http://gpoulose.home.att.net/
to obtain the latest version. If you still have problems, please record all the
information relevant to the problem, determine if the problem is reproducible,
and if so, how, and send this information to: gpoulose@att.net
Unless
you have a different license agreement signed by the author your use of this
software indicates your acceptance of this license agreement.
Registered Version:
One
registered copy of Query Tool (using ODBC) 4.1 may either be used by a single
person who uses the software personally on one or more computers, or installed
on a single workstation used non-simultaneously by multiple people, but not
both.
You
may access the registered version of Query Tool (using ODBC) 4.1 through a network,
provided that you have obtained individual licenses for the software covering
all workstations that will access the software through the network.
Evaluation Version:
Subject
to the terms below, you are hereby licensed to use this software for evaluation
purposes without charge for a period of 70 days. If you use this software after
the 70-day evaluation period a registration fee of US $25.00 is required.
Terms and Conditions:
Provided
that you verify that you are distributing the evaluation version you are hereby
licensed to make as many copies of the evaluation version of this software and
documentation as you wish; Give exact copies of the original evaluation version
to anyone; And distribute the evaluation version of the software and documentation
in its unmodified form via electronic means. There is no charge for any of the
above. You are specifically prohibited from charging, for any such copies,
however made; And from distributing the software and/or documentation with
other products (commercial or otherwise) in any form without prior written
permission from the author.
This software and the accompanying files
are sold “as is” without express or implied warranty. Use it at your own risk.
Any liability of the author will be limited exclusively to product replacement
or refund of purchase price.
Thanks to the following people:
Ronald Pihlgren, ODBCINFO:
Retrieves ODBC Driver Capabilities, MSDN
2002.
Ivan
Zhakov, MDI
Windows Manager Dialog, Codeproject.com
2000.
Iuri
Apollonio, Sort
List (numeric/text) Using Callback, Codeguru.com
1999.
Oleg
G. Galkin and Kirk Stowell, Show/Hide
Static Panes, Codeguru.com
1999.
Koay Kah
Hoe, A Print
Enabled Tree View, Codeproject.com
2000.
© 1999-2002 George Poulose.