Re: Problems with PostgreSQL DBI-Link / DBD-ODBC
| От | Pit M. |
|---|---|
| Тема | Re: Problems with PostgreSQL DBI-Link / DBD-ODBC |
| Дата | |
| Msg-id | fg773l$v3d$1@news.hub.org обсуждение исходный текст |
| Ответ на | Re: Problems with PostgreSQL DBI-Link / DBD-ODBC (David Fetter <david@fetter.org>) |
| Ответы |
Re: Problems with PostgreSQL DBI-Link / DBD-ODBC
|
| Список | pgsql-general |
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? >>Check whether the existing one works :) So how can I test it? 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. Regards, Pit David Fetter wrote: > On Mon, Oct 29, 2007 at 03:44:05PM +0100, Pit M. wrote: >> I have the following problem with PostgreSQL and hope you guys can >> help me out in this matter: I try to get a remote connection to any >> database (e.g. MS-SQL or MS Access) using DBI-Link and DBD:ODBC. My >> problem is, that everything seems fine so far, however I don't know >> how to use the parameters for "make_accessor_functions()". I >> searched the net for it, but can only find samples for >> Perl-Scripting, but I need a sample for using it directly in SQL. >> >> This is what I've come up so far. Hope you can point me to the right >> direction. >> >> SELECT make_accessor_functions( >> 'dbi:ODBC:Northwind::dbi_link.data_source, >> 'sa'::text, >> NULL::text, >> '--- >> AutoCommit: 1 >> RaiseError: 1 >> '::dbi_link.yaml, >> NULL::dbi_link.yaml, >> NULL::text, >> NULL, ::text, >> 'Northwind'::text >> ); >> >> >> I have a ODBC connection named "Northwind". >> >> The error message I'm always receiving (for the MS-SQL sample) is: >> >> ERROR: error from Perl function: error from Perl function: duplicate key >> violates unique constraint "dbi_connection_data_source_key" at line 94. >> at line 35. >> SQL state: XX000 > > It looks like you're trying to connect the same data_source and > user_name twice. Check whether the existing one works :) > > Are the documents unclear on the idea that you only run > make_accessor_functions() once per remote (data_source,user_name) > pair per local database? > > Cheers, > David.
В списке pgsql-general по дате отправления: