[Pgpool-general] PlPerl ODBC connect error question?

tuanhoanganh hatuan05 at gmail.com
Wed Jan 5 15:30:54 UTC 2011


Very sorry for post wrong mail list.

To Tatsuo Ishii :
I follow your tutorial in
http://pgpool.projects.postgresql.org/contrib_docs/simple_sr_setting/index.html,
pgpool-II-3.1.0 is a good production and hope it release soon.

Thanks you.

On Wed, Jan 5, 2011 at 10:13 PM, Sean Brown <sean.brown at eaglepress.com>wrote:

> On Wednesday, January 05, 2011 04:10:53 am Tatsuo Ishii wrote:
> > I'm not familiar with perl at all and cannot chase the problem. Any
> > one could help him?
> > --
> > Tatsuo Ishii
> > SRA OSS, Inc. Japan
> > English: http://www.sraoss.co.jp/index_en.php
> > Japanese: http://www.sraoss.co.jp
>
> I think he'd get better help on a MSDN board as he is having problems
> connecting to MS SQL Server, or on a general postgresql board if he is
> having
> problems with PL/Perl.
>
> It seems as if his connection string for the SQL Server ODBC driver is
> incorrect.
>
> >
> > > Can PLPerl make ODBC connect.
> > > I have perl test connect. It work well
> > > use DBI;
> > > my $h = DBI->connect(
> > >
> > >     'dbi:ODBC:DRIVER=SQL
> > >
> > > Server;Server=127.0.0.1;Database=TEST;Uid=sa;Pwd=abc123ABC;Port=1433',
> > >
> > >     'sa',
> > >     'abc123ABC',
> > >     { AutoCommit => 1, RaiseError => 1, }
> > >
> > > ) or die "Did not connect to db.";
> > > print join(',', $h->tables);
> > >
> > > But in PLPerlu it has error
> > >
> > > CREATE OR REPLACE FUNCTION test_connection()
> > >
> > >   RETURNS void AS
> > >
> > > $BODY$
> > > use DBI;
> > > my $dbh = DBI->connect(
> > >
> > >     'dbi:ODBC:DRIVER=SQL
> > >
> > > Server;Server=127.0.0.1;Database=TEST;Uid=sa;Pwd=abc123ABC;Port=1433',
> > >
> > >     'sa',
> > >     'abc123ABC',
> > >     { AutoCommit => 1, RaiseError => 1, }
> > >
> > > );
> > >
> > > if ($DBI::errstr) {
> > >
> > >     die <<ERR;
> > >
> > > Could not connect to database
> > > $DBI::errstr
> > > ERR
> > > }
> > > RETURN;
> > > $BODY$
> > >
> > >   LANGUAGE plperlu VOLATILE
> > >   COST 100;
> > >
> > > ALTER FUNCTION test_connection() OWNER TO postgres;
> > >
> > > AND when i execute function
> > >
> > > SELECT test_connection();
> > >
> > > Here is error
> > >
> > > ERROR: Could not connect to database
> > > [Microsoft][ODBC SQL Server Driver][SQL Server]Changed database context
> > > to 'SMILE_FO'. (SQL-01000)
> > > [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language setting
> > > to us_english. (SQL-01000) [state was 01000 now 01S00]
> > > [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute
> > > (SQL-01S00)
> > > SQL state: XX000
> > > Context: PL/Perl function "test_connection"
> >
> > _______________________________________________
> > Pgpool-general mailing list
> > Pgpool-general at pgfoundry.org
> > http://pgfoundry.org/mailman/listinfo/pgpool-general
>
> --
> This message has been scanned for viruses and
> dangerous content and is believed to be clean.
> --
>
> _______________________________________________
> Pgpool-general mailing list
> Pgpool-general at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pgpool-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pgfoundry.org/pipermail/pgpool-general/attachments/20110105/f6abed0c/attachment.html>


More information about the Pgpool-general mailing list