File: iodbctest.1.in

package info (click to toggle)
libiodbc2 3.52.16-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,944 kB
  • sloc: ansic: 49,090; sh: 5,021; objc: 3,623; makefile: 543
file content (144 lines) | stat: -rw-r--r-- 4,160 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.nh
.TH iodbctest 1 "3 August 2005" "@VERSION@" "@PACKAGE_NAME@"

.SH NAME
iodbctest, iodbctestw \- iODBC Demonstration programs

.SH SYNOPSIS
.B iodbctest
.RB [ \(dqDSN=xxxx[;UID=xxxx][;PWD=xxxx][;OPT=value]\(dq ]
.br
.B iodbctestw
.RB [ \(dqDSN=xxxx[;UID=xxxx][;PWD=xxxx][;OPT=value]\(dq ]

.SH DESCRIPTION
The \fBiodbctest\fR program and \fBiodbtestw\fR programs are simple ODBC
sample programs, showing the strength of the ODBC API to connect to any
ODBC enabled database, issue SQL commands and retrieve the query results.

The \fBiodbctest\fR program uses the standard ODBC API calls to connect
using any DSN, but retrieves all results in ASCII mode.

The \fBiodbctestw\fR program uses the ODBC Unicode API calls to connect
using any DSN, and retrieves all results in Unicode mode.

.SH OPTIONS
The \fBiodbctest\fR program uses the SQLDriverConnect function to make
a connection using any available ODBC compliant driver. This allows the
user to override any ODBC connect attribute in the DSN string.

Connect strings should start with either a \fIDSN=xxx\fR or a
\fIDRIVER=xxxx\fR attribute optionally followed by other DSN attributes
separated by a semicolon e.g:

.nf
	DSN=ora9;UID=scott;PWD=tiger;DATABASE=ora9u
.fi

Any attributes required for a proper connection that are not entered in
the DSN connect string, must be present in the odbc.ini file.

If the connect string is passed as an argument to the \fBiodbctest\fR
program, the string should be quoted as most shells use the semicolon
as their command separator. If the connect string is entered on the
interactive prompt, no quotes should be used.

After a successful connection has been established, the user is prompted
for a SQL command to be send to the database. A SQL command cannot span
multiple lines.

If the SQL command returns one or more result sets, each result set is
fetched using character buffers and displayed in a table.

Additionally, the \fBiodbctest\fR program understands a few special
commands:

.TP 8
.B qualifiers
.br
Show a list of qualifiers using the SQLTables catalog call.

.TP 8
.B owners
.br
Show a list of owners using the SQLTables catalog call.

.TP 8
.B tables
.br
Show a list of tables using the SQLTables catalog call.

.TP 8
.B types
.br
Show a list of tables types using the SQLTables catalog call.

.TP 8
.B datatypes
.br
Show a list of data types using the SQLGetTypeInfo catalog call.

.TP 8
.B reconnect
.br
Perform a disconnect/reconnect with the information saved during the
first SQLDriverConnect.

.TP 8
.B quit (or exit)
.br
Exit the program and return to the shell.

.SH EXAMPLES
Start the iodbctest program and get a list of DSNs before making a
connection:

.nf
    $ iodbctest
    OpenLink ODBC Demonstration program
    This program shows an interactive SQL processor

    Enter ODBC connect string (? shows list): ?

    DSN                              | Driver
    -----------------------------------------------------------------
    ora9                             | OpenLink Generic ODBC Driver
    mysql                            | OpenLink Generic ODBC Driver
    mysqllite                        | OpenLink Lite for MySQL
    myodbc                           | MyODBC Driver
    pgsql                            | OpenLink Generic ODBC Driver
    tds                              | OpenLink Generic ODBC Driver

    Enter ODBC connect string (? shows list): DSN=ora9;PWD=tiger
    Driver: 05.20.0316 OpenLink Generic ODBC Driver (oplodbc.so)

    SQL>
.fi

Connect to an Oracle 9 instance which has been previously setup in the
odbc.ini file:

.nf
    $ iodbctest "DSN=ora9;UID=scott;PWD=tiger"
    iODBC Demonstration program
    This program shows an interactive SQL processor
    Driver: 05.20.0316 OpenLink Generic ODBC Driver (oplodbc.so)

    SQL>select * from emp

    ID               |NAME
    -----------------+-------------------------------------------
    1                |Record 1
    2                |Record 2
    2                |Record 3

     result set 1 returned 3 rows.

    SQL> quit
.fi

.SH COPYRIGHT
Copyright \(co 1996-2023 OpenLink Software

.SH AUTHOR
iODBC Administrator <iodbc@openlinksw.com>