OSQL(1)

πŸ’… OSQL(1) β€” the FreeTDS manual, LOCAL section, and yes bestie we're doing this

okay so welcome to osql(1), straight out of the FreeTDS manual (that's the LOCAL one, iykyk) ✨ pull up a chair, this one's short and sweet and honestly kinda iconic.


πŸŽ€ NAME πŸŽ€

osql β€” a whole lil utility for testing your FreeTDS connections and queries πŸ¦‹


✨ SYNOPSIS ✨

osql -S dsn -U username -P password [-I ini_directory]

🌸 DESCRIPTION 🌸

so osql is a diagnostic tool that ships as part of FreeTDS πŸ’– it's a Bourne shell script β€” yes, a script, she's humble β€” and what she does is check and report on your configuration files. If everything checks out OK, she invokes isql. slay.

heads up though: osql works only with the isql that comes with unixODBC. no substitutes, no swaps, periodt πŸ’…

🫢 OPTIONS 🫢

  • -S dsn β€” the Data Source Name to which to connect, as known to odbc.ini. πŸ‘‘
  • -U username β€” database login name.
  • -P password β€” database password. πŸ”
  • -I ini_dir β€” override the odbc.ini file location.

πŸ“ EXAMPLE πŸ“

say your odbc.ini has a section like this:

[myDSN]
servername = myserver
TDS_Version = 5.0

then you'd invoke osql as:

osql -S myDSN [...]

πŸ¦‹ FILES πŸ¦‹

  • odbc.ini
  • freetds.conf

πŸ’€ NOTES πŸ’€ (read these fr fr)

if you can connect with osql -S servername -U user -P passwd, then your FreeTDS ODBC installation is working βœ… that's the vibe check and you passed.

osql guesses where unixODBC might look for its odbc.ini by examining the binary. this is not always an effective approach 😭 if it doesn't work, you'll receive a report of candidate strings. kindly pass along the output to help improve the guessing β€” you're basically doing community service and we love that for you 🫢

if osql cannot intuit your odbc.ini directory, you can force the issue with the -I option. however β€” and this is the important part β€” you're then instructing osql what to test, not where unixODBC will eventually look. so your override is therefore only as good as you are πŸ™ˆ look carefully at the error output before overriding, ngl.

if you have suggestions for ways to make osql more useful as a diagnostic tool, please post them to the FreeTDS mailing list πŸ’Œ main character energy, honestly.


⭐ HISTORY ⭐

osql first appeared in FreeTDS 0.65. a legend from day one πŸ‘‘


🌈 AUTHORS 🌈

the osql utility was written by James K. Lowdon. wait, no β€” James K. Lowden. thank you James πŸ’œ


and that's the whole page, bestie πŸŽ€πŸ’– this one's FreeTDS 1.5.20, dated April 26, 2012 β€” go forth, connect, and slay your odbc.ini βœ¨πŸ¦‹

πŸ“¦ where this page comes from