DBI install under win2k

2002-12-03 Thread Julien Perriard
Hi !

How may I install DBI under windows 2000 ?


Thank a lot !


Julien



Error message with Apache

2002-12-03 Thread Julien Perriard
Hello !

Why  I have this message after installing ActivePerl, mysql, and Apache ?


[Tue Dec 03 09:33:13 2002] [error] [client 127.0.0.1] install_driver(mysql)
failed: Can't load 'C:/Perl/site/lib/auto/DBD/mysql/mysql.dll' for module
DBD::mysql: load_file:Le module spécifié est introuvable at
C:/Perl/lib/DynaLoader.pm line 206.

[Tue Dec 03 09:33:13 2002] [error] [client 127.0.0.1] Compilation failed in
require at (eval 1) line 3.

[Tue Dec 03 09:33:13 2002] [error] [client 127.0.0.1] Perhaps a required
shared library or dll isn't installed where expected


Thank you,
Julien




Re: DBI install under win2k

2002-12-03 Thread Kris Wolff
On 03.12.2002 9:27 Uhr, Julien Perriard [EMAIL PROTECTED] wrote:

 Hi !
 
 How may I install DBI under windows 2000 ?
 
 
 Thank a lot !
 
 
 Julien

I used the way over nmake. Woks fine if nmake works ( I remember I need a
few ours to find the right nmake but than --just grate with all kind of
modules. )
I prefere nmake !!!
But there is an easy way: using ppm from activestate !




Re: How do I build a search engine for a MySQL database?

2002-12-03 Thread Oriol Portell - UV
Thanks, Kris.

I probably expressed myself very bad... Actually I have done almost all 
the work. That means that I know how to connect to a database and how to 
manually build SQL statements in order to do a search. But I have a 
big problem: I don't know how to analize complex text queries and 
converting them to SQL select statements. For example: entering 
preposition (place OR time) in a text field and getting the 
corresponding select statement.

I cannot analize myself the text query from an HTML form because I don't 
know how to do it through regexps. So, the first option is to enter only 
simple queries and then I add the % wildcard myself to the select 
statement, but it is not very useful.

The perl modules I found in CPAN (Text-Query and Text-Query-SQL) convert 
complex text queries in Altavista syntax to SQL statements, but they 
don't put the % wildcard to the query words. These modules allow me to 
do more or less successful queries, but if I enter the text quoted above 
-- preposition (place OR time) -- the result does not include all the 
database entries with prepositions (the plural) and it is a bit 
annoying...

Thanks,

- Oriol -



RE: Connecting MS Access Database with DBI

2002-12-03 Thread Timothy Johnson

You never actually use your DataBase Driver, so DBI has no idea how to do
what you've asked.  I think this is what the error message is trying to tell
you.  Try installing DBD::ODBC and then putting the line use DBD::ODBC at
the top of your script after use DBI.

-Original Message-
From: Thomas A. Lowery [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 7:50 PM
To: [EMAIL PROTECTED]
Subject: Re: Connecting MS Access Database with DBI


On Mon, Dec 02, 2002 at 09:37:58PM -0600, jad wrote:
 I have Active State Perl 5.6.  I've used PPM install DBI.  I'm using 
 this code:

Did you install DBD-ODBC?

 #
 # Perl script that talks with the Northwinds database using an
 # ODBC DSN of Northwind.
 #
 
 use DBI;
 use Data::Dumper;
 
 my $dbh = DBI-connect( dbi:ODBC:Northwind, Admin, ,
 {RaiseError = 1, PrintError = 1, AutoCommit = 1} ) or
 die Unable to connect:  . $DBI::errstr . \n;

This looks fine.

 I get this error: Can't locate object method p via package DBI::db 
 (perhaps you forgot to load DBI::DB?) at test.pl line 21.

-- 
Thomas A. Lowery
See DBI/FAQ http://www.xmlproj.com/cgi/fom.cgi



RE: DBI install under win2k

2002-12-03 Thread Timothy Johnson

I would go with the PPM approach unless you are really familiar with nmake.

C:\ PPM
PPM install DBI
Install package DBI (y/n)? y

However, this should already be included in the default distribution if I'm
not mistaken.  If you're not using ActiveState's ActivePerl, then I suggest
you go download it, because it really does work the best with NT/2000/XP,
and they have some decent support tools as well.

-Original Message-
From: Kris Wolff [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 12:48 AM
To: Julien Perriard; DBI mailing
Subject: Re: DBI install under win2k


On 03.12.2002 9:27 Uhr, Julien Perriard [EMAIL PROTECTED] wrote:

 Hi !
 
 How may I install DBI under windows 2000 ?
 
 
 Thank a lot !
 
 
 Julien

I used the way over nmake. Woks fine if nmake works ( I remember I need a
few ours to find the right nmake but than --just grate with all kind of
modules. )
I prefere nmake !!!
But there is an easy way: using ppm from activestate !



Re: DBI install under win2k

2002-12-03 Thread Kris Wolff
But some modules they are always on cpan or privat sites and not as ppm
thingavailabl. So lern to work with nmake and you will never had any
problems on an other system like unix, too.


On 03.12.2002 11:07 Uhr, Timothy Johnson [EMAIL PROTECTED] wrote:

 
 I would go with the PPM approach unless you are really familiar with nmake.
 
 C:\ PPM
 PPM install DBI
 Install package DBI (y/n)? y
 
 However, this should already be included in the default distribution if I'm
 not mistaken.  If you're not using ActiveState's ActivePerl, then I suggest
 you go download it, because it really does work the best with NT/2000/XP,
 and they have some decent support tools as well.
 
 -Original Message-
 From: Kris Wolff [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 03, 2002 12:48 AM
 To: Julien Perriard; DBI mailing
 Subject: Re: DBI install under win2k
 
 
 On 03.12.2002 9:27 Uhr, Julien Perriard [EMAIL PROTECTED] wrote:
 
 Hi !
 
 How may I install DBI under windows 2000 ?
 
 
 Thank a lot !
 
 
 Julien
 
 I used the way over nmake. Woks fine if nmake works ( I remember I need a
 few ours to find the right nmake but than --just grate with all kind of
 modules. )
 I prefere nmake !!!
 But there is an easy way: using ppm from activestate !




Missing prereq in 1.32?

2002-12-03 Thread Scott Alexander
I'm just started to prep a new machine for our web cluster.  Using CPAN,
I tried to install DBI.  It made everything just fine, but when it went
to tests, it failed t/40profile.  The test uses Time::HiRes which wasn't
installed causing the failure.

t/40profile.Can't locate Time/HiRes.pm in @INC 
(@INC contains: .SNIP.) at t/40profile.t line 183.
BEGIN failed--compilation aborted at t/40profile.t line 183.

This is probably one of the questionable prereqs since DBI proper
doesn't use it, but the test won't pass without it.  The code that does
the use Time::HiRes is in an if (0) block, so it won't ever actually run
the code that needs Time::HiRes.  Might be worth it to just comment out
the use or that whole section maybe.

5.6.1 in rh7.3 on i686 hardware.

Scott



forking destroys db connection

2002-12-03 Thread Daniel Quan
Hello,
I am using the latest version of DBI and oracle 8i.

When my code forks and child exits it destroys the parent's connection to
the database.
I found some excerpt in working around the problem.
One of the solution was InactiveDestroy set to 1.
This did not solve the problem.

Stuart Hughes suggested using syscall(Sys_exit,0)..in Solaris.
My problem happens in IBM AIX and don't have syscall.h.

Any suggestion would be grateful.

thanks
---
daniel quan











This e-mail and any attachments thereto are intended only for use by the
addressee(s) named herein and may contain proprietary and/or confidential
information. If you are not the intended recipient of this e-mail, you are
hereby notified that any dissemination, distribution or copying of this
e-mail, and any attachments thereto, is strictly prohibited. If you have
received this e-mail in error, please immediately notify
[EMAIL PROTECTED] and permanently delete the original, any attachments,
any copies thereof, and any printouts thereof.



Re: Connecting MS Access Database with DBI

2002-12-03 Thread Tim Bunce
On Tue, Dec 03, 2002 at 02:03:49AM -0800, Timothy Johnson wrote:
 
 You never actually use your DataBase Driver, so DBI has no idea how to do
 what you've asked.  I think this is what the error message is trying to tell
 you.  Try installing DBD::ODBC and then putting the line use DBD::ODBC at
 the top of your script after use DBI.

No. You don't need to do that. The first parameter to DBI-connect(...) tells
the DBI which driver to load for you.

Tim.

 -Original Message-
 From: Thomas A. Lowery [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 02, 2002 7:50 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Connecting MS Access Database with DBI
 
 
 On Mon, Dec 02, 2002 at 09:37:58PM -0600, jad wrote:
  I have Active State Perl 5.6.  I've used PPM install DBI.  I'm using 
  this code:
 
 Did you install DBD-ODBC?
 
  #
  # Perl script that talks with the Northwinds database using an
  # ODBC DSN of Northwind.
  #
  
  use DBI;
  use Data::Dumper;
  
  my $dbh = DBI-connect( dbi:ODBC:Northwind, Admin, ,
  {RaiseError = 1, PrintError = 1, AutoCommit = 1} ) or
  die Unable to connect:  . $DBI::errstr . \n;
 
 This looks fine.
 
  I get this error: Can't locate object method p via package DBI::db 
  (perhaps you forgot to load DBI::DB?) at test.pl line 21.
 
 -- 
 Thomas A. Lowery
 See DBI/FAQ http://www.xmlproj.com/cgi/fom.cgi



Re: Missing prereq in 1.32?

2002-12-03 Thread Tim Bunce
On Mon, Dec 02, 2002 at 11:49:19AM -0800, Scott Alexander wrote:
 I'm just started to prep a new machine for our web cluster.  Using CPAN,
 I tried to install DBI.  It made everything just fine, but when it went
 to tests, it failed t/40profile.  The test uses Time::HiRes which wasn't
 installed causing the failure.
 
 t/40profile.Can't locate Time/HiRes.pm in @INC 
 (@INC contains: .SNIP.) at t/40profile.t line 183.
 BEGIN failed--compilation aborted at t/40profile.t line 183.
 
 This is probably one of the questionable prereqs since DBI proper
 doesn't use it, but the test won't pass without it.  The code that does
 the use Time::HiRes is in an if (0) block, so it won't ever actually run
 the code that needs Time::HiRes.  Might be worth it to just comment out
 the use or that whole section maybe.

The tests were contributed code and I'd not spotted that part.
I'll fix it.

Thanks.

Tim.

p.s. The DBI now has it's own function to return the high-res time
but I've not documenteted it yet (will do for next release):
$ perl -l -MDBI -e 'print DBI::dbi_time()'
1038917458.80726



Re: Fw: Strange web log errors

2002-12-03 Thread Tim Bunce
On Mon, Dec 02, 2002 at 06:25:35PM -0800, Dean Arnold wrote:
 Someone reported the following error occuring w/ DBI 1.32 and
 DBD::Chart:
 
  [Tue Dec  3 00:55:57 2002] nul: DBD::Sponge::db do failed: No rows 
  attribute supplied to prepare at c:/Perl/site/lib/Deakin/Base.pm line 
  2822.
  [Tue Dec  3 00:55:57 2002] nul: DBD::Sponge::db prepare failed: No 
  rows attribute supplied to prepare at c:/Perl/site/lib/Deakin/Base.pm 
  line 2824.
  
  The source code lines 2820 .. 2824 are:
  my($dbh) = DBI-connect('dbi:Chart:') || throw Error::Simple('Cannot 
  connect to chart');
  
  $dbh - do('CREATE TABLE bars (mark char(5), count INT)');
  
  my($sth) = $dbh - prepare('INSERT INTO bars VALUES(?, ?)');
  
  I found the error msg 'No rows...' in Sponge.pm line 52.
 
 Since DBD::Chart *never* directly uses DBD::Sponge,
 I can't figure how Sponge is showing up in the traceback...
 Was something added to DBI that uses Sponge directly ?
 BTW: DBD::Chart is pure-perl, if that matters any...

What is c:/Perl/site/lib/Deakin/Base.pm?

Since Ron is [EMAIL PROTECTED] I'd guess it's some local code.

  I'll try rolling DBI back to 1.28.

The check for the rows attribute in DBD::Sponge has been there since
before DBI 1.28.

Tim.



RE: How do I build a search engine for a MySQL database?

2002-12-03 Thread Mayes, Iman
Here is a good link to check out:

http://www.devarticles.com/art/1/195

Iman Mayes

-Original Message-
From: Oriol Portell - UV [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 4:30 AM
To: [EMAIL PROTECTED]
Subject: Re: How do I build a search engine for a MySQL database?


Thanks, Kris.

I probably expressed myself very bad... Actually I have done almost all 
the work. That means that I know how to connect to a database and how to

manually build SQL statements in order to do a search. But I have a 
big problem: I don't know how to analize complex text queries and 
converting them to SQL select statements. For example: entering 
preposition (place OR time) in a text field and getting the 
corresponding select statement.

I cannot analize myself the text query from an HTML form because I don't

know how to do it through regexps. So, the first option is to enter only

simple queries and then I add the % wildcard myself to the select 
statement, but it is not very useful.

The perl modules I found in CPAN (Text-Query and Text-Query-SQL) convert

complex text queries in Altavista syntax to SQL statements, but they 
don't put the % wildcard to the query words. These modules allow me to 
do more or less successful queries, but if I enter the text quoted above

-- preposition (place OR time) -- the result does not include all the 
database entries with prepositions (the plural) and it is a bit 
annoying...

Thanks,

- Oriol -




Re: How to insert a question mark?

2002-12-03 Thread Jeff Boes
On Mon, 2002-12-02 at 19:08, David Wheeler wrote:
 On Monday, December 2, 2002, at 01:43  PM, Anton Pitts wrote:
 
  I'm actually using DBD::PgPP at version 0.40; I can't say I'm sure why 
  I picked that one over DBD::Pg.  Although I just tried installing 
  DBD:Pg v 1.20, and it failed at make test with :
 
  t/01connect.Can't locate Test/More.pm in @INC (@INC contains: 
  blib/arch
 
 You need to install Test::More from the CPAN.

I had the same problem, installed Test::More, and it still reported
these errors, but DBD::Pg installed anyway.


-- 
Jeff Boes  vox 616.226.9550 ext 24
Database Engineer fax 616.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
   ...Nexcerpt... Extend your Expertise




RE: Connecting MS Access Database with DBI

2002-12-03 Thread Jeff Urlwin
 
 
 You never actually use your DataBase Driver, so DBI has no 
 idea how to do what you've asked.  I think this is what the 
 error message is trying to tell you.  Try installing 
 DBD::ODBC and then putting the line use DBD::ODBC at the 
 top of your script after use DBI.
 

No...No...no, not unless you absolutely need to.  DBI-connect handles
the loading for you...

Jeff





DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread Jeff Boes
We may have uncovered an incompatibility with DBD::Pg (version 1.20 is
the latest we have) and the newly-released PostgreSQL 7.3.

It appears that the DESTROY method for database and/or statement handles
is referencing a system table (pg_relcheck) that no longer exists. 
Attached is the trace that illustrates the problem.

- ping for DBD::Pg::db (DBI::db=HASH(0x8aca764)~0x8aca7d0)
dbd_db_ping
- ping= 1 at Table.pm line 1475
- prepare for DBD::Pg::db (DBI::db=HASH(0x8aca764)~0x8aca7d0 'SELECT * FROM 
job_methods LIMIT 1')
dbd_st_prepare: statement = SELECT * FROM job_methods LIMIT 1
dbd_st_preparse: statement = SELECT * FROM job_methods LIMIT 1
- prepare= DBI::st=HASH(0x8bf3694) at DBConnection.pm line 635
- execute for DBD::Pg::st (DBI::st=HASH(0x8bf3694)~0x8bf3868)
dbd_st_execute
dbd_st_execute: statement = SELECT * FROM job_methods LIMIT 1
- execute= 1 at Table.pm line 1321
- errstr for DBD::Pg::st (DBI::st=HASH(0x8bf3694)~0x8bf3868)
- errstr= undef at Table.pm line 1322
- FETCH for DBD::Pg::st (DBI::st=HASH(0x8bf3868)~INNER 'NAME_lc')
dbd_st_FETCH
1   - FETCH for DBD::Pg::st (DBI::st=HASH(0x8bf3868)~INNER 'NAME')
dbd_st_FETCH
1   - FETCH= [ 'method_id' 'method_name' ] at Table.pm line 1337
- FETCH= [ 'method_id' 'method_name' ] at Table.pm line 1337
- DESTROY for DBD::Pg::st (DBI::st=HASH(0x8bf3868)~INNER)
dbd_st_finish
dbd_st_destroy
- DESTROY= undef at Table.pm line 1341
- table_attributes for DBD::Pg::db (DBI::db=HASH(0x8aca764)~0x8aca7d0 
'job_methods')
1   - selectall_arrayref in DBD::_::db for DBD::Pg::db (DBI::db=HASH(0x8aca7d0)~INNER 
'select a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, 
a.attnum
  from pg_attribute a,
   pg_class c,
   pg_type  t
  where c.relname  = ?
and a.attrelid = c.oid
and a.attnum  = 0
and t.oid  = a.atttypid
order by 1 
 ' undef 'job_methods')
2   - prepare for DBD::Pg::db (DBI::db=HASH(0x8aca7d0)~INNER 'select a.attname, 
t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum
  from pg_attribute a,
   pg_class c,
   pg_type  t
  where c.relname  = ?
and a.attrelid = c.oid
and a.attnum  = 0
and t.oid  = a.atttypid
order by 1 
 ' undef)
dbd_st_prepare: statement = select a.attname, t.typname, a.attlen, a.atttypmod, 
a.attnotnull, a.atthasdef, a.attnum
  from pg_attribute a,
   pg_class c,
   pg_type  t
  where c.relname  = ?
and a.attrelid = c.oid
and a.attnum  = 0
and t.oid  = a.atttypid
order by 1 
 
dbd_st_preparse: statement = select a.attname, t.typname, a.attlen, a.atttypmod, 
a.attnotnull, a.atthasdef, a.attnum
  from pg_attribute a,
   pg_class c,
   pg_type  t
  where c.relname  = ?
and a.attrelid = c.oid
and a.attnum  = 0
and t.oid  = a.atttypid
order by 1 
 
dbd_preparse scanned 1 distinct placeholders
2   - prepare= DBI::st=HASH(0x8bf5520) at DBI.pm line 1251
- execute for DBD::Pg::st (DBI::st=HASH(0x8bf5520)~0x8adbb64 'job_methods')
dbd_bind_ph
 bind :p1 == 'job_methods' (type 0)
dbd_st_rebind
   bind :p1 == 'job_methods' (size 11/12/0, ptype 4, otype 1043)
dbd_st_execute
dbd_st_execute: statement = select a.attname, t.typname, a.attlen, a.atttypmod, 
a.attnotnull, a.atthasdef, a.attnum
  from pg_attribute a,
   pg_class c,
   pg_type  t
  where c.relname  = 'job_methods'
and a.attrelid = c.oid
and a.attnum  = 0
and t.oid  = a.atttypid
order by 1 
 
- execute= 2 at DBI.pm line 1253
- fetchall_arrayref for DBD::Pg::st (DBI::st=HASH(0x8bf5520)~0x8adbb64 undef 
undef)
1   - fetch for DBD::Pg::st (DBI::st=HASH(0x8adbb64)~INNER)
dbd_st_fetch
1   - fetch= [ 'method_id' 'int4' '4' '-1' '1' '0' '1' ] row1 at DBI.pm line 1577
1   - fetch for DBD::Pg::st (DBI::st=HASH(0x8adbb64)~INNER)
dbd_st_fetch
1   - fetch= [ 'method_name' 'text' '-1' '-1' '1' '0' '2' ] row2 at DBI.pm line 1577
1   - fetch for DBD::Pg::st (DBI::st=HASH(0x8adbb64)~INNER)
dbd_st_fetch
1   - fetch= undef row2 at DBI.pm line 1577
- fetchall_arrayref= [ ARRAY(0x8adbb7c) ARRAY(0x8bf5418) ] row2 at DBI.pm line 
1261
- DESTROY for DBD::Pg::st (DBI::st=HASH(0x8adbb64)~INNER)
dbd_st_destroy
- DESTROY= undef at perl5db.pl line 1487
1   - selectall_arrayref= [ ARRAY(0x8adbb7c) ARRAY(0x8bf5418) ] at Pg.pm line 552
1   - selectrow_array in DBD::_::db for DBD::Pg::db 

Re: How to insert a question mark?

2002-12-03 Thread David Wheeler
On Tuesday, December 3, 2002, at 06:46  AM, Jeff Boes wrote:


t/01connect.Can't locate Test/More.pm in @INC (@INC contains:
blib/arch


You need to install Test::More from the CPAN.


I had the same problem, installed Test::More, and it still reported
these errors, but DBD::Pg installed anyway.


Are you sure that Test::More installed properly, and for the same copy 
of Perl for which you are also installing DBD::Pg?

David

--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]



Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread Jeff Boes
On Tue, 2002-12-03 at 11:12, Jeff Boes wrote:
 We may have uncovered an incompatibility with DBD::Pg (version 1.20 is
 the latest we have) and the newly-released PostgreSQL 7.3.
 
 It appears that the DESTROY method for database and/or statement handles
 is referencing a system table (pg_relcheck) that no longer exists. 
 Attached is the trace that illustrates the problem.

Oops.  The problem is still there, but I've narrowed it down; it's not
in the DESTROY method at all, but in $dbh-table_attributes:


Use of uninitialized value in split at
/usr/lib/perl5/site_perl/5.6.1/i686-linux/DBD/Pg.pm line 576.
ERROR:  current transaction is aborted, queries ignored until end of
transaction block

-- 
Jeff Boes  vox 616.226.9550 ext 24
Database Engineer fax 616.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
   ...Nexcerpt... Extend your Expertise




Re: (Fwd) DBD::Oracle, Solaris 8, Oracle 9 and big bug on libclntsh

2002-12-03 Thread Luc VEILLON (ERMES)
Hi, 

Sorry to have bothered you all : it is also a pb of 32bits/vs64bits. As I
didn't found any message about a ELFCLASS  error, I thought I was not
concerned. By the way, I was. Changing all oracle/lib and oracle/rdbms/lib
in  oracle/lib32 and oracle/rdbms/lib32 inside Makefile allows the
compilation. 

Txs

 - Forwarded message from Luc VEILLON (ERMES) [EMAIL PROTECTED] -
 
 Delivered-To: [EMAIL PROTECTED]
 Date: Tue, 3 Dec 2002 16:14:59 +0100 (MET)
 From: Luc VEILLON (ERMES) [EMAIL PROTECTED]
 To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: DBD::Oracle, Solaris 8, Oracle 9 and big bug on libclntsh
 X-MailScanner: Found to be clean
 
 Hello, 
 
 If I'm not mistaking, each of you got a problem when installing DBD::Oracle
 on Oracle 9 and Solaris. I've got the same, but I didn't find any answer on
 the news after your mail. 
 
 Did you succeed in installing DBD:: Oracle ? 
 
 Thank's for any help ! 
 
  Luc VEILLON  | IRD/Dlgation aux systmes d'information/ 
  tel.:+33(0)2 38 49 95 95 | Ple Securite 
  Fax :+33(0)2 38 49 95 76 | 5, rue du carbone   
  [EMAIL PROTECTED]   | 45072 ORLEANS CEDEX 2
 
 
 - End forwarded message -
 

 Luc VEILLON  | IRD/Délégation aux systèmes d'information/ 
 tel.:+33(0)2 38 49 95 95 | Pôle Securite 
 Fax :+33(0)2 38 49 95 76 | 5, rue du carbone   
 [EMAIL PROTECTED]   | 45072 ORLEANS CEDEX 2




RE: Connecting MS Access Database with DBI

2002-12-03 Thread Timothy Johnson

I stand corrected.

-Original Message-
From: Jeff Urlwin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 6:58 AM
To: 'Timothy Johnson'; 'Thomas A. Lowery'; [EMAIL PROTECTED]
Subject: RE: Connecting MS Access Database with DBI


 
 
 You never actually use your DataBase Driver, so DBI has no 
 idea how to do what you've asked.  I think this is what the 
 error message is trying to tell you.  Try installing 
 DBD::ODBC and then putting the line use DBD::ODBC at the 
 top of your script after use DBI.
 

No...No...no, not unless you absolutely need to.  DBI-connect handles
the loading for you...

Jeff




Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread David Wheeler
On Tuesday, December 3, 2002, at 08:32  AM, Jeff Boes wrote:


Oops.  The problem is still there, but I've narrowed it down; it's not
in the DESTROY method at all, but in $dbh-table_attributes:


Use of uninitialized value in split at
/usr/lib/perl5/site_perl/5.6.1/i686-linux/DBD/Pg.pm line 576.
ERROR:  current transaction is aborted, queries ignored until end of
transaction block


Are you using transactions somewhere? Can you send a code snippet that 
generates this error?

Thanks,

David

--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]



Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread Ian Barwick
On Tuesday 03 December 2002 17:32, Jeff Boes wrote:
 On Tue, 2002-12-03 at 11:12, Jeff Boes wrote:
  We may have uncovered an incompatibility with DBD::Pg (version 1.20 is
  the latest we have) and the newly-released PostgreSQL 7.3.
 
  It appears that the DESTROY method for database and/or statement handles
  is referencing a system table (pg_relcheck) that no longer exists.
  Attached is the trace that illustrates the problem.

 Oops.  The problem is still there, but I've narrowed it down; it's not
 in the DESTROY method at all, but in $dbh-table_attributes:

This also happens sometings when connecting to 7.3 with a pre 7.3 psql 
and using \d to get table descriptions. Some pg_ tables have changed
in 7.3, so applications which query them may break like that.

AFAICT DBD::Pg versions prior to 1.20 don't query any pg_ tables
and _seem_ not to break anywhere when talking to 7.3 . I think
$dbh-table_attributes() etc. were added in 1.20.

You may have more luck with DBD::PG 1.13 for the moment.

Ian Barwick
[EMAIL PROTECTED]



Re: forking destroys db connection

2002-12-03 Thread Michael A Chase
On Mon, 2 Dec 2002 14:44:28 -0500  Daniel Quan [EMAIL PROTECTED] wrote:

 I am using the latest version of DBI and oracle 8i.
 
 When my code forks and child exits it destroys the parent's connection to
 the database.
 I found some excerpt in working around the problem.
 One of the solution was InactiveDestroy set to 1.
 This did not solve the problem.
 
 Stuart Hughes suggested using syscall(Sys_exit,0)..in Solaris.
 My problem happens in IBM AIX and don't have syscall.h.

Look at InactiveDestroy in 'perldoc DBI', it should be set to 1 in the
child to prevent the connection from being destroyed when the child exits. 
I normally try to avoid having any open handles when I fork().  You
generally can't use a handle created in the parent in the child, but it
does get copied into the child's memory space and the reference goes out of
scope when the child exits.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.






Re: forking destroys db connection

2002-12-03 Thread Michael A Chase
On Tue, 3 Dec 2002 12:44:51 -0500  Daniel Quan [EMAIL PROTECTED] wrote:

 thanks for replying..
 I have tried InactiveDestroy =1.
 It does not work.
 The exit in the child after fork literally destroys the
 DB handle in parent.

Something else is happening then, InactiveDestroy has worked for others for
several years.  What you describe is exactly what InactiveDestroy should
prevent.  Are you trying to use the handle in the child process?

Example code that demonstrates the problem would make it much easier for
someone to help you.

 -Original Message-
 From: Michael A Chase [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 03, 2002 12:44 PM
 To: '[EMAIL PROTECTED]'; Daniel Quan
 Subject: Re: forking destroys db connection
 
 
 On Mon, 2 Dec 2002 14:44:28 -0500  Daniel Quan [EMAIL PROTECTED]
 wrote:
 
 I am using the latest version of DBI and oracle 8i.
 
 When my code forks and child exits it destroys the parent's connection to
 the database.
 I found some excerpt in working around the problem.
 One of the solution was InactiveDestroy set to 1.
 This did not solve the problem.
 
 Stuart Hughes suggested using syscall(Sys_exit,0)..in Solaris.
 My problem happens in IBM AIX and don't have syscall.h.
 
 Look at InactiveDestroy in 'perldoc DBI', it should be set to 1 in the
 child to prevent the connection from being destroyed when the child exits. 
 I normally try to avoid having any open handles when I fork().  You
 generally can't use a handle created in the parent in the child, but it
 does get copied into the child's memory space and the reference goes out of
 scope when the child exits.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.







seg fault unixODBC

2002-12-03 Thread Matthew Bartholomew
Not sure what to do from here...any advice would be great.  Thanks...
-Matt

[root@ns3 root]# isql -v
Segmentation fault
[root@ns3 build]# isql -b
Segmentation fault
[root@ns3 build]# isql -c
Segmentation fault
[root@ns3 build]# isql -w
Segmentation fault
[root@ns3 build]# isql -mn
Segmentation fault
.you get the idea...isql seg faults on most every command. --version is
the only one that doesn't seg fault.  I upgrade to unixODBC 2.2.2 in hopes
of fixing this, but no avail.  

Also, I've tried to recompile DBD::ODBC but make test fails...probably
because unixodbc is seg faulting when called (see below for that error..and
it should be noted that I removed the s from the makefile).


Here is what I am running:
RedHat 7.2 kernel 2.4.7-10
perl 5.8
unixODBC-2.2.2-3
freetds-0.60-1
glibc-2.2.93-5
DBD::ODBC 0.43

DBI is up to date (Database was generated on Mon, 02 Dec 2002 11:54:12 GMT 
--- I don't know the version #)

ODBCHOME=/usr
and the correct DSN settings are in my environment


-- odbcinst.ini --
[SQL]
Description = v0.52 with protocol v4.2
Driver  = /usr/lib/libtdsodbc.so
FileUsage   = 2

[TXT]
Description = Text file driver
Driver  = /usr/lib/libodbctxt.so
Setup   = /usr/lib/libodbctxtS.so
FileUsage   = 2

[PostgreSQL]
Description = PostgreSQL driver
Driver  = /usr/lib/libodbpsql.so
Setup   = /usr/lib/libodbpsqlS.so
FileUsage   = 2
--



[root@ns3 DBD-ODBC-0.43]#   make test TEST_VERBOSE=1
PERL_DL_NONLAZY=1 /usr/local/bin/perl -MExtUtils::Command::MM -e
test_harness(1, 'blib/lib', 'blib/arch') t/*.t
t/01base..1..5
ok 1
ok 2
ok 3
ok 4
ok 5
ok
t/02simple1..17
ok 1
 Test 2: connecting to the database
dubious
Test returned status 0 (wstat 11, 0xb)
DIED. FAILED tests 2-17
Failed 16/17 tests, 5.88% okay
t/03dbatt.1..9
ok 1
dubious
Test returned status 0 (wstat 11, 0xb)
DIED. FAILED tests 2-9
Failed 8/9 tests, 11.11% okay
t/05meth..1..6
ok 1
dubious
Test returned status 0 (wstat 11, 0xb)
DIED. FAILED tests 2-6
Failed 5/6 tests, 16.67% okay
t/07bind..1..9
ok 1
 Test 2: connecting to the database
dubious
Test returned status 0 (wstat 11, 0xb)
DIED. FAILED tests 2-9
Failed 8/9 tests, 11.11% okay
t/08bind2.dubious
Test returned status 0 (wstat 11, 0xb)
t/09multi.dubious
Test returned status 0 (wstat 11, 0xb)
Failed Test  Stat Wstat Total Fail  Failed  List of Failed

---
t/02simple.t01117   16  94.12%  2-17
t/03dbatt.t 011 98  88.89%  2-9
t/05meth.t  011 65  83.33%  2-6
t/07bind.t  011 98  88.89%  2-9
t/08bind2.t 011??   ??   %  ??
t/09multi.t 011??   ??   %  ??
Failed 6/7 test scripts, 14.29% okay. 37/46 subtests failed, 19.57% okay.
make: *** [test_dynamic] Error 2

 




Re: seg fault unixODBC

2002-12-03 Thread Nick Gorham
Matthew Bartholomew wrote:

Not sure what to do from here...any advice would be great.  Thanks...
-Matt

[root@ns3 root]# isql -v
Segmentation fault
[root@ns3 build]# isql -b
Segmentation fault
[root@ns3 build]# isql -c
Segmentation fault
[root@ns3 build]# isql -w
Segmentation fault
[root@ns3 build]# isql -mn
Segmentation fault
.you get the idea...isql seg faults on most every command. --version is
the only one that doesn't seg fault.  I upgrade to unixODBC 2.2.2 in hopes
of fixing this, but no avail.  

Hi,

Try isql -v wibble

You should get a DSN not found error.

If you still get a seg fault, try running under GDB and see what happens.

If you can connect to postgres and not freetds, I would ask on the 
freetds lists as its probably a freetds issue. If you can't connect to 
postgres, and still get the segfault, ask me as its a unixODBC problem.

I would guess its not  DBI, so I will send this the those lists (just so 
they know its been answered), but you may as well trim any other answer 
to a smaller number of lists.

--
Nick Gorham
Easysoft Limited http://www.easysoft.com



Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread Jeff Boes
On Tue, 2002-12-03 at 12:16, Ian Barwick wrote:

 AFAICT DBD::Pg versions prior to 1.20 don't query any pg_ tables
 and _seem_ not to break anywhere when talking to 7.3 . I think
 $dbh-table_attributes() etc. were added in 1.20.
 
 You may have more luck with DBD::PG 1.13 for the moment.
 

Nope, not quite:

$ grep pg_ Pg.pm

of Pg.pm 1.13 will show you that it relies on pg_database, pg_user,
pg_class, pg_description, pg_attribute, pg_type, pg_index, pg_attrdef,
and pg_relcheck.  All but the last one are still in 7.3. 
table_attributes is present in 1.13, and uses most of the listed tables.

-- 
Jeff Boes  vox 616.226.9550 ext 24
Database Engineer fax 616.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
   ...Nexcerpt... Extend your Expertise




Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread Ian Barwick
On Tuesday 03 December 2002 19:34, Jeff Boes wrote:
(B On Tue, 2002-12-03 at 12:16, Ian Barwick wrote:
(B  AFAICT DBD::Pg versions prior to 1.20 don't query any pg_ tables
(B  and _seem_ not to break anywhere when talking to 7.3 . I think
(B  $dbh-table_attributes() etc. were added in 1.20.
(B 
(B  You may have more luck with DBD::PG 1.13 for the moment.
(B
(B Nope, not quite:
(B
(B $ grep pg_ Pg.pm
(B
(B of Pg.pm 1.13 will show you that it relies on pg_database, pg_user,
(B pg_class, pg_description, pg_attribute, pg_type, pg_index, pg_attrdef,
(B and pg_relcheck.  All but the last one are still in 7.3.
(B table_attributes is present in 1.13, and uses most of the listed tables.
(B
(BAh, yes, apologies, please regard my last statement, somewhere along 
(Bthe line I seem to have got hold of the wrong end of a large stick
(B(note to self: need holiday).
(B
(B;-)
(B
(BIan Barwick
([EMAIL PROTECTED]



Re: threads,dbi 1.30,odbc 0.43, perl 5.8 (AS)

2002-12-03 Thread Tim Bunce
Please show a (very) small example script.

Tim.

On Tue, Dec 03, 2002 at 02:31:01PM -0500, Trey Gregory wrote:
 I'm sure this has been answered before, but I wasn't able to find anything in the 
archives. (Is there a search interface available?)
 
 I have a multithreaded program. My problem is this: if I create a connection in the 
parent, then create a thread which creates a new dbh, I get an error message about 
the handle not being owned by the (current) child thread. Since I was creating a new 
connection in the child, I thought I would be creating a new handle as well, but this 
does not seem to be the case.
 
 What is the proper way to work with DBI in this multithreaded environment?
 
 
 Thanks,
 Trey



Re: DBI 1.31 on MacOS X 10.2.2 with no prior install of DBI - problem maybe...

2002-12-03 Thread Tim Bunce
Thanks Jonathan. I'll look into it. The Makefile is probably missing
a dependency.

Tim.

On Sun, Dec 01, 2002 at 08:24:26PM -0800, Jonathan Leffler wrote:
 Dear Tim,
 
 An odd one, and I'm not sure whether you even want to do anything 
 about it, but...
 
 I was using 'cpan' from Perl 5.8.0 (mainly because CPANPLUS v0.040 is 
 wholly broken for me, on both Solaris and MacOS X) on MacOS X 10.2.2, 
 and ran into the build error:
 
 Checking if your kit is complete...
 Looks good
 Writing Makefile for DBI
 
 Remember to actually *read* the README file!
 Use  'make' to build the software (dmake or nmake on Windows).
 Then 'make test' to execute self tests.
 Then 'make install' to install the DBI and then delete this working
 directory before unpacking and building any DBD::* drivers.
 
 cp Changes blib/lib/DBI/Changes.pm
 make: *** No rule to make target `blib/arch/auto/DBI/Driver.xst', 
 needed by `Perl.xsi'.  Stop.
 make: *** Waiting for unfinished jobs
 cp dbd_xsh.h blib/arch/auto/DBI/dbd_xsh.h
 cp lib/DBI/FAQ.pm blib/lib/DBI/FAQ.pm
 cp Driver_xst.h blib/arch/auto/DBI/Driver_xst.h
 
 
 Now, I didn't have DBI previously installed, and there was a 
 '/usr/bin/make -j3' command in there to confuse the hell out of 
 things--apparently, the CPAN module felt empowered to use the -j3 
 option.  When I tried a manual 'perl Makefile.PL; make; make test; 
 make install', things worked OK.  You've seen reports on the warnings, 
 so I'm not going to echo those, and in any case, you've already 
 released DBI 1.32 (but my CPAN mirror doesn't catch up that quick)...
 
 
 I'm not completely clear whether I'd have seen a problem report if I 
 already had DBI installed -- I suspect I might.
 
 
 -- 
 Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED]) 
 #include disclaimer.h
 Guardian of DBD::Informix 1.04.PC1 -- http://dbi.perl.org/
 



Re: attempting to use DBI::Profile

2002-12-03 Thread Tim Bunce
DBI 1.21 is very old.

Download and install the full DBI-1.32 distribution.
(Read the Changes file carefully for changes that may affect you)

Send all emails to [EMAIL PROTECTED] (as per the README).

Tim.

On Tue, Dec 03, 2002 at 01:18:26PM -0500, Jeff Nucciarone wrote:
 
 Greetings.
 
 I want to use the DBI profile module to profile a section of my code. 
 
 However I get the following:
 
 Can't locate DBI/Profile.pm in @INC (@INC
 contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1
 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1
 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
 /usr/lib/perl5/site_perl) at ./test_gala_query5 line 25.
 BEGIN failed--compilation aborted at ./test_gala_query5 line 25.
 
 From this I'll assume that the profiling module was not included by
 default in the perl-DBI-1.21-1 distribution I downloaded from CPAN.
 
 I downloaded Profile.pm from the source link at
 http://search.cpan.org/author/TIMB/DBI-1.32/lib/DBI/Profile.pm
 but still could not run it... got a whole bunch of errors regarding
 unexported symbols and such.
 
 Not to look like a complete fool (this is all new to me...) shall I guess
 that I can't just grab Profile.pm and stick it in INC? Is there something
 else I need to do?
 
 Thanks,
 
   --Jeff
 
 Jeff Nucciarone [EMAIL PROTECTED]  http://www.personal.psu.edu/nucci
   Senior Research Programmer, High Performance Computing Group, ITS/ASET
   The Pennsylvania State University
  Don't just do it  do it right.
 
 
 



Re: threads,dbi 1.30,odbc 0.43, perl 5.8 (AS)

2002-12-03 Thread Trey Gregory
Here is a short example. Short overview is: main connects, queries, then spawns thread 
(test_thread) which creates a new connection and attempts to query. The error received 
is:

thread failed to start: DBD::ODBC::dr connect failed: handle 1 is owned by thread 
15d6d7c not current thread 32c814c (handles can't be shared between threads and your 
driver may need a CLONE method ad
ded) at D:/perl/site/lib/DBI.pm line 503.


use threads;
use DBI;

my $dbh;
if (!($dbh = DBI-connect(dbi:ODBC:my_dsn,
  loginpw,
  loginpw,
  {PrintError = 1}
  ))) {
print Can't connect:  $DBI::errstr if $DEBUG;

exit;
}

my $sql = qq[
select * from account_t
];

my $result;

if (!($result = executeCommand($dbh,$sql))) {
print error $sql\n;
}


my $thr = threads-new(\test_thread);
$thr-join;

exit;


sub test_thread {

my $dbh;
if (!($dbh = DBI-connect(dbi:ODBC:my_dsn,
  loginpw,
  loginpw,
  {PrintError = 1}
  ))) {
print Can't connect:  $DBI::errstr if $DEBUG;

exit;
}

my $sql = qq[
select * from account_t
];

my $result;

if (!($result = executeCommand($dbh,$sql))) {
return undef;
}
}


sub executeCommand {
my ($dbh, $query_str) = @_;

my $sth;
if (!($sth = $dbh-prepare($query_str))) {
return undef;
}

my $rc;
if (!($rc = $sth-execute)) {
return undef;
}

my $resultsARef;
if (!($resultsARef = $sth-fetchall_arrayref)) {
return undef;
}

$sth-finish;
return $resultsARef;
}



Linux, Oracle 9.2.0, DBD::Oracle

2002-12-03 Thread Radu Caulea
Hello there

I am pretty new in the Linux area and I am trying to install DBD:Oracle
on this platform. It tries to reach a 9i database (all tests were
directed to 9i on Linux and/or win2k).

I can connect directly in sqlplus to the remote platform as well as to
the local one.  

Thank you for your help. 

I posted a small amount of output, i could post more in case I omitted
relevant facts.

Regards, Radu Caulea

Some output of the compilation is here:
--- test sqlplus
sqlplus [EMAIL PROTECTED]
SQL*Plus: Release 9.2.0.1.0 - Production on Ma Dec 3 21:46:39 2002
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL
  COUNT(*)
--
63
SQL Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 -
Production
---
[root@zebra root]# perl -v
This is perl, v5.8.0 built for i386-linux-thread-multi
---
---
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e
test_harness(0,
'blib/lib', 'blib/arch') t/*.t
t/base...ok
t/generalDBI connect('','[EMAIL PROTECTED]',...) failed:
ORA-00604: error
occurred at recursive SQL level 1
ORA-00922: missing or invalid option (DBD ERROR: OCISessionBegin) at
t/general.t line 20
Unable to connect to Oracle (ORA-00604: error occurred at recursive SQL
level 1
ORA-00922: missing or invalid option (DBD ERROR: OCISessionBegin))
Tests skiped.
---
All tests successful, 5 tests skipped.
Files=6, Tests=5,  2 wallclock secs ( 0.82 cusr +  0.11 csys =  0.93
CPU)
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/lib -Iblib/arch test.pl
Oraperl test application $Revision: 1.4 $
dump() better written as CORE::dump() at
/root/.cpan/build/DBD-Oracle-1.12/blib/lib/Oraperl.pm line 80.

Oraperl emulation interface version 1.41
DBD::Oracle 1.12 using OCI8 by Tim Bunce
DBI 1.32 by Tim Bunce

Data sources:
dbi:Oracle:EXTPROC_CONNECTION_DATA
dbi:Oracle:GATE.TAFORA
dbi:Oracle:INST1_HTTP


Connecting
 to '' (from command line, else uses ORACLE_SID or TWO_TASK -
recommended)
 as '[EMAIL PROTECTED]' (via ORACLE_USERID env var or default -
recommend name/passwd@dbname)
(ORACLE_SID='aleph', TWO_TASK='')
ora_login: 604: ORA-00604: error occurred at recursive SQL level 1
ORA-00911: invalid character (DBD ERROR: OCISessionBegin)

Generally set TWO_TASK or ORACLE_SID but not both at the same time.
Try to connect to the database using an oracle tool like sqlplus
only if that works should you suspect problems with DBD::Oracle.
Try leaving dbname value empty and set dbuser to name/passwd@dbname.

Test aborted.
make: *** [test_dynamic] Error 255
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force


Radu Caulea, TAFORA
Senior Oracle Consultant
www.tafora.fr







RE: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread Steve Baldwin
I'm sure this has been asked many times before, but Tim's reply here
prompted me to ask again.  Is there any way to access the DB version (as
per your example of get_info(18) below) from DBI.  For example as an
attribute of the database handle.  I've consulted the manual, but
couldn't find any reference to this.  We currently have a requirement to
support Oracle 7.3 and 9i, and in some cases the SQL we execute needs to
be  different (to take advantage of 9i features).  At present we obtain
the version ourselves by issuing :
select banner from v$version, and parsing the appropriate bits out.  I
reckon it would be nicer (and presumably more portable) if the DBD layer
could expose this info.

Whadayareckon ?

-Original Message-
From: Tim Bunce [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, 4 December 2002 7:47 AM
To: David Wheeler
Cc: Jeff Boes; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?


On Tue, Dec 03, 2002 at 10:56:47AM -0800, David Wheeler wrote:
 On Tuesday, December 3, 2002, at 10:34  AM, Jeff Boes wrote:
 
 Nope, not quite:
 
 $ grep pg_ Pg.pm
 
 of Pg.pm 1.13 will show you that it relies on pg_database, pg_user, 
 pg_class, pg_description, pg_attribute, pg_type, pg_index, 
 pg_attrdef, and pg_relcheck.  All but the last one are still in 7.3. 
 table_attributes is present in 1.13, and uses most of the listed 
 tables.
 
 Apparently, pg_relcheck was merged into another table in 7.3. Bummer
 for backwards compatibility, that. I'll try to figure out how the new 
 query should work in the next few days, but if anyone beats me to it, 
 patches welcome.
 
 I guess this also means that DBD::Pg really needs to be changed to
 always detect the version of the database it connects to so that it
can 
 do the right thing. Tim, is there a DBI-standard way to story/provide 
 an RDBMS version number?

$version = get_info(18); # SQL_DBMS_VER

But note that the result needs to be formatted in a particular way: e.g.
06.50.0201

Google found http://www.4d.com/ACIDOC/CMU/CMU11922.HTM saying:

SQL_DBMS_VER (ODBC 1.0)

A character string indicating the version of the DBMS product accessed
by the driver. The version is of the form ##.##., where the first
two digits are the major version, the next two digits are the minor
version, and the last four digits are the release version. The driver
must render the DBMS product version in this form, but can also append
the DBMS product-specific version as well. For example, 04.01. Rdb
4.1.

You might find this interesting:
http://www.geocrawler.com/archives/3/105/2001/1/0/5030630/

Driver authors are reminded that the DBI docs say:

Because some DBI methods make use of get_info(), drivers are strongly
encouraged to support Iat least the following very minimal set of
information types to ensure the DBI itself works properly:
 
 Type  NameExample A Example B
   --    
   17  SQL_DBMS_NAME   'ACCESS'  'Oracle'
   18  SQL_DBMS_VER'03.50.'  '08.01.0721'
   29  SQL_IDENTIFIER_QUOTE_CHAR   '`'   ''
   41  SQL_CATALOG_NAME_SEPARATOR  '.'   '@'
  114  SQL_CATALOG_LOCATION1 2

Tim.




Re: threads,dbi 1.30,odbc 0.43, perl 5.8 (AS)

2002-12-03 Thread Tim Bunce
On Tue, Dec 03, 2002 at 03:47:29PM -0500, Trey Gregory wrote:
 Here is a short example. Short overview is: main connects, queries, then spawns 
thread (test_thread) which creates a new connection and attempts to query. The error 
received is:
 
 thread failed to start: DBD::ODBC::dr connect failed: handle 1 is owned by thread 
15d6d7c not current thread 32c814c (handles can't be shared between threads and your 
driver may need a CLONE method ad
 ded) at D:/perl/site/lib/DBI.pm line 503.

Looks like DBD::ODBC doesn't have a CLONE method to clear out the
driver handle in the new thread. So the new thread tries to use the
inherited driver handle.

Try version 0.45_18.

Tim.



Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread David Wheeler
On Tuesday, December 3, 2002, at 10:34  AM, Jeff Boes wrote:


Nope, not quite:

$ grep pg_ Pg.pm

of Pg.pm 1.13 will show you that it relies on pg_database, pg_user,
pg_class, pg_description, pg_attribute, pg_type, pg_index, pg_attrdef,
and pg_relcheck.  All but the last one are still in 7.3.
table_attributes is present in 1.13, and uses most of the listed 
tables.

Apparently, pg_relcheck was merged into another table in 7.3. Bummer 
for backwards compatibility, that. I'll try to figure out how the new 
query should work in the next few days, but if anyone beats me to it, 
patches welcome.

I guess this also means that DBD::Pg really needs to be changed to 
always detect the version of the database it connects to so that it can 
do the right thing. Tim, is there a DBI-standard way to story/provide 
an RDBMS version number?

Thanks,

David

--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]



Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread Tim Bunce
On Tue, Dec 03, 2002 at 10:56:47AM -0800, David Wheeler wrote:
 On Tuesday, December 3, 2002, at 10:34  AM, Jeff Boes wrote:
 
 Nope, not quite:
 
 $ grep pg_ Pg.pm
 
 of Pg.pm 1.13 will show you that it relies on pg_database, pg_user,
 pg_class, pg_description, pg_attribute, pg_type, pg_index, pg_attrdef,
 and pg_relcheck.  All but the last one are still in 7.3.
 table_attributes is present in 1.13, and uses most of the listed 
 tables.
 
 Apparently, pg_relcheck was merged into another table in 7.3. Bummer 
 for backwards compatibility, that. I'll try to figure out how the new 
 query should work in the next few days, but if anyone beats me to it, 
 patches welcome.
 
 I guess this also means that DBD::Pg really needs to be changed to 
 always detect the version of the database it connects to so that it can 
 do the right thing. Tim, is there a DBI-standard way to story/provide 
 an RDBMS version number?

$version = get_info(18); # SQL_DBMS_VER

But note that the result needs to be formatted in a particular way:
e.g. 06.50.0201

Google found http://www.4d.com/ACIDOC/CMU/CMU11922.HTM saying:

SQL_DBMS_VER (ODBC 1.0)

A character string indicating the version of the DBMS product
accessed by the driver. The version is of the form ##.##., where
the first two digits are the major version, the next two digits are
the minor version, and the last four digits are the release version.
The driver must render the DBMS product version in this form, but
can also append the DBMS product-specific version as well. For
example, 04.01. Rdb 4.1.

You might find this interesting:
http://www.geocrawler.com/archives/3/105/2001/1/0/5030630/

Driver authors are reminded that the DBI docs say:

Because some DBI methods make use of get_info(), drivers are strongly
encouraged to support Iat least the following very minimal set
of information types to ensure the DBI itself works properly:
 
 Type  NameExample A Example B
   --    
   17  SQL_DBMS_NAME   'ACCESS'  'Oracle'
   18  SQL_DBMS_VER'03.50.'  '08.01.0721'
   29  SQL_IDENTIFIER_QUOTE_CHAR   '`'   ''
   41  SQL_CATALOG_NAME_SEPARATOR  '.'   '@'
  114  SQL_CATALOG_LOCATION1 2

Tim.



RE: DBD::Pg 1.20 uncompatible with Postgres 7.3?

2002-12-03 Thread Jeff Boes
On Tue, 2002-12-03 at 16:20, Steve Baldwin wrote:
 I'm sure this has been asked many times before, but Tim's reply here
 prompted me to ask again.  Is there any way to access the DB version (as
 per your example of get_info(18) below) from DBI.  For example as an
 attribute of the database handle.  I've consulted the manual, but
 couldn't find any reference to this.  We currently have a requirement to
 support Oracle 7.3 and 9i, and in some cases the SQL we execute needs to
 be  different (to take advantage of 9i features).  At present we obtain
 the version ourselves by issuing :
 select banner from v$version, and parsing the appropriate bits out.  I
 reckon it would be nicer (and presumably more portable) if the DBD layer
 could expose this info.

Well, the easiest way would be to roll your own extended class from DBI,
and just add the version as a new method.

-- 
Jeff Boes  vox 616.226.9550 ext 24
Database Engineer fax 616.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
   ...Nexcerpt... Extend your Expertise




Problem with insert a BLOB into Oracle

2002-12-03 Thread John Whitnack
Hi,

  I am having a problem with saving a Binary file to BLOB column in 
Oracle. I get a weird error message telling me that the table does not 
exists even though I can see it using SQLplus. He is a sample of the 
code I am using.

..
..
..
  $query = INSERT INTO file_table
VALUES (?,?);

  $sth = $handle-prepare($query);
  $sth-bind_param(1,$entity_id);
  $sth-bind_param(2,$file,{ora_type = ORA_BLOB});

  $results = $sth-execute();
..
..
..

The exact error message I recieve is:

DBD::Oracle::st execute failed: ORA-04043: object file_table does not 
exist (DBD SUCCESS: OCIDescribeAny(view)/LOB refetch) at LoadFile.pl 
line 180.

Does anyone know what could be causing it not to see the table?

--
John Whitnack
Gilbert Laustsen Jung
[EMAIL PROTECTED]
(403)-266-9517



Any timeframe on DBD:Oracle supporting array inserts

2002-12-03 Thread John Milardovic
From a thread last month
(http:[EMAIL PROTECTED]/msg14522.html) it was
indicated that DBD-Oracle 1.13 would support array inserts.  Can anyone
(Tim?) confirm this?  If so is there a projected release date and how firm
is that date?

Thanks in advance.
John



$sth-{ParamValues} using mysql

2002-12-03 Thread Moritz von Schweinitz
hi there,

somehow i can't get $sth-{ParamValues} working using DBD::mysql (i 
guess it should support that feature, or?).

anyhow, the docs say:
-
ParamValues (hash ref, read-only)
Returns a reference to a hash containing the values currently bound 
to placeholders. Returns undef if not supported by the driver. If the 
driver does support ParamValues but no values have been bound yet then 
either undef or an empty hash may be returned.

See /ShowErrorStatement for an example of how this is used.

It is possible that the values in the hash returned by ParamValues 
are not exactly the same as those passed to bind_param() or execute(). 
The driver may have modified the values in some way based on the TYPE 
the value was bound with. For example a floating point value bound as an 
SQL_INTEGER type may be returned as an integer.
-

which, quite frankly, kind of confuses me: what should the keys and 
values of the resulting hash be?

so: can anybody confirm that $sth-{ParamValues} works for the most 
recent mysql ppm that activestate offers (v2.0400, if i'm not mistaken)?

thanks,

M.



RE: seg fault unixODBC

2002-12-03 Thread Matthew Bartholomew
Nick...this is what I get:

[root@ns3 DBD-ODBC-0.43]# isql -v wibble
[unixODBC][Driver Manager]Data source name not found, and no default driver
specified
[ISQL]ERROR: Could not SQLConnect


I tried to used ODBCconfig to get connected to anything at this point,
postgres or tds but ODBCconfig seg faults when installing the DSN.  

Matt

-Original Message-
From: Nick Gorham [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 03, 2002 12:09 PM
To: Matthew Bartholomew
Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]';
'[EMAIL PROTECTED]'
Subject: Re: seg fault unixODBC

Matthew Bartholomew wrote:
 Not sure what to do from here...any advice would be great.  Thanks...
 -Matt
 
 [root@ns3 root]# isql -v
 Segmentation fault
 [root@ns3 build]# isql -b
 Segmentation fault
 [root@ns3 build]# isql -c
 Segmentation fault
 [root@ns3 build]# isql -w
 Segmentation fault
 [root@ns3 build]# isql -mn
 Segmentation fault
 .you get the idea...isql seg faults on most every command. --version
is
 the only one that doesn't seg fault.  I upgrade to unixODBC 2.2.2 in hopes
 of fixing this, but no avail.  

Hi,

Try isql -v wibble

You should get a DSN not found error.

If you still get a seg fault, try running under GDB and see what happens.

If you can connect to postgres and not freetds, I would ask on the 
freetds lists as its probably a freetds issue. If you can't connect to 
postgres, and still get the segfault, ask me as its a unixODBC problem.

I would guess its not  DBI, so I will send this the those lists (just so 
they know its been answered), but you may as well trim any other answer 
to a smaller number of lists.

-- 
Nick Gorham
Easysoft Limited http://www.easysoft.com



RE: unixODBC

2002-12-03 Thread Matthew Bartholomew
Hello again,

I was able to connect to mysql via isql (I'm having a difficult time with
postgresql).  Do you think that puts unixODBC in the clear and I should look
around at other packages as the perpetrators of this seg fault?  Or does
postgresql hold a significance that I'm not getting? 

Since then, I've re-installed freetds 0.60 and the Sybase 11.9.2-1 family of
rpms, but same results:

[root@ns3 sybase]# isql SQL -v wibble
Segmentation fault 

Cheers,
Matt


-Original Message-
From: Nick Gorham [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 03, 2002 2:27 PM
To: [EMAIL PROTECTED]
Subject: unixODBC

Hi,

I would try isql first, there are several reasons you may get a seg 
fault in ODBCConfig all you need is mismatched QT libs.

Try and get a postgres connection working.

Nick



RE: unixODBC and isql seg fault

2002-12-03 Thread Matthew Bartholomew
Thanks for the help Nick...

If anyone from the freetds arena can add some guidance...that would be
wonderful.

Here is one last odd quirk that I haven't mentionedI am able to connect
to the MS SQL 2k server and query without issue via php 4.2.2!  The seg
fault occurs when running isql from a bash shell and any perl scripts that
use DBI-connect(DBI:ODBC:DSN,'USERname', 'PASS')


Per Nick Gorham, here are my gdb results:
---
(gdb) r -v SQL
Starting program: /usr/bin/isql -v SQL
[New Thread 8192 (LWP 14857)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8192 (LWP 14857)]
0x4007b8df in uodbc_get_stats () from /usr/lib/libodbc.so.1
(gdb) quit
---

I have no idea what the above message means, so if anyone can shed some
light...I would appreciate it.  

For users on the Freetds list, please see the bottom of this email for the
start of this email thread.  The issue is a basic seg fault when using isql
to connect to a MS SQL 2k server.  I have freetds0.60, unixODBC 2.2.2-3, and
Sybase 11.9 family of rpms installed on a redhat 7.2 linux.  Using perl
5.8.0 with DBI and DBD::ODBC (most up to date versions that cpan will allow
on 12/03/02).

It should be noted that I have another linux box talking with a MS SQL 2K
server using freetds-0.53-1, unixODBC-2.1.1-1, perl-5.6.1-26.72.3.  That
configuration works flawlessly...so others may want to wait a bit longer
until they upgrade to those packages.

Thanks,
Matt


 Hello again,
 
 I was able to connect to mysql via isql (I'm having a difficult time 
 with postgresql).  Do you think that puts unixODBC in the clear and I 
 should look around at other packages as the perpetrators of this seg 
 fault?  Or does postgresql hold a significance that I'm not getting?

No, its going to be a freetds thing I suspect. I would try running isql 
under gdb

gdb isql
r -v dsnname

and see where it fails

I would try asking on the freetds lists.

BTW. I have snipped the reply to list.

Nick



-Original Message-
From: Matthew Bartholomew 
Sent: Tuesday, December 03, 2002 4:23 PM
To: 'Nick Gorham'
Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]';
'[EMAIL PROTECTED]'
Subject: RE: unixODBC

Hello again,

I was able to connect to mysql via isql (I'm having a difficult time with
postgresql).  Do you think that puts unixODBC in the clear and I should look
around at other packages as the perpetrators of this seg fault?  Or does
postgresql hold a significance that I'm not getting? 

Since then, I've re-installed freetds 0.60 and the Sybase 11.9.2-1 family of
rpms, but same results:

[root@ns3 sybase]# isql SQL -v wibble
Segmentation fault 

Cheers,
Matt


-Original Message-
From: Nick Gorham [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 03, 2002 2:27 PM
To: [EMAIL PROTECTED]
Subject: unixODBC

Hi,

I would try isql first, there are several reasons you may get a seg 
fault in ODBCConfig all you need is mismatched QT libs.

Try and get a postgres connection working.

Nick



---

For those on the freetds list...here is the start of this thread:

From: Matthew Bartholomew 
Sent: Tuesday, December 03, 2002 4:23 PM
To: 'Nick Gorham'
Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]';
'[EMAIL PROTECTED]'
Subject: RE: unixODBC


Not sure what to do from here...any advice would be great.  Thanks...
-Matt

[root@ns3 root]# isql -v
Segmentation fault
[root@ns3 build]# isql -b
Segmentation fault
[root@ns3 build]# isql -c
Segmentation fault
[root@ns3 build]# isql -w
Segmentation fault
[root@ns3 build]# isql -mn
Segmentation fault
.you get the idea...isql seg faults on most every command. --version is
the only one that doesn't seg fault.  I upgrade to unixODBC 2.2.2 in hopes
of fixing this, but no avail.  

Also, I've tried to recompile DBD::ODBC but make test fails...probably
because unixodbc is seg faulting when called (see below for that error..and
it should be noted that I removed the s from the makefile).


Here is what I am running:
RedHat 7.2 kernel 2.4.7-10
perl 5.8
unixODBC-2.2.2-3
freetds-0.60-1
glibc-2.2.93-5
DBD::ODBC 0.43

DBI is up to date (Database was generated on Mon, 02 Dec 2002 11:54:12 GMT 
--- I don't know the version #)

ODBCHOME=/usr
and the correct DSN settings are in my environment


-- odbcinst.ini --
[SQL]
Description = v0.52 with protocol v4.2
Driver  = /usr/lib/libtdsodbc.so
FileUsage   = 2

[TXT]
Description = Text file driver
Driver  = /usr/lib/libodbctxt.so
Setup   = /usr/lib/libodbctxtS.so
FileUsage   = 2

[PostgreSQL]
Description = PostgreSQL driver
Driver  = /usr/lib/libodbpsql.so
Setup   = /usr/lib/libodbpsqlS.so
FileUsage   = 2
--



[root@ns3 DBD-ODBC-0.43]#   make test TEST_VERBOSE=1
PERL_DL_NONLAZY=1 /usr/local/bin/perl 

paramValues with mysql?

2002-12-03 Thread Moritz von Schweinitz
hi there,

does dbd::mysql support the $sth-{ParamValues} ?
i'm trying to get this working using v2.0400 (from activestate's ppm), 
and all i get is undefs (even though $sth-{'NUM_OF_PARAMS'} returns the 
expected number of placeholders.

is activestate's ppm out of date, or does the current version (2.1020) 
lack this ability, too? (the changelog on cpan wont tell).

if a newer version supports this, is there a ppm somewhere (i don't have 
a compiler on my winXP box)

thanks for any help,

M.

P.S.: i just tried to post another question, but i got an email mumbling 
something about groupshield not being happy with my subject (which was 
simply $sth-{ParamValues} using mysql. is this a bug or a feature?



Re: Problem with insert a BLOB into Oracle

2002-12-03 Thread Steve Sapovits

John Whitnack wrote:


  I am having a problem with saving a Binary file to BLOB column in 
Oracle. I get a weird error message telling me that the table does not 
exists even though I can see it using SQLplus. He is a sample of the 
code I am using.




The exact error message I recieve is:

DBD::Oracle::st execute failed: ORA-04043: object file_table does not 
exist (DBD SUCCESS: OCIDescribeAny(view)/LOB refetch) at LoadFile.pl 
line 180.

Does anyone know what could be causing it not to see the table?

I hit this error due to the problem described here:

http://groups.google.com/groups?q=Oracle+LOB+04043hl=enlr=ie=UTF-8oe=UTF-8selm=c67657ff.0202201224.69d0d26e%40posting.google.comrnum=2

When I fully qualified the table name (after some DBA magic maybe?) it
worked.  It all started when the DBA's changed the perms on our schema.
Fortunately we use LOBs in more than one place so it was obvious that
this was related to the change and LOBs -- only LOBs were affected.  I
ran across some other LOB related errors of this nature when I searched,
so that may not be it for you.  Try a Google search on 'Oracle LOB 04043'
or something similar.

--
Steve SapovitsGSI Commerce, Inc.http://www.gsicommerce.com
[EMAIL PROTECTED]





Re: paramValues with mysql?

2002-12-03 Thread Michael A Chase
On Tue, 03 Dec 2002 19:38:57 -0600 Moritz von Schweinitz [EMAIL PROTECTED] wrote:

 does dbd::mysql support the $sth-{ParamValues} ?
 i'm trying to get this working using v2.0400 (from activestate's ppm), 
 and all i get is undefs (even though $sth-{'NUM_OF_PARAMS'} returns the 
 expected number of placeholders.

If you tried it and it didn't work, it probably isn't supported.  If you
think that is wrong, post the code so someone (not me) who is familiar with
mysql can look at it.

 is activestate's ppm out of date, or does the current version (2.1020) 
 lack this ability, too? (the changelog on cpan wont tell).
 
 if a newer version supports this, is there a ppm somewhere (i don't have 
 a compiler on my winXP box)

http://xmlproj.com/fom-serve/cache/120.html

 P.S.: i just tried to post another question, but i got an email mumbling 
 something about groupshield not being happy with my subject (which was 
 simply $sth-{ParamValues} using mysql. is this a bug or a feature?

Probably the $ sign.  They are trying to keep the amount of spam down.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.