unixodbc

The same error is detected in stored **procedure**, but not in stored **function**

独自空忆成欢 提交于 2019-12-06 16:15:52
This question is related to my previous one: RaiseError (PERL, DBI) equivalent for unixODBC C API? As I isolated the problem later, I'll post new question, that is more specific, isolated and without unnecessary information. Version: unixODBC 2.3.0 lib: unixODBC - C API Suppose I have a stored FUNCTION : CREATE FUNCTION "test".func() RETURNING LVARCHAR(1000); set debug file to '/home/directory_does_not_exists/unknown.log'; trace off; trace on; trace off; return 'result is set here'; END FUNCTION; And the same body, but in stored PROCEDURE : CREATE PROCEDURE "test".proc(pDummy SMALLINT) set

How do I install RODBC on Mac with unixodbc and freetds?

牧云@^-^@ 提交于 2019-12-06 06:55:38
问题 After a fairly extensive search, I noticed that a number of people are having a hard time finding a start-to-finish guide that answers this question. (At least one question notes that a solution exists, but the proposed solution does not get around the fact that, by default, RODBC attempts to compile against iODBC, which is not included with Yosemite.) I just went through this process, so I thought I would document it here in the hope that it will benefit others. I am connecting to a SQL

Error connecting to MS SQL Server using pyODBC, unixODBC and FreeTDS (on a Mac)

懵懂的女人 提交于 2019-12-06 06:03:01
I am getting an error when trying to connect to a MS SQL server in python, using the pyODBC --> unixODBC --> FreeTDS --> MS SQL stack. I’ve spent a lot of time on this, and there are some great resources if you’ve reached this question with more fundamental problems getting a connection to work here and here . However, my question is regarding an error that (I think) is very close to the finish line of this very frustrating experience. Specifically, this code in jupyter notebook: pyodbc.connect( 'DRIVER=/usr/local/lib/libtdsodbc.so;' 'SERVER=MyServerIP;' 'PORT=1433;' 'DATABASE= DatabaseName;'

Set connection settings with Pyodbc + UnixODBC + FreeTDS

不想你离开。 提交于 2019-12-06 04:34:53
I have a setup using Pyodbc, UnixODBC and FreeTDS, but somewhere in there some options are being set and I don't know where. According to SQL Server Management Studio, my program is sending some settings when it opens the connection: set quoted_identifier off set ansi_padding off set ansi_nulls off ... But I need a different set of settings: set quoted_identifier on set ansi_padding on set ansi_nulls on ... Is there any way to change this? If I can't do it with my current setup, are there any other libraries I could use in Python that would let me change it (preferably using the Python

Querying database schema of SQL Server DB via ODBC?

吃可爱长大的小学妹 提交于 2019-12-06 04:30:57
Is there a generic way to retrieve a database schema using ODBC that works across databases? If not, what is the easiest way to do this when the database server is MS SQL Server? I am working with unixodbc, from Linux. Query against the INFORMATION_SCHEMA views. Beautiful thing about using information schema is that it's a standard so it should be portable to any database that has implemented the standard. e.g. SELECT * FROM INFORMATION_SCHEMA.COLUMNS ISC The standard is the SQL-92 Starts at page 535 If you want to get a list of the schema's in the database, you can use the wildcard in the

Using UnixODBC and FreeTDS to connect to Pervasive SQL server in ubuntu?

空扰寡人 提交于 2019-12-06 04:14:21
I am trying to connect to a Pervasive Sql Server which is running on Windows 10 from an Ubuntu 14.04.4 server. I am using the following services to try connect to the server: FreeTDS unixODBC Before starting I tried to ping the host machine from the vm console with success. I then run the following command to check FreeTDS has installed correctly; tsql -C Which returned: Compile-time settings (established with the "configure" script) Version: freetds v0.95.95 freetds.conf directory: /usr/local/etc MS db-lib source compatibility: no Sybase binary compatibility: no Thread safety: yes iconv

Failure to connect to SQl Server from Linux

天涯浪子 提交于 2019-12-05 17:55:23
I am trying to connect to SQL Server 2008 on CentOS 5.8. I am using unixODBC 2.3.0 and SQL Server ODBC Driver (www.microsoft.com/en-us/download/details.aspx?id=28160). When I try to test the connection by running: isql -v mydsn username password it givens me: [S1T00][unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired [08001][unixODBC][Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is

One of the SELECT fails using unixOdbc - SQLSTATE[24000]: Invalid cursor state

[亡魂溺海] 提交于 2019-12-05 08:11:49
I am running Ubuntu 13.10 with FreeTDS and ODBC (package: php5-odbc) installed. I use tds version = 8.0, but also tried tds version = 7.2. I am using PDO and this is my DSN: $dsn = sprintf('odbc:Driver=FreeTDS;Server=%s;Port=1433;Database=%s', DB_SQL_SERVERNAME, DB_DB_NAME); I connect to MSSQL instance and perform some INSERT/SELECT queries using transactions, however I can not figure out why this query fails: SELECT id FROM tblColumns WHERE siteID = 10063 AND typeID = 1000 AND extendedTypeID = 18 AND label = 'RwThiFc85A' giving error: SQLSTATE[24000]: Invalid cursor state: 0 [FreeTDS][SQL

Ubuntu SQLServer C开发

丶灬走出姿态 提交于 2019-12-05 04:37:08
安装ODBC Driver sudo su curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list exit sudo apt-get update sudo ACCEPT_EULA=Y apt-get install msodbcsql=13.1.4.0-1 mssql-tools=14.0.3.0-1 unixodbc-dev echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc source ~/.bashrc 来源: https://my.oschina.net/u/3732258/blog/3132302

为Python编程三步配好Linux上的FreeTDS

一个人想着一个人 提交于 2019-12-05 03:54:48
在Linux中,如果要使用ODBC并连到MS SQLServer,我们需要为Linux操作系统安装并配置好UnixODBC模块。很多教程中的操作步骤比较复杂,我将其中关键步骤精简到三步: 本教程以刚刚安装好的Ubuntu 12.04环境为例: 第一步 ,为Linux安装ODBC模块unixodbc,并添加MSSQL的ODBC驱动程序FreeTDS: 命令:在命令行终端中输入命令: sudo apt-get install tdsodbc unixodbc 并输入系统管理员密码。 说明:tdsodbc为FreeTDS的关键包,含有MSSQL的驱动程序文件libtdsodbc.so,而unixodbc为Linux上的ODBC框架,含有关键二进制文件:libodbc.so或libodbc.so.1 第二步 ,找到libtdsodbc.so这个文件的路径。例如,如果文件路径为 /usr/lib/i386-linux-gnu/libtdsodbc.so ,修改/etc/odbcinst.ini(没有的话要在/etc/下新建这个文件),在文件中加入: [FreeTDS] Driver = /usr/lib/i386-linux-gnu/libtdsodbc.so 通常libtdsodbc.so在32位Linux上位于usr/lib/i386-linux-gnu/odbc