odbc

pandas + pyodbc ODBC SQL type -150 is not yet supported

我怕爱的太早我们不能终老 提交于 2019-12-10 17:51:30
问题 I know there is many topics on this but i think this is much specific. I get the current code for audit purpose: import pandas as pd import pyodbc query = """ --Top 50 high total CPU Queries SELECT TOP 50 'High CPU Queries' as Type, serverproperty('machinename') as 'Server Name', isnull(serverproperty('instancename'),serverproperty('machinename')) as 'Instance Name', COALESCE(DB_NAME(qt.dbid), DB_NAME(CAST(pa.value as int)), 'Resource') AS DBNAME, qs.execution_count as [Execution Count], qs

Microsoft Hive ODBC driver 2.1.5 timeout

牧云@^-^@ 提交于 2019-12-10 17:25:00
问题 I recently upgrade to the Microsoft hive odbc driver version 2.01.05.1006, released 12/8/2016. My code was working with the previous version (1.0) of the driver. Now when running my code I keep getting the following error. ERROR [HY000] [Microsoft][Hardy] (72) Query execution timeout expired. I have tried changing the timeout settings for the ODBC driver, but it still times out. Does anybody have any other suggestions? 来源: https://stackoverflow.com/questions/41148927/microsoft-hive-odbc

Is it possible to specify the driver dll directly in the ODBC connection string?

梦想的初衷 提交于 2019-12-10 17:02:41
问题 I'm trying to use pyodbc to connect to a SQL Server (MS SQL Server through FreeTDS) in a portable application; since it's supposed to be standalone, I would like to avoid having to explicitly install the driver on the system, just bringing the ODBC driver dll along the application. This page suggests that it's possible to specify the driver dll directly in the connection string Specify the DRIVER= parameter in the szConnStrIn argument to the SQLDriverConnect function. For example: szConnStrIn

Issue with returning Cyrillic symbols from MSSQL via unixODBC and FreeTDS

扶醉桌前 提交于 2019-12-10 16:18:13
问题 I'm using django-pyodbc as database backend on Ubuntu 12.04 LTS and MSSQL 2008 on remote host. It works good except of returning Cyrillic symbols. Instead of them I see question marks - '?'. I have begin investigation what could cause this problem. As far as I understand MSSQL-django chain looks so: MSSQL <-> FreeTDS <-> unixODBC <-> pyodbc <-> django-pyodbc So I have started from FreeTDS. When I run query in tsql - it works good I can see all symbols including Cyrillic. The next one was isql

Looking for one liner example how to bind and insert a null value into a database using ODBC API

别来无恙 提交于 2019-12-10 16:01:13
问题 The function is SQLRETURN SQLBindParameter( SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT InputOutputType, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN ColumnSize, SQLSMALLINT DecimalDigits, SQLPOINTER ParameterValuePtr, SQLLEN BufferLength, SQLLEN * StrLen_or_IndPtr); The documentations I have seen is confusing. Do the srguments depend on the data type or not I found an example here http://support.microsoft.com/kb/248799 which does not seem to work on DB2.

“Scaling of decimal value resulted in data truncation” via ODBC

有些话、适合烂在心里 提交于 2019-12-10 15:55:21
问题 I'm receiving an error of "Scaling of decimal value resulted in data truncation" when simply trying to view an ODBC table in MS Access. I know the field that is returning the error, and Access is able to recognize the field when querying off of it, but I'm not able to view the results ( #Error records) and the error keeps kicking back. I've tried CDbl() with no luck. A Nz() doesn't even allow the query to run. The source database is Oracle, connected via Database Client 11g Release 2 for

Pervasive ODBC on Linux Error [01000][unixODBC][Driver Manager]Can't open lib '/usr/local/psql/lib/odbcci.so' : file not found

自作多情 提交于 2019-12-10 15:26:15
问题 I'm attempting to get Pervasive v10 client ODBC working on Centos 6. As I've learned, there is no 64 bit ODBC client so I have to use the 32 bit one. I've finally gotten it to install without error but attempting usage gives the following: # isql -v mydsn [01000][unixODBC][Driver Manager]Can't open lib '/usr/local/psql/lib/odbcci.so' : file not found [ISQL]ERROR: Could not SQLConnect ldd shows this: # ldd /usr/local/psql/lib/odbcci.so linux-gate.so.1 => (0x007d3000) libpscore.so.3 => /usr

Running MSSQL Stored Procedures via ODBC (And getting the results back) with PHP

假如想象 提交于 2019-12-10 14:55:21
问题 My work is in the process of moving all of our PHP web applications off of our Windows production web server to a new Linux server environment specifically for PHP apps. The sticky part is, several of the PHP applications we're running are using MSSQL databases, and therefore all the DB connectivity has to be re-written to use unixODBC/FreeTDS since PHP on Linux doesn't support mssql_connect() and it's related functions. I've gotten the connectivity down and basic queries execute fine. The

How to sanitize ODBC database input?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 14:54:06
问题 I currently use MySql, but would prefer an ODBC solution to make it future proof. How do I sanitize user input before passing it to an ODBC database ? And, while I'm at it, I wrap my string in double quotes, e.g. "INSERT INTO VALUES(description) ""` - but what if the text itself contains a double quote? 回答1: Try using a parametrized SQL sentence like this. INSERT INTO MyTable (Field1,Field2) VALUES (:Param1,:Param2) check this article from embarcadero for more info about how use parameters

Setting an ODBC connection string in VBA

自闭症网瘾萝莉.ら 提交于 2019-12-10 14:52:22
问题 I have created a macro that sends a new CommandText to an ODBC Connection in my Excel spreadsheet and then refreshes the table of results associated with the query. This has been working fine, but I've noticed that each time I run the macro it overwrites the connection string with some default values that work on my machine but will not work on other users' machines because they do not have the saved connection file that I have. The more specific connection string that specifies a server