odbc

Python with MS SQL - truncated output

十年热恋 提交于 2019-12-01 19:49:26
I try to connect to MSSQL DB with python from Linux box ( Python 2.7 , Ubuntu 11.04 ) . Output that I receive is truncated to 500 characters. Please, see script and configs below. How it could be resolved? The problem I suppose in ODBC driver or near it. The code (pyodbc, pymssql): conn = pymssql.connect(host='my_remote_host', user='ro_user', password='password', database='current', as_dict=True) cur = conn.cursor() cur.execute(sql) for i in cur: print i conn.close() cnxn = pyodbc.connect(driver='FreeTDS', server='my_remote_host', database='current', uid='ro_user', pwd='password') cursor =

SSIS ODBC SQL parameters

不羁岁月 提交于 2019-12-01 19:46:36
问题 I've got a SQL command in an odbc source data flow task that needs to take parameters, but the option to add them isn't there. I tried to add the database as an ADO.NET connection with an ODBC provider, but there were also no parameters available. Also tried it as an OLEDB connection, but there's no provider available for ODBC. The variables needed are set, I just can't add them as parameters. So the main thing I'm wondering are: Is if there's a way to add parameters to a SQL command in an

Unable to connect Access to SQLlite via ODBC

懵懂的女人 提交于 2019-12-01 18:55:35
I have an Access 97 database that serves as a front-end, via ODBC and linked tables, to a MySQL database, running under Wiin7-64. (Yes, it does work!) The database contains info about places of worship and pilgrimage in the part of France where I live. In addition, I have tens of thousands of photos of the sites in Photoshop Elements 9. The underlying database engine of PSE9 is SQLite, and interesting data about the photos is there (titles, which ones I like, etc.). I would like to link from Access to the tables in the SQLite database as I do to the MySQL database. My problem: I am unable to

Inserting Unicode characters with PHP -> ODBC -> MS SQL?

落爺英雄遲暮 提交于 2019-12-01 18:49:55
I have the following code: $sql = "update tbl_test set category = N'resumé'; echo $sql; $rs=odbc_exec($conn,$sql); Where $conn is a DSN ODBC connection to an MSSQL Server. The problem seems to be that somewhere between PHP and MySQL (Maybe ODBC?) unicode characters are converted to junk. If I copy paste exactly what the echo says directly into Enterprise Manager, it inserts into MS SQL fine. If I run the code however, it always goes into MSSSQL as resumé . Any idea what I'm missing here? The problem was not ODBC, but PHP... solution was to use utf8_decode() on the strings returned from the

pdo-odbc doesn't work whit bind values, nvarchar and text are incompatible in the equal to operator

你。 提交于 2019-12-01 18:33:29
问题 There is a column url(nvarchar(200), not null) <?php // $pdo = new PDO('odbc:mssql', 'xxx', 'yyy'); $pdo->setAttribute(PDO::ATTR_PERSISTENT, false); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); // plain sql query: WORKS FINE! $sth = $pdo->prepare("SELECT COUNT(*) FROM pagina WHERE url = '/webito'"); $sth->execute(); // using bindValue: ERROR! $sth = $pdo->prepare("SELECT COUNT(*) FROM pagina WHERE url = :unique_value"); $sth->execute(array('unique_value' => '/webito'));

Inserting Unicode characters with PHP -> ODBC -> MS SQL?

徘徊边缘 提交于 2019-12-01 18:07:32
问题 I have the following code: $sql = "update tbl_test set category = N'resumé'; echo $sql; $rs=odbc_exec($conn,$sql); Where $conn is a DSN ODBC connection to an MSSQL Server. The problem seems to be that somewhere between PHP and MySQL (Maybe ODBC?) unicode characters are converted to junk. If I copy paste exactly what the echo says directly into Enterprise Manager, it inserts into MS SQL fine. If I run the code however, it always goes into MSSSQL as resumé . Any idea what I'm missing here? 回答1

SSIS ODBC SQL parameters

旧时模样 提交于 2019-12-01 18:07:20
I've got a SQL command in an odbc source data flow task that needs to take parameters, but the option to add them isn't there. I tried to add the database as an ADO.NET connection with an ODBC provider, but there were also no parameters available. Also tried it as an OLEDB connection, but there's no provider available for ODBC. The variables needed are set, I just can't add them as parameters. So the main thing I'm wondering are: Is if there's a way to add parameters to a SQL command in an ODBC source Is there an OLEDB provider for ODBC I can use? Can I access the package variables directly in

pdo-odbc doesn't work whit bind values, nvarchar and text are incompatible in the equal to operator

ぐ巨炮叔叔 提交于 2019-12-01 18:03:16
There is a column url(nvarchar(200), not null) <?php // $pdo = new PDO('odbc:mssql', 'xxx', 'yyy'); $pdo->setAttribute(PDO::ATTR_PERSISTENT, false); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); // plain sql query: WORKS FINE! $sth = $pdo->prepare("SELECT COUNT(*) FROM pagina WHERE url = '/webito'"); $sth->execute(); // using bindValue: ERROR! $sth = $pdo->prepare("SELECT COUNT(*) FROM pagina WHERE url = :unique_value"); $sth->execute(array('unique_value' => '/webito')); Returning error: Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 402

SQLGetPrivateProfileString failed with

旧时模样 提交于 2019-12-01 17:29:22
问题 Typing the command: odbcinst -q -s on RHEL 6, I get the following error message: odbcinst: SQLGetPrivateProfileString failed with . All my DSN's are also not showing up when I run: odbcinst -q -d 回答1: Type the command: env |grep 'ODBC' to check if the ODBCSYSINI and the ODBCINI variables are set. If no results are returned - you need to add the variables to the environment variable pointing to the directory and the path to where the odbc.ini file is located as follows (in my case for RHEL 6

Parameterized DB2 Query From .NET

回眸只為那壹抹淺笑 提交于 2019-12-01 17:28:25
I am attempting to run a parameterized query against a DB2 database from .NET using the Client Access ODBC Driver using the following code: var db2Cmd = new OdbcCommand("INSERT INTO presnlats (LAT) VALUES (@LAT)", db2Conn); db2Cmd.Parameters.AddWithValue("@LAT", insertValue); Console.Out.WriteLine(db2Cmd.ExecuteNonQuery()); When executed, an OdbcException is thrown: ERROR [42S22] [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0206 - Column @LAT not in specified tables. The internets seem to imply that parameterized queries are supported by the client access ODBC driver, but this error seems to