freetds

Laravel sqlsrv works in tinker mode but not in browser

為{幸葍}努か 提交于 2019-12-25 05:58:07
问题 I have a Laravel 5 project (on a CentOS 7 machine) that connects to an external MSSQL database. I followed the setup outlined here using FreeTDS. When I hit the page using a browser I get the error: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9) . But when I use php artisan tinker and do something like App\MyModel::get(); , it returns an Illuminate\Database\Eloquent\Collection instance with the records/models just fine. Anyone knows what's

pyodbc not working on RedHat 5.4. Trying to connect to ms-sql database server using unixODBC and FreeTDS?

亡梦爱人 提交于 2019-12-24 16:26:43
问题 I am facing issue while trying to access ms-sql database using pyobdc. Here is the System config: Python 2.7.11 Pyodbc 3.0.7 RedHat 5.4 (Tikanga) 32 Bit system Microsoft SQL Server 2012 (Database server) unixODBC 2.3.0 $ tsql -C output : Compile-time settings (established with the "configure" script) Version: freetds v0.91 freetds.conf directory: /etc MS db-lib source compatibility: yes Sybase binary compatibility: no Thread safety: yes iconv library: yes TDS version: 5.0 iODBC: no unixodbc:

Byte string too long PyPyOdbc

若如初见. 提交于 2019-12-24 04:32:10
问题 Using FreeTDS and Python3.5 library PyPyodbc I am getting a 'Byte string too long' when trying to insert a row in the SQL Server database (residing on Windows). Under FreeTDS conf file there is a vairable 'text size' that I changed to: [global] text size = 4294967295 Here is the configuration files /etc/freetds/freetds.conf [global] tds version = 4.2 text size = 4294967295 [sqlserver] host = 192.168.0.3 port = 1433 tds version = 8.0 /etc/odbc.ini [sqlserverdatasource] Driver = freetds

Byte string too long PyPyOdbc

独自空忆成欢 提交于 2019-12-24 04:31:07
问题 Using FreeTDS and Python3.5 library PyPyodbc I am getting a 'Byte string too long' when trying to insert a row in the SQL Server database (residing on Windows). Under FreeTDS conf file there is a vairable 'text size' that I changed to: [global] text size = 4294967295 Here is the configuration files /etc/freetds/freetds.conf [global] tds version = 4.2 text size = 4294967295 [sqlserver] host = 192.168.0.3 port = 1433 tds version = 8.0 /etc/odbc.ini [sqlserverdatasource] Driver = freetds

Using Ubuntu, how do I install DBD::Sybase from CPAN?

孤街浪徒 提交于 2019-12-24 00:57:56
问题 Whenever I try to build DBD::Sybase to connect to MSSQL I get an error, $ sudo cpanp install DBD::Sybase Installing DBD::Sybase (1.15) Running [/usr/bin/perl /usr/bin/cpanp-run-perl /home/ecarroll/.cpanplus/5.14.2/build/DBD-Sybase-1.15/Makefile.PL INSTALLDIRS=site]... Can't find any Sybase libraries in /etc/lib or /etc/lib64 at /home/ecarroll/.cpanplus/5.14.2/build/DBD-Sybase-1.15/Makefile.PL line 155, <IN> line 44. BEGIN failed--compilation aborted at /usr/bin/cpanp-run-perl line 11, <IN>

Python - Can't open lib 'libtdsodbc.so' : file not found

心已入冬 提交于 2019-12-23 12:52:38
问题 Any help with this issue is much appreciated. Goal: Connect Django to MSSQL server using FreeTDS. I'm using a Debian x64 box. Problem: When trying to make a connection I get the following. ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'libtdsodbc.so' : file not found (0) (SQLDriverConnect)") My /etc/odbcinst.ini is configured as followed [FreeTDS] Description = FreeTDS driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so The

“Invalid parameter type” (numpy.int64) when inserting rows with executemany()

北城以北 提交于 2019-12-23 07:43:26
问题 I try to insert bunch of data to database insert_list = [(1,1,1,1,1,1),(2,2,2,2,2,2),(3,3,3,3,3,3),....] #up to 10000 tuples in this list conn = pyodbc.connect('DRIVER={FreeTDS};SERVER=xxxxx;DATABASE=xxxx;UID=xx;PWD=xx;TDS_Version=7.0') cursor = conn.cursor() sql = "insert into ScanEMAxEMAHistoryDay(SecurityNumber, EMA1, EMA2, CrossType, DayCross, IsLocalMinMax) values (?, ?, ?, ?, ?, ?)" cursor.executemany(sql, insert_list) cursor.executemany(sql, insert_list) pyodbc.ProgrammingError: (

RODBC ERROR: Could not SQLExecDirect 'CREATE TABLE … when doing sqlSave

橙三吉。 提交于 2019-12-23 04:34:27
问题 Here is the short story, and it is important to talk about the setup, I’m using RODBC and FreeTDS to connect to the SQL Azure database. Remember it is SQL Azure database (also happen to be issue for on premise SQL Server, that alarm me to post it here to ask for help or understand the real issue). First, it does not play nice with the database without a cluster key, or a key, so what need to do is addPK = T or longer version addPK = TRUE Solution #1. two steps approach This will help create

How can I use SQL Server Table Views as Rails Models (Read Only)?

假如想象 提交于 2019-12-22 11:33:44
问题 I'm using SQL Server as my database for my Rails project. I'm trying to create some models to use for a 3rd party database and only want to read from this database. So I made a view of the table I wanted to create an object for and then I wanted to point my active record model to it. However, in rails console I don't get back expected results. The only example that gives back some correct information is when I do a count on the object as shown in Example 3 below. I'm using the following gems

Cannot connect to mssql db using pymssql

两盒软妹~` 提交于 2019-12-22 10:56:09
问题 I have FreeTDS installed and configured correctly. My freetds.conf file as this appended to the end: [myserver] host = myserver port = 1433 tds version = 7.0 And I can running the following command gives me a SQL prompt: tsql -S myserver -U username My python script is extremely minimal, in an attempt to successfully connect to the database: #! /path/to/python/bins import pymsql conn = pymssql.connect(host='myserver', user='username', password='password', database='database', as_dict=True)