使用unixODBC,您可以使用一个名为"isql"的简单命令行实用程序来测试某些查询的连接和权限.无需编写额外的代码或安装libs或programs肿的程序,是否有一种简单的方法来打开X数据源并发送一些sql命令并完成它?
With unixODBC you can use a simple command line utility called "isql" to test your connection and permissions of some queries. Without having to write extra code or install libs or bloated programs, is there a simple way to open up X data source send some sql commands and be done with it?
最好在命令行上这样做.
Doing this on the command line would be preferable.
推荐答案在Windows中通过ODBC连接创建快速测试查询的一种方法是使用 DQY 格式.
One way to create a quick test query in Windows via an ODBC connection is using the DQY format.
要实现此目的,请创建一个DQY文件(例如 test.dqy ),其中包含如下所示的魔术前两行(XLODBC和1),然后是第三行的ODBC连接字符串,然后是在第四行上查询(全部在一行上),例如:
To achieve this, create a DQY file (e.g. test.dqy) containing the magic first two lines (XLODBC and 1) as below, followed by your ODBC connection string on the third line and your query on the fourth line (all on one line), e.g.:
XLODBC 1 Driver={Microsoft ODBC for Oracle};server=DB;uid=scott;pwd=tiger; SELECT COUNT(1) n FROM emp然后,如果通过双击打开文件,它将在Excel中打开并使用查询结果填充工作表.
Then, if you open the file by double-clicking it, it will open in Excel and populate the worksheet with the results of the query.
更多推荐
在Windows上测试ODBC的最简单方法
发布评论