You can use the an interactive ODBC test tool isql to test your DSNs for their connectivity to databases and to execute SQL statements once you are connected to a database. The 32-bit tool is installed with Zen Enterprise Server 32-bit, Zen Client 32-bit, and Zen Enterprise Server 64-bit. The 64-bit tool is named isql64 and is installed with both Enterprise Server 64-bit and Client 64-bit.
The only difference between the two utilities is the type of DSN to which they can connect. By default, dsnadd creates DSNs that are accessible to both 32-bit and 64-bit applications (the DSNs specify the driver description “Pervasive ODBC Interface”). You can test connectivity of such DSNs with isql or isql64. See Zen ODBC Driver Descriptions for Linux, macOS, or Raspbian.
For example, to connect to the Demodata sample database included with Zen, run isql (or isql64) with the DSN as the first parameter: isql demodata or isql64 demodata. The DSN for Demodata specifies the driver description Pervasive ODBC Interface, so either version of the tool can test its DSN connectivity.
The tool puts you in an interactive state with the database. From that state, you can query the database (such as SELECT * FROM Department).
To enable security on a database using isql, first connect to the database as the Master user, then use the SET SECURITY statement in SQL to set the Master user password. For example:
To connect to a secured database, pass the user name and password as the second and third parameters respectively to isql. For example, to connect to demodata as user Master using password vforge, enter isql64 demodata Master vforge or isql demodata Master vforge.
Synopsis
<isql | isql64> DSN [UID [PWD]] [options]
Where:
DSN is the data source name for the database to which you want to connect. Always required.
UID is the user name to connect to the Zen SQL database engine for a secured database. Required only for a secured database.
PWD is the password for UID. Required only if UID used.
options is one or more of the options as defined below.
Display verbose explanations for errors and warnings.
--version
Display version of unixODBC in use.
-w
Wrap results in an HTML table.
-x0xHH
Delimit columns with HH, where x is in hex. For example, 0x09 is the tab character.
Commands
Once you are in interactive mode, the following commands may be used.
sql-statement
A valid SQL statement to execute against the database to which isql or isql64 is connected.
help [tablename]
Display column information. The output is the same as for the dbo.fSQLColumns catalog function. See dbo.fSQLColumns in SQL Engine Reference.
If tablename is omitted, the output is for all tables in the database, including system tables.
quit
Exits interactive mode.
Notes
By default, isql and isql64 display prompt information when in interactive mode (such as Connected!, sql-statement, help [tablename], and quit). For redirection and piping of output to a file, you may not want the prompt information. The -b option suppresses the output of the prompt information.
Isql and isql64 support redirection and piping for input and output. In addition, both utilities can process a file containing multiple SQL statements. Each statement must end with a carriage return/line feed. The last line of the file must be a blank line. See Examples.
Examples
The following example connects to an unsecured database named acctspay that will be accessed by a 64-bit ODBC application running on a 64-bit client:
isql64 acctspay
The DSN is also named acctspay and specifies the ODBC driver description “Pervasive ODBC Interface.”
The following example connects to a secured database named payroll as user Master with password j77b99:
isql payrollsecdb Master j77b99
The DSN is named payrollsecdb”and specifies the deprecated, legacy-style ODBC driver description “Pervasive ODBC Engine Interface.” You could also use isql to test the DSN if the DSN had specified the ODBC driver description “Pervasive ODBC Interface.”
The following example shows how to process multiple SQL statements. Suppose that you want to run the following two queries against the Demodata sample database:
select count(*) from billing select count(*) from person
Create a file (named two-queries.sql for discussion purposes) with the two lines. Include a blank line as the last line in the file.
Run the following command:
cat two-queries.sql | isql demodata -b
The result is as follows:
+------------+
| EXPR_1 |
+------------+
| 1315 |
+------------+
SQLRowCount returns 1
1 rows fetched
+------------+
| EXPR_1 |
+------------+
| 1500 |
+------------+
SQLRowCount returns 1
1 rows fetched
Note the use of the -b option to suppress the prompting information from the output. Without the -b option, the result is as follows: