Search Postgresql Archives

Re: Problems with PostgreSQL DBI-Link / DBD-ODBC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi David,

I'm sorry to bother you again, but I still couldn't get it to work. Like you suggested, I checked for successfully installed schemas. There was one, which I deleted again because I don't know which of my countless tries to create it was the successful one. I think the following code should be alright, however when executing it, I receive the following error message: "ERROR: error from Perl function: error from Perl function: DBD::ODBC::db column_info failed: [Microsoft][ODBC SQL Server Driver]Die Verbindung ist mit Ergebnissen von einem anderen hstmt belegt (SQL-HY000)(DBD: odbc_columns/SQLColumns err=-1) at line 66. at line 53.
SQL state: XX000"

"Die Verbindung ist mit Ergebnissen von einem anderen hstmt belegt" is German and means "The connection is occupied/reserved with results from another hstmt". I'm desperately trying to solve it, but have no idea where to start.

SELECT dbi_link.make_accessor_functions(
    'dbi:ODBC:test'::dbi_link.data_source,
    'sa'::text,
    ''::text,
    '---
AutoCommit: 1
RaiseError: 1
'::dbi_link.yaml,
    NULL::dbi_link.yaml,
    NULL::text,
    NULL::text,
    'test'::text
);

Hope you can help me one more time. Thanks.

Regards,

Pit


On Tue, Oct 30, 2007 at 01:12:41PM +0100, Pit M. wrote:
Hi David!

Thanks for the fast reply. So you mean that I might already have
created a connection but am still trying to create the same one
again?

Yes.

Check whether the existing one works :)
So how can I test it?

Fire up psql and do:

SELECT
    data_source_id,
    local_schema,
    data_source
FROM
    dbi_link.dbi_conection;

This gives you schemas you have created successfully.  You can then
check what's in schema foo by doing:

\dv foo.*

What is the correct way of accessing this data source in a select
statement?

Concerning the documents, I wouldn't say that they are unclear about
make_accessor_functions().  The problem is, that in the dbi-link
documents (quote: "Do the following, with the appropriate
parameters.  "Appropriate parameters" come from the perldoc of the
appropriate DBD...") and in the dbi-odbc documents I can't find any
information about the correct use of the parameters for the
ODBC-connection. That's why I tried to create the connection so many
times.

Ah, I see.  I don't have an example of dbd-odbc just yet, but you
should be able to write a very short perl program which connects to
your data source.

http://www.easysoft.com/developer/languages/perl/dbd_odbc_tutorial_part_1.html

Once you've verified that that's working, you can set up a new
connection.  The parameters you pass into $dbh coincide, not
coincidentally, with the first inputs to make_accessor_functions :)

Cheers,
David.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux