odbc

Using Microsoft Query and ODBC to SQL Server, complicated query

女生的网名这么多〃 提交于 2019-12-13 06:45:03
问题 I have a view in SQL Server that is somewhat similar to the following example. SELECT * FROM PEOPLE LEFT OUTER JOIN (SELECT ID FROM OTHER_TABLE WHERE SOME_FIELD = 'x' OR SOME_FIELD = 'y' OR SOME_FIELD = 'z') AS PEOPLE_TO_EXCLUDE ON PEOPLE.ID = PEOPLE_TO_EXCLUDE.ID WHERE PEOPLE_TO_EXCLUDE.ID IS null The hassle: I am perfectly capable of adding and modifying "OR SOME_FIELD = 'w'" countless numbers of times. However, I am making this view for a user to pull up in excel via ODBC. The user needs

How to get ODBC connection by name?

吃可爱长大的小学妹 提交于 2019-12-13 06:40:21
问题 Given a User DSN how do I create an ODBC connection to that data source in .Net 3.5? 回答1: Here is a tutorial describing the entire process. Basically, you do: OdbcConnection connection = new OdbcConnection("DSN=MyDataSourceName"); 来源: https://stackoverflow.com/questions/754302/how-to-get-odbc-connection-by-name

Tableau Linux server, does it not recognize the user ODBC settings

被刻印的时光 ゝ 提交于 2019-12-13 06:29:19
问题 Connecting data source via ODBC driver to the tableau server seem to not work at a user level. I have odbc.ini and obdcinst.ini files on the user home directory. $ODBCINI and $ODBCINSTINI Environment variables are set pointing to respective files.Tableau still fail to pick the data source. Workbook published from the desktop is rendered only on placing the odbc.ini and odbcinst.ini into /etc/ or tableau user directory ( /var/opt/tableau/tableau_server/ ). Although it fixes the issue, there

Try different odbc connect calls

不想你离开。 提交于 2019-12-13 06:25:54
问题 I would like to try to connect to a database (using odbc) where I necessarily don't know the exact password. That is, I have a couple of different alternatives what the password might be, and I want my code to figure out which one is right. How can I do this using PHP? 回答1: Just wrap the call to odbc_connect in a foreach loop trying all the passwords: function my_odbc_connect($dsn, $user, array $passwords) { foreach ($passwords as $password) { $connection = odbc_connect($dsn, $user, $password

Using odbc, are separate sql_query/2 invocations involving Select guaranteed ACID when followed by a commit

大城市里の小女人 提交于 2019-12-13 05:57:20
问题 I know that the ODBC library has a commit/2 and commit/3, but I'm not sure if I am interpreting its use correctly. If I do the following create a session with the {auto_commit, off} attribute and then do a series of separate sql_query/2 SELECT statements (not batched statements, but separate invocations of sql_query/2) followed by a commit/2 Are the selects all done within a single transaction guaranteeing ACID properties? 回答1: It seems that unixodbc-oracle driver is buggy, i.e. it doesn't

Run OSQL on systems which do not have Sql Server installed

血红的双手。 提交于 2019-12-13 05:19:33
问题 I have a batch file which runs an oSQL command (below). oSQL -U devUID -P testPwd -S testServer -d testDb -Q "EXEC [dbo].[sprocTEST]" When I run this batch file on systems which do not have sqlserver installed, it throws an error. "odbc driver manager data source name not found and no default driver specified osql" NOTE: Apart from the batch file I also copied - osql.exe , osql.rll Does any one know how to resolve the odbc driver error? Help much appreciated. 回答1: You don't have the rights to

Character Set issue using SQL Server and ODBC in php

馋奶兔 提交于 2019-12-13 04:56:52
问题 I connected to to sqlsever2008 with odbc(with dsn) and php but problem is that when I retrieve information from that it has character like ��������� . My datatype in sqlserver is nvarchar . Any idea why it is happening? NOTE: The page is utf8 . Edit: I use echo utf8_encode(odbc_result($this->result,'name') ); and characters are like: ÂãæÒÔ ÒÈÇäÂãæÒ i retrieve information like this: odbc_result($this->result,'name') 回答1: Try to use utf8_decode() or utf8_encode() . 回答2: It seems, the code page

How do I get an nvarchar from MS SQL as string using ODBC (C++)?

纵然是瞬间 提交于 2019-12-13 04:10:07
问题 I'm trying to extract a string from my SQL database, but for some reason my parameters are wrong and I'm not sure why. Here is my code: SQLHENV environHandle; SQLHDBC connectHandle; SQLHSTMT statement; SQLCHAR* connectString = "MY_CONNECTION_STRING"; string path; int jobID; SQLINTEGER pathstrlen = SQL_NTS; SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &environHandle); SQLSetEnvAttr(environHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER); SQLAllocHandle(SQL_HANDLE_DBC

ODBC connect to SQL Server 2016 with error Unknown data type -155

与世无争的帅哥 提交于 2019-12-13 04:09:44
问题 I've searched throughout the site and found the similar issue but with python not C#. Moreover, the workaround in that post (to avoid querying columns with DateTimeOffset datatype) did not help me since my application is slightly different. My MVC web application needs to list all tables in a SQL Server 2016 database dynamically. Then users can select 1 table from that list and display all columns and their values in a grid. I'm using ODBC with driver = {ODBC Driver 13 for SQL Server} to

Issues connecting R to HANA db with many special characters

大兔子大兔子 提交于 2019-12-13 03:47:29
问题 I am having issues with reading HANA data into R. I have established my connection via ch <- odbcConnect("HANA",uid="USER",pwd="PW") And confirmed I am connected via sqlTables(ch) which pulls up my list of tables. Filtering on my desired table I am trying to pull reveals the full name to be "ccf-edw.self-service.MDM::Q_CA_R_CUSTOMER_REPORTS" From other posts I have seen, there appear to be issues surrounding the periods. Attempting sqlQuery(ch, 'SELECT TOP 10 FROM "_SYS_BIC"."ccf-edw"."self