iodbctest(1)

πŸ“¦
version 3.52.16 Β· 3 versions
, in arch rolling, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– iodbctest(1) β€” iODBC Driver Manager πŸ’–

okay bestie, so you know how the manual name is iODBC Driver Manager? yeah. that's the whole vibe here. welcome to the demo programs, they're iconic, they're little, they slay πŸ’…


✨ NAME ✨

iodbctest, iodbctestw β€” iODBC Demonstration programs

no cap, that's literally it. two lil demo besties.


🌸 SYNOPSIS 🌸

iodbctest ["DSN=xxxx[;UID=xxxx][;PWD=xxxx][;OPT=value]"]
iodbctestw ["DSN=xxxx[;UID=xxxx][;PWD=xxxx][;OPT=value]"]

πŸ¦‹ DESCRIPTION πŸ¦‹

So. iodbctest and iodbctestw? They're simple ODBC sample programs. And the way they exist is to show off the strength of the ODBC API β€” like, connecting to literally any ODBC enabled database, issuing SQL commands, and pulling back the query results. main character energy fr fr πŸ‘‘

Here's the tea on the difference:

  • iodbctest uses the standard ODBC API calls to connect using any DSN β€” but it retrieves all results in ASCII mode.
  • iodbctestw uses the ODBC Unicode API calls to connect using any DSN β€” and it retrieves all results in Unicode mode. ✨

πŸ’… OPTIONS πŸ’…

iodbctest uses the SQLDriverConnect function to make a connection using any available ODBC compliant driver. Which is huge, because it lets you override any ODBC connect attribute in the DSN string. periodt.

Connect strings should start with either a DSN=xxx or a DRIVER=xxxx attribute, optionally followed by other DSN attributes separated by a semicolon. like, for example:

DSN=ora9;UID=scott;PWD=tiger;DATABASE=ora9u

Any attributes required for a proper connection that you did not enter in the DSN connect string must be present in the odbc.ini file. no skipping, bestie, the file has to have them πŸ™ˆ

Now, quoting rules, listen up:

  • If the connect string is passed as an argument to the iodbctest program, the string should be quoted, because most shells use the semicolon as their command separator. (semicolons are little menaces honestly 😭)
  • If the connect string is entered on the interactive prompt, no quotes should be used.

Once a successful connection has been established, the user is prompted for a SQL command to be sent to the database. And heads up β€” a SQL command cannot span multiple lines. one line only, keep it cute πŸ’–

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


🫢 Special commands, iykyk 🫢

Additionally, the iodbctest program understands a few special commands:

  • qualifiers β€” Show a list of qualifiers using the SQLTables catalog call.
  • owners β€” Show a list of owners using the SQLTables catalog call.
  • tables β€” Show a list of tables using the SQLTables catalog call.
  • types β€” Show a list of tables types using the SQLTables catalog call.
  • datatypes β€” Show a list of data types using the SQLGetTypeInfo catalog call.
  • reconnect β€” Perform a disconnect/reconnect with the information saved during the first SQLDriverConnect.
  • quit (or exit) β€” Exit the program and return to the shell. bye bestie πŸ‘‹

🌈 EXAMPLES 🌈

πŸ“ Example the first: get a list of DSNs before making a connection

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

$ 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>

⭐ Example the second: connect to an Oracle 9 instance

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

$ 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

Copyright Β© 1996-2023 OpenLink Software


🧚 AUTHOR 🧚

iODBC Administrator <iodbc@openlinksw.com>


and that's the whole page bestie, no notes, we ate πŸ’…βœ¨

version 3.52.16 Β· dated 3 August 2005 Β· kisses from the iODBC Driver Manager crew, mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from