odbc

Automatic character encoding handling in Perl / DBI / DBD::ODBC

谁都会走 提交于 2019-12-07 07:58:45
问题 I'm using Perl with DBI / DBD::ODBC to retrieve data from an SQL Server database, and have some issues with character encoding. The database has a default collation of SQL_Latin1_General_CP1_CI_AS , so data in varchar columns is encoded in Microsoft's version of Latin-1, AKA windows-1252. There doesn't seem to be a way to handle this transparently in DBI/DBD::ODBC. I get data back still encoded as windows-1252 , for instance, € “ ” are encoded as bytes 0x80, 0x93 and 0x94. When I write those

Unable to append to SQL Server table using sqlSave in R

若如初见. 提交于 2019-12-07 05:32:20
问题 I am trying to update a SQL table using sqlSave function of RODBC package in R. Data is present in a data frame. When I try to run the command: sqlSave(DBConn, dat=df, verbose=T, tablename='table', append=T) I get the following error: Query: INSERT INTO "table" ( "col1", "col2", "col3", "col4" ) VALUES ( ?,?,?,?,? ) sqlwrite returned 42000 -131 [Sybase][ODBC Driver][Sybase IQ]Syntax error near 'table' on line 1 [RODBC] ERROR: Could not SQLPrepare 'INSERT INTO "table" ( "col1", "col2", "col3",

ODBC driver use in Qt

不想你离开。 提交于 2019-12-07 05:30:01
问题 I wanted to use read and write mdb file (Ms Access file) and I am completely new in using ODBC in Qt. So can anyone help me to know whether should i need to download the drivers and if yes then from where can i download ? and if you know about connectivity then any help would be appriciated. 回答1: If you need to access an MS Access database with Qt, you don't need (if I'm not mistaken) to install anything regarding drivers (everything should be already there). You can connect to a database

Still get error popup even when ApplyUpdates is inside try…except

倾然丶 夕夏残阳落幕 提交于 2019-12-07 05:25:30
问题 Solution found, see my comment below D5, odbc to mysql database This code: with QryCmdPerf do begin Close; ParamByName('ACCTID').AsInteger:= AcctId; ParamByName('FROMDT').AsString:= MySQLDate(FromDt); ParamByName('TODT').AsString:= MySQLDate(ToDt); Open; first; try edit; FieldByName('PnL').AsFloat:= 97979; ApplyUpdates; except close; end; end; // with (specifically the "ApplyUpdates") causes a popup to appear with the text "Update Failed" if the PnL field already has the value 97979,

Powershell to read from database using ODBC DSN instead of connection string

偶尔善良 提交于 2019-12-07 04:58:29
问题 I know how to read value from database using connectionstring, i.e. Establish database connection to read $conn = New-Object System.Data.SqlClient.SqlConnection $conn.ConnectionString = "Server=10.10.10.10;Initial Catalog=database_name;User Id=$username;Password=$password;" $SQL = "..." $conn.Open() # Create and execute the SQL Query $cmd = New-Object System.Data.SqlClient.SqlCommand($sql,$conn) $count=0 do{ try{ $rdr = $cmd.ExecuteReader() while ($rdr.read()){ $sql_output += ,@($rdr.GetValue

How to install DB2 ODBC or OLEDB Driver

北慕城南 提交于 2019-12-07 04:44:02
问题 I have already installed IBM DB2 Database Express on Windows 7 Pro. Now, I would like to create my C# code in order to select/insert/update records in DB2 tables. I spend the whole day searching over the internet for links on how to install either OLEDB or ODBC Driver in order to connect to DB2 database. But without success!!! So, i'm wondering if somebody can help me or send me a useful link to download driver. Thank you 回答1: Download: In the webpage: http://www-933.ibm.com/support

How to call stored procedure taking array using odbc:param_query in Erlang

一世执手 提交于 2019-12-07 04:27:34
问题 I have a stored procedure in db2 create type intArray as integer array[100]@ create or replace procedure sum(in numList intArray, out total integer) begin declare i, n integer; set n = CARDINALITY(numList); set i = 1; set total = 100; while (i <= n) do set total = total + numList[i]; set i = i + 1; end while; end@ I am trying to call through Erlang odbc:param_query. odbc:param_query(Ref, "CALL sum (?, ?)", [{sql_integer,[1]}, {sql_integer,out, [1]}]). The above is giving me proper return as

Insert binary data into SQL Server using PHP

跟風遠走 提交于 2019-12-07 03:46:18
问题 I have a varbinary(MAX) field in a SQL Server 2005 database. I'm trying to figure out how to insert binary data (ie. an image) into that field using PHP. I'm using ODBC for the connection to the SQL Server database. I have seen a number of examples that explain this for use with a MySql database but I have not been able to get it to work with SQL Server. Thanks. 回答1: The simple answer is: stop what you're doing. You don't want to store binary files inside a database unless you have some very

ODBC connection error:No such command “odbc show” ODBC connection fail in asterisk*CLI

笑着哭i 提交于 2019-12-07 02:42:33
Problems: I am using AsteriskNow which running asterisk 2.0 server in VirtualBox. And i want to connect Asterisk with MySQL databases using ODBC modules. But it fails. When i started with asterisk*CLI> odbc show The command prompt shows that "No such command ODBC SHOW" My Objectives: configure ODBC in asterisk to access MySQL from Asterisk's dialplan directly and dynamically. What i did: I installed my AsteriskNow in VirtualBox. The version of asterisk is 2.0, the CentOS version 5.8 final. I firstly installed related Linux RPMs by yum -y install unixODBC-devel yum -y install libdbi-dbd-mysql

Passing table name as a parameter in pyodbc

半城伤御伤魂 提交于 2019-12-07 02:11:50
问题 I am trying to pass a table name in pyodbc as a parameter to access data from ms sql 2005. I've tried to substitute it with ? but it never works. I would be glad to receive any advice on how to accomplish this. 回答1: Since you are using pyodbc, I assume you are not calling a SPROC. I recommend building your SQL string in python and then passing it to SQL to execute. import pyodbc dbconn = pyodbc.connect(ConnectionString) c = dbconn.cursor() j = 'table1' #where table1 is entered, retreived, etc