12 Oct 2015 08:21 PM |
|
I am using IDL8.4 with DataMiner on Linux Debian Wheezy. I tried to connect my IDL to PostgreSQL 9.4 but encountered following errors:
IDL> objdb = OBJ_NEW('IDLdbDatabase')
% Loaded DLM: DATAMINER.
IDL> sources = objdb->GetDatasources()
IDL> sources
[
{
"DATASOURCE": "DB2WireProtocol",
"DESCRIPTION": "DataDirect7.1DB2WireProtocol"
},
{
"DATASOURCE": "SybaseWireProtocol",
"DESCRIPTION": "DataDirect7.1SybaseWireProtocol"
},
{
"DATASOURCE": "OracleWireProtocol",
"DESCRIPTION": "DataDirect7.1OracleWireProtocol"
},
{
"DATASOURCE": "MySQLWireProtocol",
"DESCRIPTION": "DataDirect7.1MySQLWireProtocol"
},
{
"DATASOURCE": "InformixWireProtocol",
"DESCRIPTION": "DataDirect7.1InformixWireProtocol"
},
{
"DATASOURCE": "PostgreSQLWireProtocol",
"DESCRIPTION": "DataDirect7.1PostgreSQLWireProtocol"
},
{
"DATASOURCE": "SQLServerWireProtocol",
"DESCRIPTION": "DataDirect7.1SQLServerWireProtocol"
}
]
IDL> mysrc = sources[5].datasource
IDL> objdb->connect, datasource = mysrc
% IDLDBDATABASE::CONNECT: ODBC [Exelis VIS][ODBC PostgreSQL Wire Protocol driver]Insufficient information to connect to the data source.
% Execution halted at: $MAIN$
IDL>
How to solve this problem or get more detail information on this?
Regards,
|
|
|
|
Deleted User New Member
Posts:32  
12 Nov 2015 09:48 PM |
|
<p>Still has no solution! Anyone has experience in using IDL with PostgreSQL?</p>
|
|
|
|
Zachary Norman Basic Member
Posts:173  
13 Nov 2015 09:01 AM |
|
<p>Hello Huang,</p>
<p><br />
</p>
<p>First, try this simple check to see if you have an ODBC driver installed:</p>
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<p>status = DB_EXISTS() ; confirms that you have an ODBC Driver<br />
HELP, status ; a '1' indicates success</p>
</blockquote>
<p>See if problem persists when IDLdbDatabase's USE_CURSOR_LIB property is set to 1. This is set to 0 by default. Setting it to 1 changes some of the algorithms that IDL (or the ODBC driver) uses to retrieve data. See if running the following command before you run your "oDB->Connect" call:</p>
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<p> oDB->SetProperty, USE_CURSOR_LIB=1, VERBOSE=1</p>
</blockquote>
<p>It may also be useful to see what ODBC drivers are available for use with Datminer in case you are using an unsupported driver. Here is how you can figure out the drivers that you have available:
</p>
<p>
<pre style="outline: 0px; font-family: 'Lucida Console', monospace; color: #53565a; font-size: 13px; line-height: 16.25px; background-color: #ffffff;"> objDB = OBJ_NEW('IDLdbDatabase')<br style="outline: 0px; margin: 0px; height: 1px; padding: 0px;" /> objDB->SetProperty, /verbose<br style="outline: 0px; margin: 0px; height: 1px; padding: 0px;" /> sources = objDB->GetDatasources()<br style="outline: 0px; margin: 0px; height: 1px; padding: 0px;" /> print,sources</pre>
</p>
<p>-Zach (VIS)</p>
|
|
|
|
Deleted User New Member
Posts:32  
15 Nov 2015 10:08 PM |
|
<p>Thanks Zach for helping. Following are the results:</p>
<p>1. Confirm ODBC driver installed: it looks the ODBC driver does installed</p>
<p><strong><span style="font-family: 'Courier New';">IDL> status = DB_EXISTS()<br />
IDL> help, status<br />
STATUS INT = 1</span></strong></p>
<p>2. Checking database drivers results are as following, it looks the drivers are alright:</p>
<p><strong><span style="font-family: 'Courier New';">IDL> objdb = OBJ_NEW('IDLdbDatabase')<br />
IDL> sources = objdb->GetDatasources()<br />
IDL> print, source<br />
{ DB2 Wire Protocol DataDirect 7.1 DB2 Wire Protocol}<br />
{ Sybase Wire Protocol DataDirect 7.1 Sybase Wire Protocol}<br />
{Oracle Wire Protocol DataDirect 7.1 Oracle Wire Protocol}<br />
{ MySQL Wire Protocol DataDirect 7.1 MySQL Wire Protocol}<br />
{Informix Wire Protocol DataDirect 7.1 Informix Wire Protocol}<br />
{ PostgreSQL Wire Protocol DataDirect 7.1 PostgreSQL Wire Protocol}<br />
{ SQLServer Wire Protocol DataDirect 7.1 SQL Server Wire Protocol}</span></strong></p>
<p>3. connect to database after setting the USE_CURSOR_LIB property </p>
<p><span style="font-family: 'Courier New';"><strong>IDL> objdb->SetProperty, USE_CURSOR_LIB=1, VERBOSE=1<br />
IDL> objdb->connect, datasource = sources[5].datasource<br />
<span style="color: #953734;">% IDLDBDATABASE::CONNECT: ODBC SQL Function=SQLDriverConnect,STATE=S1000,CODE=0, [Exelis VIS][ODBC PostgreSQL Wire Protocol driver]Insufficient information to connect to the data source.</span><br />
% Execution halted at: $MAIN$ </strong></span></p>
<p>Still NOT able to connect :(</p>
<p><br />
</p>
|
|
|
|
Zachary Norman Basic Member
Posts:173  
18 Nov 2015 12:25 PM |
|
<p>Hello Huang,</p>
<p><br />
</p>
<p>It looks like the problem may be because your driver is unsupported. To determine this I took a look in the help contents for DataDirect (this is an optional item to install and it you would like the help files then you will need to reinstall IDL 8.4.1). The supported PostreSQL drivers are: 8.2, 8.3, 8.4, 9.0, and 9.1. It does not look like PostgreSQL 9.4 is on the list for either 32 bit or 64 bit drivers. In order to check this yourself, if you have the DataDirect help contents installed, go to the main IDL directory (default for linux is /usr/local/exelis/idl84) and then: help->DataDirect64->help.htm. Once that is open in your browser, navigate through the tabs on the left to: User's Guide->"9 The PostgreSQL Wire Protocol Driver" and the supported drivers are shown near the top of the page.</p>
<p><br />
</p>
<p>-Zach (VIS)</p>
|
|
|
|