IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New ODBC Connectivity from Windows command line?
Does such a utility exist that would let me connect to an ODBC Data Source, run a query, and store the result in a text (or whatever) file?

Basically, a generic kind of Oracle's SQL*Plus that talks to any ODBC source. Like an Access 'pass-through' query, but without Access.

An admittedly brief Google search hasn't returned anything of value, so I figure querying the IGM shouldn't hurt :)

Failing that, here's what I am trying to achieve:

I need to periodically dump tables from a box running an [link|http://www.openlinksw.co.uk|OpenLink] server/listener/whatever.

We currently do this on Windows using an ETL tool.

However ...

  • We're migrating to HPUX - and so can't keep the ETL tool on our Windows box.
  • The source database is running with an old version of OpenLink - a version for which there are no HP-UX drivers.
  • We're not allowed to upgrade OpenLink on the source database box.
  • I really, really don't want to use Access to do pass-through queries.


Hence, my curiosity about some kind of generic command-line ODBC interface.

Any thoughts?
John. Busy lad.
New Best bet is probably a scripting engine
like WSH, or Python, or Perl, etc...
New If I still had the "touch"
I could write a VB 6.0 program to connect to an ODBC source and output the result to a text file for you. But I've seen better days. I am sure that someone else here can do it using an ADO record set, ADO connection, and then writing out to a text file based on command line parameters for the ODBC source, the query, and the filename. Or heck, almost any other language should be able to do it, Delphi, C++, etc.



"Lady I only speak two languages, English and Bad English!" - Corbin Dallas "The Fifth Element"

New Cygwin perhaps?
That would give you a Unix-like API to write something against.

Oh hang on: I think there's a [link|http://unicon.sourceforge.net/|Unicon] binary for Windows that can talk ODBC. It should be quite easy to do what you want with that. You'll probably want to read [link|http://www.cs.utsa.edu/~fbalbi/unicon|Frederico Balbi's Unicon ODBC Interface].

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New 'Quite Easy' is just what I need
Because as always, time is tight.

Thanks everyone for your input - I've just done a rudimentary table dump with UnIcon, so it looks like it'll be the winner. Especially since the first demo program I found did almost exactly what I'm after :) So we have a solution!

At least, it'll buy us some time til we have to pay a lot to implement some kind of kludgy closed-source solution, or something :-)

Phew, software-project-in-near-panic goes right back to 'on track...'
John does the "I'm not worthy!" thing at the IGM :)
     ODBC Connectivity from Windows command line? - (Meerkat) - (4)
         Best bet is probably a scripting engine - (ChrisR)
         If I still had the "touch" - (orion)
         Cygwin perhaps? - (static) - (1)
             'Quite Easy' is just what I need - (Meerkat)

I bumped into a dot.
79 ms