odbc

How to get BLOB data using oracle ODBC

自闭症网瘾萝莉.ら 提交于 2019-12-25 04:27:46
问题 I'm trying to get image that are stored in BLOB and then save it as jpg. Here i retrieve the binary data and save it in str; string str; SQLCHAR buf[500] = {0}; while ((SQL_SUCCEEDED(SQLGetData(StmtHandle, colnum, SQL_C_BINARY, buf, sizeof(buf), NULL)))) { string data(reinterpret_cast< const char* >(buf), reinterpret_cast< const char* >(buf) + sizeof(buf)); str = str + data; } Then i write it in the file ofstream file; file.open("C:\\Users\\tom\\Desktop\\img.jpeg"); file << str; file.close();

Apache Ignite - [PDOException] SQLSTATE[IM002] SQLConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified

℡╲_俬逩灬. 提交于 2019-12-25 04:05:10
问题 I have setup apache ignite, loaded data into ignite from Java app and can query using rest apis. I need to query it from PHP so I am trying to connect to Apache Ignite from PHP using pdo_odbc. I have, i) Installed ODBC driver manager - http://www.unixodbc.org/ ii) Built ODBC driver http://apacheignite.gridgain.org/docs/odbc-driver#section-building-on-linux iii) installed Ignite ODBC driver http://apacheignite.gridgain.org/docs/odbc-driver#section-installing-on-linux, iv) configured dsn, http:

Connecting to local Database from remote web server

旧时模样 提交于 2019-12-25 04:02:06
问题 I am trying to connect to my local Database from the webserver but i get Fatal error: Call to undefined function odbc_connect() in -/-/-/7001238/web/s/sage2.php on line 15" Any help on how to fix issue. Here is the code i used to connect. $odbc['dsn'] = "Sage50"; $odbc['user'] = "Peach"; $odbc['pass'] = "XXXX"; $mysql['host'] = "localhost"; $mysql['user'] = "root"; $mysql['pass'] = ""; $mysql['dbname'] = "sagetest"; $mysql['idfield'] = "id"; $debug=true; // Step 1: Connect to the source ODBC

Cannot write to MS SQL database using PHP ODBC connection

北战南征 提交于 2019-12-25 03:30:48
问题 Problem: I can successfully use a select query in PHP using odbc_exec, however, I can not execute an INSERT INTO or UPDATE query. Resources: Windows Server 2003: IIS 6, SQL Server 2005. Here is my code: <?php require('../_DSN/DSN_M.php'); $cnnOra = odbc_connect($strarrDSN['dsn'], $strarrDSN['username'], $strarrDSN['pswd']); $res_slct = odbc_exec($cnnOra, " select * FROM person;") or die (odbc_errormsg()); odbc_result_all($res_sldr); $sqlupd = "UPDATE person SET person_ame='Steve Woz' WHERE pk

Changing connection string in Excel messes up column data types

喜夏-厌秋 提交于 2019-12-25 03:02:21
问题 This is related to my previous question. I'm trying, in Excel, to update external data connections to text files (used by several pivot tables) to point to the correct data sources so data can be refreshed when the Excel workbook and text files are copied to a different directory/computer. (It should act like the paths to the text files are relative.) The data sources are tab delimited text files with the headers in the first columns. I have code that can change the path in the ODBC

Need help linking oracle tables in MS Access

北慕城南 提交于 2019-12-25 02:46:12
问题 I am having some issues connection to an oracle DB using MS Access. If I use SQL Developer to connect to the Oracle DB I see pretty much every table and view in the DB however when I connect using MS Access I only get a selected few. I tough it was because the user didn't have Select privileges on the tables I need so I requested the privilege and after a moth of waiting I finally got it but I still cant see the tables on the Access tool. This is what I see on SQL Developer vs MS access. I

Reccomended method of connecting to an SAP HANA tenant database

百般思念 提交于 2019-12-25 02:28:55
问题 I'm connecting to a SAP HANA tenant database. As I understand it, there are two ways to do this: first, I can specify <server hostname>:<tenant db sql port> for the SERVERNODE connection property. Second, I can specify <server hostname>:<system db sql port> for SERVERNODE and also include the DATABASE connection property set to <tenant db name> . It's recommended to use the second method because it makes operations like moving tenant dbs (i.e. changing sql ports) easier (see "SAP HANA

Loading files into Teradata

穿精又带淫゛_ 提交于 2019-12-25 02:23:08
问题 Daily, I currently have to: download 50 files, 40 are in .csv (comma separated values) format, and 10 in .txt. In each of the .csv files, there are 5 columns (call them B, A, D, C, E), and a differernt 5 columns in the .txt files (call them G, H, I, J, K). I then have to manually open in Excel and rearange the .csv columns into (A, B, C, D, E) for each of the 40 files. The .txt file are already in the required format. I then load these all into 15 teradata tables, using BTEQ on unix There are

How do I access nested SQL tables in R?

戏子无情 提交于 2019-12-25 01:49:18
问题 From R Studio's ODBC database documentation I can see a simple example of how to read a SQL table into an R data frame: data <- dbReadTable(con, "flights") Let me paste a graphic of the BGBUref table(?) I'm trying to read to an R data frame. This is from my connection pane in R studio. If I use the same syntax as above, where con is the output of my dbConnect(...) I get the following: df <- dbReadTable(con, "BGBURef") #> Error: <SQL> 'SELECT * FROM "BGBURef"' nanodbc/nanodbc.cpp:1587: 42S02:

How do I encode Unicode strings using pyodbc to save to a SAS dataset?

我与影子孤独终老i 提交于 2019-12-25 01:42:44
问题 I'm using Python to read and write SAS datasets, using pyodbc and the SAS ODBC drivers. I can load the data perfectly well, but when I save the data, using something like: cursor.execute('insert into dataset.test VALUES (?)', u'testing') ... I get a pyodbc.Error: ('HY004', '[HY004] [Microsoft][ODBC Driver Manager] SQL data type out of range (0) (SQLBindParameter)') error. The problem seems to be the fact I'm passing a unicode string; what do I need to do to handle this? 回答1: Do you know what