Windows 7 remote ODBC connection to Sybase 11 - sql

I'm using windows7 32bit, and connection to remote sybase databse using odbc
the connection goes fine, but when I'm retrieving arabic data I get unreadable characters
Any suggestion please.

By "Sybase 11", are you talking about Sybase SQL Anywhere 11? AFAIK, Sybase ASE doesn't have a version 11 so I'm guessing here.
Make sure the character set you are using to connect to the database matches the character set the data is stored in. Try select db_property('charset'), which will tell you the character set. Then disconnect and reconnect using the charset connection parameter, documented here.

Related

SCADA reading from MariaDB: Error in Syntax

We have a SCADA System (Intouch). It had a Access .mdb database file on the client PC, which was defined as System DSN (Windows ODBC).
What I'm trying to do is to migrate the whole DB thing to MariaDB, running on remote server. I have already a running server, the connection from the SCADA PC to the server is up an running and it is added as system DSN in ODBC, using the MariaDB ODBC connector. I was also able to export all the data from Access to the Maria database, using Access's native export to ODBC database, so all my data is in Maria.
The Problem: The SCADA cannot read ot white anythig. In the scada's log i get SQL Syntax errors (forgot to mention, that the scada uses SQL). Thanks in advance!
Update:
It's old fashioned WindowMaker application, not Archestra, thus the SQL Functions are used. I've even changed the ODBC connector from Maria to mySQL
Today I've made some logs. Here the error:
"SELECT Checksum, (rest deletet by me.. is too long).... FROM Stp WHERE ProgNr=1and StpNr=0"
[37000] [MySQL][ODBC 8.0(a) Driver][mysqld-5.5.5-10.3.22-MariaDB]
You have an error in your SQL syntax; check the manual that corresponds
to your MariaDB server version for the right syntax to use near 'StpNr=0' at line 1 (1064)
From the review of your update it looks like its just a plain ol' syntax error.
What you provided:
SELECT Checksum, (etc)... FROM Stp WHERE ProgNr=1and StpNr=0
The logs complain of syntax by StpNr=0 but your problem is immediately before that where you haven't put a space between the AND and the ProgNr=1 command.
Correct syntax would be:
SELECT Checksum, (etc)... FROM Stp WHERE ProgNr=1 and StpNr=0
In my personal experience the WindowMaker SQL functions are extremely clunky to work with (especially with the 131 char limit on message tags). You can usually help yourself out by Logging your Query then trying it directly in your database.

Excel-VBA to SQLite3 through ODBC Driver: primary database + attached database

I'm trying to connect from Excel-VBA to SQLite3 database through ODBC (Windows 10 x64).
I use Christian Werner's SQLite ODBC driver v 0.9999 (http://www.ch-werner.de/sqliteodbc) - as manual says I've installed both install both 32 and 64Bit versions of the driver.
Connecting to one database is ok:
ConnectionString = "DRIVER=SQLite3 ODBC Driver;Database=c:\first.db;"
Connecting to 2 databases (SQLite provides ability to connect to primary database + attached database) is also ok:
ConnectionString = "DRIVER=SQLite3 ODBC Driver;Database=c:\first.db;Attach=c:\second.db;"
but looks like VBA don't see tables from attached database - the following query fails:
SELECT * FROM [second].[table_name_in_second_db];
Does that SQLite ODBC driver supports attach database in connection string?
Or maybe I use incorrect syntax?
You don't handle attachments thru the connection. The primary database is handled in the connection properties. Once you have a valid connection you're essentially using sqlite engine. (the driver is a wrapper for sqlite.dll) Therefore you can attach databases as sql statements.
cn.execute "attach database 'C:\filename.db' as db"

Configuration file in Netezza

Is there a configuration file in Netezza like tnsnames.ora in Oracle which contains database names and their connect string names?
If so, what is the default location of the file?
I'm using Informatica PowerCenter to load to target Netezza table. I want to know the Database details of the connect string Informatica uses to connect with Netezza DB. In Oracle, I could have got the informatica from tns file.
Netezza doesn't have an equivalent to Oracle TNSNames.
ODBC Connection String Example:
Driver={NetezzaSQL};servername=myServerAddress;port=myPortNumber;
database=myDataBase;username=myUsername;password=myPassword;
ODBC ConnectionStrings.com
ODBC Configuration IBM
JDBC Configuration IBM
You can check the dsn entry (connect string name in Informatica connection) in the odbc.ini file in the LD_LIBRARY_PATH which is defined at the time of Netezza ODBC driver installation
In PowerCenter, a developer can check the connection details only if a dedicated connector is used. For ODBC, the only information available in Workflow Manager is the name of ODBC. The details can be checked in ODBC definition on the server.
A small addition to #Marciejg:
We have only a few odbc connections compared to powercenter connections. Each odbc points to the ‘system’ database and in the powercenter connection pointing to a specific database on that server, we run a ‘set current_catalog PROD_EDW’ in the pre sql. That way things are mostly visible and manageable in powercenter, and the odbc only points to the server.
And slightly off topic: the pre sql has additional ‘set CLIENT_*_NAME’ statements that enters the powercenter workflow/session etc dynamically based on powercenter build in variables (they are named $PMWorkflowname and similar)
That way we can trace back to the powercenter code immediately from a planfile, the pg.log or most interestingly, the HISTDB
Follow these links if you want to play with it:
- https://www.ibm.com/support/knowledgecenter/SSULQD_7.2.1/com.ibm.nz.dbu.doc/r_dbuser_set.html
and
http://dwhlaureate.blogspot.dk/2012/09/built-in-variables-in-informatica.html

Error using Sybase IQ proxy table

I have a use case that requires me to make a join on a table t1 from Sybase ASE and table t2 from Sybase IQ . I am trying to achieve this by creating a proxy_table on Sybase IQ as follows:
create server SYB1 class 'ASAODBC' using
Driver=libsyb64.so;Server=hostname;Port=portnum;PacketSize=16384;
EnableServerPacketSize=0'
(I even tried above with 'ASEODBC' and 'ODBC' classes)
create external login XYZ to SYB1 remote login 'SYBASEASEusername'
identified by SYBASEASEpwd'
create existing table 'proxy_table_name' at 'SYB1.dbname.owner.tablename'
On firing above sqls I get:
[Sybase][ODBC Driver][Sybase IQ] Unable to connect to 'SYB1': [Sybase][ODBC Driver]
[SQL Anywhere] Unable to connect ; server definition is circular
I have entry for the above mentioned Sybase ASE host in interfaces file and I tried to create the server by specifying the server name itself but it failed nevertheless.
Any help appreciated.
That error occurs when you attempt to connect to a remote server that maps to the local database. That's not possible in Sybase IQ. Check if the ODBC is pointing to the correct server (in your case should be the ASE server).
Your proxy server is using class 'ASAODBC' but since you're connecting to an ASE server, it should be 'ASEODBC'. As aF. said, you also need to make sure your connection string is pointing at the ASE server, not the IQ server.
Full disclosure: I work for SAP in SAP SQL Anywhere engineering. SQL Anywhere is the execution engine for SAP IQ (formerly Sybase IQ).

VBSCRIPT connection to Oracle failing due to driver

I am using a vbscript which connects to SQL.
My connection String look like
connectionString = "DRIVER={Microsoft ODBC for Oracle};SERVER=convcsd;User Id=sysman;Password=csaadmin;"
Set connection = CreateObject("ADODB.Connection")
It is working on one server but not on another. it gives an error :
The oracle(tm) and networking components were not found. These
components are supplied by oracle corporation..
You will be unable to use this driver until these components have been
installed.
Please let me know how to add ODBC driver. I researched but not able to get through.
SQL Plus is an Oracle client yes but that is not enough to be able to use your script. You need an ODBC driver and prefable an OleDb driver (is faster) for Oracle on each pc you're going to use your script.
Compare the ODBC drivers between two 2 pc's with the Microsoft ODBC administrator (type ODBC in your startmenu searchwindow) and you will notice the difference. Use your Oracle installpackage and check the option to install the OleDb driver.
There is a Microsoft and an Oracle version, again it is best to use the Oracle driver. The connection string for Oracle OleDb is
Provider=OraOLEDB.Oracle;User ID=<user name>;Password=<password>;Data Source=<data source>