Re: How to print a table field in DBI?

2001-02-23 Thread Ron Savage

>while ($ref = $sth->fetchrow_hashref) {
>foreach $key (keys %{$ref}) {
>print "$key-- $ref->{$key}, ";
>}

Equivalently, but neater, and more Perlish:

while ($ref = $sth -> fetchrow_hashref() )
{
print map{"$_ => $$ref{$_}. \n"} keys %$ref;
}

You can do the same thing for CGI.pm parameters:

print map{"$_ => " . $q -> param($_) . ". \n"} $q -> param();

In both cases, you may want extra code to check for undefined values...





Re: ADO

2001-02-23 Thread Simon Oliver

Get the latest MDAC SDK (2.6).

http://www.microsoft.com/data

David Billingham wrote:

> Dear Tom
> 
> Thanks for your reply.
> 
> I didn't phrase my question very well: I am using DBD:ADO without any
> serious problems (having switched my code from ODBC).
> 
> I was hoping to get advice on where to look for information on the ADO
> specfic methods mentioned in the O'Reilly 'Programming the Perl DBI' (Page
> 239). In particlar how to access\use the Connection and Recordset objects.
> 
> Thanks in advance for any advice you can give.
> 
> Best wishes
> 
> David Billingham
> 
> 
> - Original Message -
> From: "Thomas A. Lowery" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 21, 2001 11:02 PM
> Subject: Re: ADO
> 
> 
> 
>> A good start is the module DBD::ADO.  DBD::ADO provide use ADO use
>> that looks the same as other DBD::* modules.
>> 
>> Tom
>> 
>> On Wed, Feb 21, 2001 at 06:23:35PM -, David Billingham wrote:
>> 
>>> Could some tell me where I should be looking for information on how to
>> 
> use
> 
>>> the ADO Connection and RecordSet objects from Perl and the DBI?
>> 
>> --
>> Thomas A. Lowery [EMAIL PROTECTED]
>> http://tlowery.hypermart.net
>> 
>> SA talking to disk vendor, "So, multiple failures on both controllers is a
> 
> bad thing? (Friday Morning)"
> 
>> _
>> Do You Yahoo!?
>> Get your free @yahoo.com address at http://mail.yahoo.com
>> 
>> 


-- 
   Simon

---
   Department of Biomolecular Sciences
   UMIST, PO Box 88, Sackville St
   Manchester, M60 1QD
   United Kingdom

   Phone:  +44 161 200 8912
   Fax:+44 161 236 0409
   Mobile: +44 776 183 0327
   Email:  [EMAIL PROTECTED]
---




DBD::Oracle: make test fails

2001-02-23 Thread prtome

Hello,

I have a slight problem finishing my install of DBD-Oracle. I have read
the list archive, and tried the solutions but to no avail. I would very
much appreciate any hints of what to do to solve the problem. 

Config:
perl 5.6.0
DBI - 1.14
DBD-1.06
Oracle 8.1.7
Compaq - OSF 5.1  (true 64)
C compiler from compaq

Problem:
make test fails with unresolved symbols:
t/general...install_driver(Oracle) failed: Can't load
'blib/arch/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: dlopen:
blib/arch/auto/DBD/Oracle/Oracle.so: symbol "upihst" unresolved at
/usr/local/lib/perl5/5.6.0/alpha-dec_osf/DynaLoader.pm line 200.


My ORACLE_HOME and LD_LIBRARY_PATH are correct.
I did ldd -r Oracle.so to see what libraries where being searched, and
which symbols are missing.
I am not sure I understand where these should be:
for example, where are supposed to be the PL_ stuff?
and why does it have problems finding symbols in libc?

Unresolved symbol in blib/arch/auto/DBD/Oracle/Oracle.so: upihst
Unresolved symbol in blib/arch/auto/DBD/Oracle/Oracle.so: upioep
Unresolved symbol in blib/arch/auto/DBD/Oracle/Oracle.so: PL_tmps_floor
.
Unresolved symbol in blib/arch/auto/DBD/Oracle/Oracle.so: Perl_sv_setpv

Unresolved symbol in libc.so: __ldr_data
Unresolved symbol in libc.so: __Argv
Unresolved symbol in libc.so: __Argc
Unresolved symbol in libpthread.so: __Argv
Unresolved symbol in libpthread.so: __Argc


Main  =>   blib/arch/auto/DBD/Oracle/Oracle.so
libclntsh.so.8.0  =>  
/usr/local/oracle/app/oracle/product/8.1.7/lib/libclntsh.so.8.0
libc.so  =>   /usr/shlib/libc.so
libwtc8.so  =>  
/usr/local/oracle/app/oracle/product/8.1.7/lib/libwtc8.so
libexc.so  =>   /usr/shlib/libexc.so
librt.so  =>   /usr/shlib/librt.so
libaio_raw.so  =>   /usr/shlib/libaio_raw.so
libm.so  =>   /usr/shlib/libm.so
libpthread.so  =>   /usr/shlib/libpthread.so


My last install of DBD-Oracle was on Solaris, with Oracle 7.1.3, and I
remember that I had to put all libraries a few times to make sure all
was OK. Is that still the case?
should I include -lclntsh -lc a few times in various positions in the ld
command of the makefile?
and should that also be a few times in LD_RUN_PATH? currently they are
both once at the end of that.
I have tried but obviously did not put them at the correct position
since nothing changed

Thanks in advance for any explanation that clarifies what is going on -
or solves the problem ;-)

cheers
PatRT



missing includes in DBI make..

2001-02-23 Thread Greg Trangmoe

Howdy, I'm trying to install DBI but I'm having trouble with the make.  I checked the 
dependancies and they all seem to be installed.  The make errors out because it can't 
find header files.  I've attached the 'make' output along with the 'perl Makefile.PL' 
output and output from 'perl -V' :

The files it is looking for are all in a directory that is not in my @INC.  Is there 
any way I can add dirs to @INC?  I appreciate any help you all can provide.

[root@www DBI-1.14]# perl Makefile.PL
*** Note:
The optional PlRPC-modules (RPC::PlServer etc) are not installed.
If you want to use the DBD::Proxy driver and DBI::ProxyServer
modules, then you'll need to install the RPC::PlServer, RPC::PlClient,
Storable and Net::Daemon modules. The CPAN Bundle::DBI may help you.
You can install them any time after installing the DBI.
You do *not* need these modules for typical DBI usage.

Optional modules are available from any CPAN mirror, in particular
http://www.perl.com/CPAN/modules/by-module
http://www.perl.org/CPAN/modules/by-module
ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module

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.

[root@www DBI-1.14]# make
mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/DBI
mkdir blib/lib/auto
mkdir blib/lib/auto/DBI
mkdir blib/man1
mkdir blib/man3
cp lib/DBI/W32ODBC.pm blib/lib/DBI/W32ODBC.pm
cp lib/DBD/ExampleP.pm blib/lib/DBD/ExampleP.pm
cp lib/DBI/Shell.pm blib/lib/DBI/Shell.pm
cp lib/DBI/FAQ.pm blib/lib/DBI/FAQ.pm
cp lib/DBI/ProxyServer.pm blib/lib/DBI/ProxyServer.pm
cp lib/Bundle/DBI.pm blib/lib/Bundle/DBI.pm
cp lib/DBD/Proxy.pm blib/lib/DBD/Proxy.pm
cp lib/DBD/Multiplex.pm blib/lib/DBD/Multiplex.pm
cp DBIXS.h blib/arch/auto/DBI/DBIXS.h
cp dbd_xsh.h blib/arch/auto/DBI/dbd_xsh.h
cp dbi_sql.h blib/arch/auto/DBI/dbi_sql.h
cp lib/DBD/NullP.pm blib/lib/DBD/NullP.pm
cp lib/DBD/Sponge.pm blib/lib/DBD/Sponge.pm
cp lib/DBI/Format.pm blib/lib/DBI/Format.pm
cp Driver.xst blib/arch/auto/DBI/Driver.xst
cp lib/DBI/DBD.pm blib/lib/DBI/DBD.pm
cp lib/Win32/DBIODBC.pm blib/lib/Win32/DBIODBC.pm
cp DBI.pm blib/lib/DBI.pm
cp dbipport.h blib/arch/auto/DBI/dbipport.h
cp lib/DBD/ADO.pm blib/lib/DBD/ADO.pm
/usr/bin/perl -p -e "s/~DRIVER~/Perl/g" < blib/arch/auto/DBI/Driver.xst > Perl.x
si
/usr/bin/perl -I/usr/lib/perl5/5.00503/i386-linux -I/usr/lib/perl5/5.00503 /usr/
lib/perl5/5.00503/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.00503/ExtUtils/type
map Perl.xs >xstmp.c && mv xstmp.c Perl.c
cc -c  -Dbool=char -DHAS_BOOL -I/usr/local/include -O2-DVERSION=\"1.14\" -DX
S_VERSION=\"1.14\" -fpic -I/usr/lib/perl5/5.00503/i386-linux/CORE -DDBI_NO_THREA
DS Perl.c
In file included from /usr/include/bits/posix1_lim.h:126,
 from /usr/include/limits.h:30,
 from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/li
mits.h:117,
 from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/sy
slimits.h:7,
 from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/li
mits.h:11,
 from /usr/include/sys/param.h:23,
 from /usr/lib/perl5/5.00503/i386-linux/CORE/perl.h:367,
 from DBIXS.h:19,
 from Perl.xs:1:
/usr/include/bits/local_lim.h:27: linux/limits.h: No such file or directory
In file included from /usr/lib/perl5/5.00503/i386-linux/CORE/perl.h:367,
 from DBIXS.h:19,
 from Perl.xs:1:
/usr/include/sys/param.h:24: linux/limits.h: No such file or directory
/usr/include/sys/param.h:25: linux/param.h: No such file or directory
In file included from /usr/include/netinet/in.h:27,
 from /usr/lib/perl5/5.00503/i386-linux/CORE/perl.h:523,
 from DBIXS.h:19,
 from Perl.xs:1:
/usr/include/bits/socket.h:295: asm/socket.h: No such file or directory
In file included from /usr/include/errno.h:36,
 from /usr/lib/perl5/5.00503/i386-linux/CORE/perl.h:580,
 from DBIXS.h:19,
 from Perl.xs:1:
/usr/include/bits/errno.h:25: linux/errno.h: No such file or directory
In file included from /usr/include/sys/ioctl.h:27,
 from /usr/lib/perl5/5.00503/i386-linux/CORE/perl.h:637,
 from DBIXS.h:19,
 from Perl.xs:1:
/usr/include/bits/ioctls.h:24: asm/ioctls.h: No such file or directory
In file included from /usr/include/sys/ioctl.h:30,
 from /usr/lib/perl5/5.00503/i386-linux/CORE/perl.h:637,
 from DBIXS.h:19,
 from Perl.xs:1:
/usr/include/bits/ioctl-types.h:25: asm/ioctls.h: No such file or directory

DBI cant connect when rate gets high

2001-02-23 Thread Chris Allen


I have a Perl application on one Linux box (vanilla RedHat 7) that talks
to MySql on another Linux box (also vanilla RedHat 7) through DBI over
TCP/IP.

I am using 

DBI-1.14
Msql-Mysql-modules-1.2215
mysql-3.22.32
perl 5.6.0
Application is called by Apache-1.3.15 running mod_perl
Application uses Apache::DBI


Normally everything works fine - the client can access the database on
the server without any problems. However, if a very large number of independent
database accesses happen in a very short space of time (say 4000 in 5 seconds)
I get the error:

Can't connect to MySQL server on '195.89.166.15' (11)

and the connect fails. If you wait a few seconds, then it will
recover and start letting you connect again.


A "show status;" on MySQL shows nothing 
extraordinary - only 6 connections have
been made...

+--+--+
| Aborted_clients  | 0|
| Aborted_connects | 0|
| Created_tmp_tables   | 282  |
| Delayed_insert_threads   | 0|
| Delayed_writes   | 0|
| Delayed_errors   | 0|
| Flush_commands   | 1|
| Handler_delete   | 2|
| Handler_read_first   | 6|
| Handler_read_key | 75057|
| Handler_read_next| 184464   |
| Handler_read_rnd | 13815742 |
| Handler_update   | 224  |
| Handler_write| 792  |
| Key_blocks_used  | 79   |
| Key_read_requests| 147009   |
| Key_reads| 78   |
| Key_write_requests   | 221  |
| Key_writes   | 218  |
| Max_used_connections | 6|
| Not_flushed_key_blocks   | 0|
| Not_flushed_delayed_rows | 0|
| Open_tables  | 40   |
| Open_files   | 74   |
| Open_streams | 0|
| Opened_tables| 44   |
| Questions| 217570   |
| Running_threads  | 4|
| Slow_queries | 0|
| Uptime   | 142287   |
+--+--+


... so I'm a bit baffled as to where to look. This seems
to happen *consistently* when the accesses reach 4000 or
so in a short space of time, and doesn't happen 
when the database and the app are on the same
machine.


I realise that this is partially off-topic for this list - but
it seemed to be a good starting point as it is DBI that
is sending me back an error that I don't really understand.


Many thanks,


Chris Allen
[EMAIL PROTECTED]





Re: ADO

2001-02-23 Thread Jim Clark

The book 'Programming ADO' by David Sceppa and published by Microsoft Press (c)
2000 is a good source too.

-Jim

Simon Oliver wrote:

> Get the latest MDAC SDK (2.6).
>
> http://www.microsoft.com/data
>
> David Billingham wrote:
>
> > Dear Tom
> >
> > Thanks for your reply.
> >
> > I didn't phrase my question very well: I am using DBD:ADO without any
> > serious problems (having switched my code from ODBC).
> >
> > I was hoping to get advice on where to look for information on the ADO
> > specfic methods mentioned in the O'Reilly 'Programming the Perl DBI' (Page
> > 239). In particlar how to access\use the Connection and Recordset objects.
> >
> > Thanks in advance for any advice you can give.
> >
> > Best wishes
> >
> > David Billingham
> >
> >
> > - Original Message -
> > From: "Thomas A. Lowery" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 21, 2001 11:02 PM
> > Subject: Re: ADO
> >
> >
> >
> >> A good start is the module DBD::ADO.  DBD::ADO provide use ADO use
> >> that looks the same as other DBD::* modules.
> >>
> >> Tom
> >>
> >> On Wed, Feb 21, 2001 at 06:23:35PM -, David Billingham wrote:
> >>
> >>> Could some tell me where I should be looking for information on how to
> >>
> > use
> >
> >>> the ADO Connection and RecordSet objects from Perl and the DBI?
> >>
> >> --
> >> Thomas A. Lowery [EMAIL PROTECTED]
> >> http://tlowery.hypermart.net
> >>
> >> SA talking to disk vendor, "So, multiple failures on both controllers is a
> >
> > bad thing? (Friday Morning)"
> >
> >> _
> >> Do You Yahoo!?
> >> Get your free @yahoo.com address at http://mail.yahoo.com
> >>
> >>
>
> --
>Simon
>
> ---
>Department of Biomolecular Sciences
>UMIST, PO Box 88, Sackville St
>Manchester, M60 1QD
>United Kingdom
>
>Phone:  +44 161 200 8912
>Fax:+44 161 236 0409
>Mobile: +44 776 183 0327
>Email:  [EMAIL PROTECTED]
> ---




RE: Magical Headers and Unsubscribing

2001-02-23 Thread Furber, David

It would also be helpful if the fact that the message is from the mailing list were 
identifiable by a formatted subject field - this would allow Outlook users (and 
others) to divert the message to a folder more reliably  (If anyone has a reliable 
rule I'd love to see it).

David


-Original Message-
From:   Brett W. McCoy [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, February 21, 2001 7:31 PM
To: David Vergin
Cc: [EMAIL PROTECTED]
Subject:Re: Magical Headers and Unsubscribing

On Wed, 21 Feb 2001, David Vergin wrote:

> Don't get me wrong. I *like* not having all that "You are receiveing
> this because... Here's what to do if..." stuff cluttering up each
> post. But perhaps, in recognition of those less-adept folks who give
> the list a try for a while, the single line "For help with this list,
> send a blank message to [EMAIL PROTECTED]" at the top or bottom
> of each post would be a helpful preventative.

I get this

[ Note: This message contains email list management information ]

at the bottom of each message, as a hyperptext link (I use Pine).  If I
open the link, it tells me everyhting I need to know about how to manage
my subscription.  Does anyone else get that?

-- Brett
 http://www.chapelperilous.net/~bmccoy/
---
The world is coming to an end!  Repent and return those library books!





RE: Magical Headers and Unsubscribing

2001-02-23 Thread Ken Crow

I am using outlook, and I set a rule that works perfectly.  I put
[EMAIL PROTECTED] as a contact, and make a rule that if an email is sent to
dbi-users, it goes into my DBI folder.  Hope this helps.

Ken

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 8:38 AM
To: [EMAIL PROTECTED]
Subject: RE: Magical Headers and Unsubscribing


It would also be helpful if the fact that the message is from the mailing
list were identifiable by a formatted subject field - this would allow
Outlook users (and others) to divert the message to a folder more reliably
(If anyone has a reliable rule I'd love to see it).

David


-Original Message-
From:   Brett W. McCoy [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, February 21, 2001 7:31 PM
To: David Vergin
Cc: [EMAIL PROTECTED]
Subject:Re: Magical Headers and Unsubscribing

On Wed, 21 Feb 2001, David Vergin wrote:

> Don't get me wrong. I *like* not having all that "You are receiveing
> this because... Here's what to do if..." stuff cluttering up each
> post. But perhaps, in recognition of those less-adept folks who give
> the list a try for a while, the single line "For help with this list,
> send a blank message to [EMAIL PROTECTED]" at the top or bottom
> of each post would be a helpful preventative.

I get this

[ Note: This message contains email list management information ]

at the bottom of each message, as a hyperptext link (I use Pine).  If I
open the link, it tells me everyhting I need to know about how to manage
my subscription.  Does anyone else get that?

-- Brett
 http://www.chapelperilous.net/~bmccoy/
---
The world is coming to an end!  Repent and return those library books!







Re: Oracle::DBD on Solaris 2.7

2001-02-23 Thread Elaine -HFB- Ashton

Scott J. Pekarek [[EMAIL PROTECTED]] quoth:
*>
*>>> This is a long shot. If all else fails and perl -V:usemymalloc says
*>>> usemymalloc='y' then try rebuilding perl using Configure
*>-Uusemymalloc.
*>>> If this does fix it for you then please let me know.
*>
*>Since it appeared to be a memory problem I tried it and it works.
*>Judging from the comment
*>(and the fact that this is all fairly recent code) I have to believe
*>there is a better way to solve this problem - does anybody know what it
*>is?

It is, as far as I know, the only way as perl's malloc is less than good
on solaris if you are using 64-bit and has a 2gb limit whereas the solaris 
malloc in 32-bit has 3.9gb or so and a 'virutally ulimited' heap size in 
64-bit mode.

In Perl 5.8.x, the default with configure will be to use the solaris
malloc and with 5.6.1 there is a README.solaris that contains the
following;

---
=head2 Malloc Issues.

You should not use perl's malloc if you are building with gcc.  There
are reports of core dumps, especially in the PDL module.  The problem
appears to go away under -DDEBUGGING, so it has been difficult to
track down.  Sun's compiler appears to be ok with or without perl's
malloc. [XXX further investigation is needed here.]

You should also not use perl's malloc if you are building perl as
an LP64 application, since perl's malloc has trouble allocating more
than 2GB of memory.

You can avoid perl's malloc by Configuring with

sh Configure -Uusemymalloc
---

If you are interested in how the solaris memory architecture works, there
is a recent book on 'Solaris Internals: Core Kernel Architecture' that
does a good job of wading through it.

e.



RE: DBD-Oracle-1.03 and DBD-Oracle-1.06 FAIL make test

2001-02-23 Thread Bowman, Brent A

This is precisely where I've been stuck for the past couple months.  I get
precisely the same make test error

My system:
PA-RISC 2.0
HPUX 11.0
Oracle 8.1.7
perl 5.6
DBI 1.14
DBD::Oracle 1.06

 Here, we have tried all of the library manipulation (path variable stuff)
that has been recommended on this list to no avail.If you have any
success in your corner, please post it - I seriously doubt that we are the
only ones who have encountered this problem.

Thanks,
Brent Bowman

> -Original Message-
> From: Byars, James D Contractor/NCCIM [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, February 22, 2001 16:07
> To:   [EMAIL PROTECTED]
> Subject:  DBD-Oracle-1.03 and DBD-Oracle-1.06 FAIL make test
> 
> Sorry all, here's the output of my make test.
> 
> PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib
> -I/opt/perl55/lib/5.00503/PA-RISC2.0-thread -I/opt/perl55/lib/5.00503 -e
> 'use
> Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
> t/base../usr/lib/dld.sl: Can't shl_load() a library containing
> Thread Local Storage:
> /opt/oracle/product/8.1.6/JRE/lib/PA_RISC/native_threads/libjava.sl
> /usr/lib/dld.sl: Exec format error
> install_driver(Oracle) failed: Can't load
> 'blib/arch/auto/DBD/Oracle/Oracle.sl'
> for module DBD::Oracle: Exec format error at
> /opt/perl55/lib/5.00503/PA-RISC2.0-thread/DynaLoader.pm line 169.
> 
>  at (eval 1) line 3
> Perhaps a required shared library or dll isn't installed where expected
>  at t/base.t line 17
> dubious
> Test returned status 8 (wstat 2048, 0x800)
> DIED. FAILED tests 4-5
> Failed 2/5 tests, 60.00% okay
> t/general.../usr/lib/dld.sl: Can't shl_load() a library containing
> Thread Local Storage:
> /opt/oracle/product/8.1.6/JRE/lib/PA_RISC/native_threads/libjava.sl
> /usr/lib/dld.sl: Exec format error
> install_driver(Oracle) failed: Can't load
> 'blib/arch/auto/DBD/Oracle/Oracle.sl'
> for module DBD::Oracle: Exec format error at
> /opt/perl55/lib/5.00503/PA-RISC2.0-thread/DynaLoader.pm line 169.
> 
>  at (eval 1) line 3
> Perhaps a required shared library or dll isn't installed where expected
>  at t/general.t line 20
> dubious
> Test returned status 8 (wstat 2048, 0x800)
> t/long../usr/lib/dld.sl: Can't shl_load() a library containing
> Thread Local Storage:
> /opt/oracle/product/8.1.6/JRE/lib/PA_RISC/native_threads/libjava.sl
> /usr/lib/dld.sl: Exec format error
> Can't load 'blib/arch/auto/DBD/Oracle/Oracle.sl' for module DBD::Oracle:
> Exec
> format error at /opt/perl55/lib/5.00503/PA-RISC2.0-thread/DynaLoader.pm
> line
> 169.
> 
>  at t/long.t line 4
> BEGIN failed--compilation aborted at t/long.t line 4.
> dubious
> Test returned status 8 (wstat 2048, 0x800)
> t/plsql./usr/lib/dld.sl: Can't shl_load() a library containing
> Thread Local Storage:
> /opt/oracle/product/8.1.6/JRE/lib/PA_RISC/native_threads/libjava.sl
> /usr/lib/dld.sl: Exec format error
> Can't load 'blib/arch/auto/DBD/Oracle/Oracle.sl' for module DBD::Oracle:
> Exec
> format error at /opt/perl55/lib/5.00503/PA-RISC2.0-thread/DynaLoader.pm
> line
> 169.
> 
>  at t/plsql.t line 17
> BEGIN failed--compilation aborted at t/plsql.t line 17.
> dubious
> Test returned status 8 (wstat 2048, 0x800)
> t/reauthskipping test on this platform
> Failed Test  Status Wstat Total Fail  Failed  List of failed
> --
> -
> t/base.t  8  2048 52  40.00%  4-5
> t/general.t   8  2048??   ??   %  ??
> t/long.t  8  2048??   ??   %  ??
> t/plsql.t 8  2048??   ??   %  ??
> 1 test skipped.
> Failed 4/5 test scripts, 20.00% okay. 2/5 subtests failed, 60.00% okay.
> *** Error exit code 2
> 
> Stop.
> 
> Jim
> 
> 
> 



Re: ADO

2001-02-23 Thread Thomas A . Lowery

$conn = $dbh->{ado_conn};
(Assuming a connect is present) Will set $conn to the ado connection
object.

$sth->{ado_conn} after a statement is prepared.

To access the command object (which I build during the prepare)
$sth->{ado_comm}

After you've executed the prepared statement ($sth->execute)
$sth->{ado_rowset} returns the record set object. (Assuming you've a
row set returned.)

Is this more in-line of what you're looking for?  As Tim says 'Use the
Source Luke'.  perldoc -m DBD::ADO displays the complete module (hacks
and all ;-(0 ).

I haven't much time to work on DBD::ADO.  In fact my NT machine is sitting
idle.  Any patches or improvement to DBD::ADO are always welcomed.

Tom


On Thu, Feb 22, 2001 at 10:12:46PM -, David Billingham wrote:
> 
> I didn't phrase my question very well: I am using DBD:ADO without any
> serious problems (having switched my code from ODBC).
> 
> I was hoping to get advice on where to look for information on the ADO
> specfic methods mentioned in the O'Reilly 'Programming the Perl DBI' (Page
> 239). In particlar how to access\use the Connection and Recordset objects.

> - Original Message -
> From: "Thomas A. Lowery" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 21, 2001 11:02 PM
> Subject: Re: ADO
> 
> 
> > A good start is the module DBD::ADO.  DBD::ADO provide use ADO use
> > that looks the same as other DBD::* modules.
> >
> > Tom
> >
> > On Wed, Feb 21, 2001 at 06:23:35PM -, David Billingham wrote:
> > > Could some tell me where I should be looking for information on how to
> use
> > > the ADO Connection and RecordSet objects from Perl and the DBI?
> >
> > --
> > Thomas A. Lowery [EMAIL PROTECTED]
> > http://tlowery.hypermart.net
> >
> > SA talking to disk vendor, "So, multiple failures on both controllers is a
> bad thing? (Friday Morning)"
> >
> >

-- 
Thomas A. Lowery[EMAIL PROTECTED]
http://tlowery.hypermart.net

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




Solved (was: Re: How to "use" a database with Oracle?)

2001-02-23 Thread Joern Reder

Tony Foiani wrote:

> > "Tim" == Tim Bunce <[EMAIL PROTECTED]> writes:
> 
> Tim> I think in very recent Oracle's there's an SQL command (probably
> Tim> 'SET ...')  that lets you switch default schema.
> 
> Is this what you are thinking of?
> 
>ALTER SESSION SET CURRENT_SCHEMA = 
> 
> We use "ALTER SESSION" extensively in our project here, primarily to
> set the NLS_DATE_FORMAT to be something sane.  It's described in the
> _Oracle8i SQL Reference_ (Release 2, 8.1.6, A76989-01), Chapter 7
> ("SQL Statements").

Thanks a lot: this works for me!

And yes, as Mark stated: I had to fizzle around with privileges,
but now everything works fine.

Joern

-- 
Joern Reder -- Software Development, dimedis GmbH, Koeln

Besuchen Sie uns vom 22.-28.03.01 auf der CeBIT, Halle 1, Stand 4c4
http://www.dimedis.de/terminvereinbarung



script retrieval of column names

2001-02-23 Thread Robb Garrioch

Does anyone know of a DBI method ~or~ MySQL specific way that would
retrieve the column names of a MySQL database.table dynamically within a
Perl script using DBI? or Oracle if known.

Thanks for any info!

Robb





Re: Magical Headers and Unsubscribing

2001-02-23 Thread Tony Foiani

> "David" == Furber, David <[EMAIL PROTECTED]> writes:

David> (If anyone has a reliable rule I'd love to see it).

I'm not sure how comprehensive the Outlook rule capabilities are, but
here are my procmail rules for dbi-users:

| :0:$IC_LOCK_PREFIX/dbi.users.spool
| * ^X-List-ID: 
| dbi.users.spool
| 
| :0:$IC_LOCK_PREFIX/dbi.users.spool
| * ^Mailing-List: contact dbi-users-help@perl\.org
| dbi.users.spool

Basically, I would look for one of those two headers ("X-List-ID" or
"Mailing-List") and file accordingly.  The backwhacking is to escape
the periods, since those are true regular expressions (only
egrep-level, alas).

t.






Re: script retrieval of column names

2001-02-23 Thread MikeBlezien

On Fri, 23 Feb 2001 09:53:47 -0800, Robb Garrioch <[EMAIL PROTECTED]>
wrote:

Robb,

Here's a snip that may help:
# do the SELECT query here

$sth->execute ();

# get column names to use for labels

@label = @{$sth->{NAME}};
for ($i=0;  $i<@label; $i++) 
  {
  print qq|Column Name: $label[$i]|;
  }

You can also for case by using NAME_lc(lowercase) or NAME_uc(uppercase)...

Hope this helps

Mickalo
>>Does anyone know of a DBI method ~or~ MySQL specific way that would
>>retrieve the column names of a MySQL database.table dynamically within a
>>Perl script using DBI? or Oracle if known.
>>
>>Thanks for any info!
>>
>>Robb
>>
>>

Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225) 686-2002

















Re: script retrieval of column names

2001-02-23 Thread Tony Foiani

> "Robb" == Robb Garrioch <[EMAIL PROTECTED]> writes:

Robb> Does anyone know of a DBI method ~or~ MySQL specific way that
Robb> would retrieve the column names of a MySQL database.table
Robb> dynamically within a Perl script using DBI? or Oracle if known.

Probably the most portable way to do this is by selecting * from a
table (you can use a condition like "WHERE NULL = NULL" to avoid
actually getting any data).  After that, you can use $sth->{NAME}.
>From perldoc DBI:

| Statement Handle Attributes
| 
| This section describes attributes specific to statement
| handles. Most of these attributes are read-only.
| 
| [...]
| 
| NAME  (array-ref, read-only)
| Returns a reference to an array of field names for each
| column. The names may contain spaces but should not be truncated
| or have any trailing space. Note that the names have the letter
| case (upper, lower or mixed) as returned by the driver being
| used. Portable applications should use the NAME_lc entry
| elsewhere in this documentor the NAME_uc entry elsewhere in this
| document.
| 
|   print "First column name: $sth->{NAME}->[0]\n";
| 
| NAME_lc  (array-ref, read-only)
| Like the NAME entry elsewhere in this document but always returns
| lowercase names.
| 
| NAME_uc  (array-ref, read-only)
| Like the NAME entry elsewhere in this document but always returns
| uppercase names.

There are also database-specific ways of doing this.  Note that there
was quite recently a discussion on "DESCRIBE" on this list, which is
basically what you're looking for.

In Oracle, you can query USER_TAB_COLUMNS and friends to get
information about columns in tables (see _Oracle8i Reference_,
(Release 2, 8.1.6, A76961-01)).  In MySQL, you can do similar things
with "SHOW COLUMNS FROM $table":

| $ cat foo
| #!/usr/bin/perl -wl
| 
| use strict;
| use DBI;
| 
| my $dbh = DBI->connect("DBI:mysql:hostname=localhost:database=Tkil_CDs",
|"tkil_ro", "", { RaiseError => 1, PrintError => 1 } );
| my $sth = $dbh->prepare("SHOW COLUMNS FROM Artist");
| $sth->execute();
| $, = "|";
| print @{ $sth->{NAME} };
| while (my $cur = $sth->fetch())
| {
| print @$cur;
| }
| $sth->finish();
| $dbh->disconnect();
| 
| $ ./foo
| Field|Type|Null|Key|Default|Extra
| id|int(10) unsigned||PRI|0|auto_increment
| name|varchar(127)
| sort_key|varchar(127)||MUL||

t.



Re: Problems using DBI !!!

2001-02-23 Thread Michael A. Chase

How did you install DBI and DBD::Oracle?  You appear to be using
ActiveState's Perl in which case PPM should have put everything where it
belonged.

I'd recommend you cut and paste file names and error messages rather than
typing them from memory.

'USE DBI' is not a valid statement.  Perl is case sensitive, use 'use DBI;'
instead.
--
Mac :})
** I normally forward private database questions to the DBI mail lists. **
Give a hobbit a fish and he'll eat fish for a day.
Give a hobbit a ring and he'll eat fish for an age.
- Original Message -
From: "Pablo Rodrigo" <[EMAIL PROTECTED]>
To: "Lista DBI" <[EMAIL PROTECTED]>
Sent: Thursday, February 22, 2001 11:23 AM
Subject: Problems using DBI !!!


I´ve already intalled the DBI and DBD for Oracle.
When I use the command " USE DBI " in my script occurs an error
The system doesn´t find the dynamic link to PerlCRT.dll in the path

Error:Can´t load C:/Perl/site/lib/auto/DBI/DBI.dll for module DBI:
load_file.

This error occurs at line 200 in c:/Perl/lib/DunaLoader.pm

Do I have to configure something after install DBI and DBD-Oracle ?





Re: script retrieval of column names

2001-02-23 Thread Ken Speich

I dunno about mysql, but in Oracle you can do the following:

select column_name from user_tab_columns where table_name = 'blah'

where 'blah' is the name of the table whose columns you need to
have.  Make sure that your table name is in all upper case, because this
is how Oracle keeps them in this column.

Once you run through this query, you should be able to step through it and
get each column.  You can also select the column length, it's nullable
attributes, and other stuff from it as well... at a SQL prompt, describe
the view to see what it holds...

user_tab_columns is an administrator view in Oracle, but normal users
should be able to select from it.

--K

On 23 Feb 2001, Tony Foiani wrote:

#> "Robb" == Robb Garrioch <[EMAIL PROTECTED]> writes:
#
#Robb> Does anyone know of a DBI method ~or~ MySQL specific way that
#Robb> would retrieve the column names of a MySQL database.table
#Robb> dynamically within a Perl script using DBI? or Oracle if known.
#
#Probably the most portable way to do this is by selecting * from a
#table (you can use a condition like "WHERE NULL = NULL" to avoid
#actually getting any data).  After that, you can use $sth->{NAME}.
#>From perldoc DBI:
#
#| Statement Handle Attributes
#| 
#| This section describes attributes specific to statement
#| handles. Most of these attributes are read-only.
#| 
#| [...]
#| 
#| NAME  (array-ref, read-only)
#| Returns a reference to an array of field names for each
#| column. The names may contain spaces but should not be truncated
#| or have any trailing space. Note that the names have the letter
#| case (upper, lower or mixed) as returned by the driver being
#| used. Portable applications should use the NAME_lc entry
#| elsewhere in this documentor the NAME_uc entry elsewhere in this
#| document.
#| 
#|   print "First column name: $sth->{NAME}->[0]\n";
#| 
#| NAME_lc  (array-ref, read-only)
#| Like the NAME entry elsewhere in this document but always returns
#| lowercase names.
#| 
#| NAME_uc  (array-ref, read-only)
#| Like the NAME entry elsewhere in this document but always returns
#| uppercase names.
#
#There are also database-specific ways of doing this.  Note that there
#was quite recently a discussion on "DESCRIBE" on this list, which is
#basically what you're looking for.
#
#In Oracle, you can query USER_TAB_COLUMNS and friends to get
#information about columns in tables (see _Oracle8i Reference_,
#(Release 2, 8.1.6, A76961-01)).  In MySQL, you can do similar things
#with "SHOW COLUMNS FROM $table":
#
#| $ cat foo
#| #!/usr/bin/perl -wl
#| 
#| use strict;
#| use DBI;
#| 
#| my $dbh = DBI->connect("DBI:mysql:hostname=localhost:database=Tkil_CDs",
#|"tkil_ro", "", { RaiseError => 1, PrintError => 1 } );
#| my $sth = $dbh->prepare("SHOW COLUMNS FROM Artist");
#| $sth->execute();
#| $, = "|";
#| print @{ $sth->{NAME} };
#| while (my $cur = $sth->fetch())
#| {
#| print @$cur;
#| }
#| $sth->finish();
#| $dbh->disconnect();
#| 
#| $ ./foo
#| Field|Type|Null|Key|Default|Extra
#| id|int(10) unsigned||PRI|0|auto_increment
#| name|varchar(127)
#| sort_key|varchar(127)||MUL||
#
#t.
#

-- 
Ken Speich
Manager, Network Surveillance Tools
[EMAIL PROTECTED]  301-598-0500 x2637

"How can you shoot the devil in the back? What if you miss?"




DBI just hangs in test

2001-02-23 Thread john ctr kelly

I'm having problems posting this message, apologize if dups occurred.

I am having a problem building  DBD-Oracle-1.06 on a linux 6.2 system
I am using perl 5.00503 and DBI 1.14.

I hang in the make test with:
csr reassigned (forces destruction)...
Fetch list of tables:
Fetched: DUAL
Fetched: SYSTEM_PRIVILEGE_MAP
Fetched: TABLE_PRIVILEGE_MAP
Fetched: STMT_AUDIT_OPTION_MAP
Test ora_do with harmless non-select statement (set transaction read only)
Expect an 'ORA-01453' error message:
csr out of scope...
ora_logoff...
lda out of scope...

Testing repetitive connect/open/close/disconnect:
Expect sequence of digits, no other messages:
1

Sometimes I see 2 or 3 but perl is spinning and nolonger connected to the
local database and I have to kill it.

--
I have included the log files of the perl Makefile.PL -v , make, make test
VERBOSE=1

I have received several warnings but not sure how to handle it (if any).
All other previous test complete with OK
I have tried tried building with -p and -8 but always get the same results.

during perl Makefile.PL I recieved the following messages:
Discovering Oracle OCI build rules...
Oracle oci build prolog:
/u01/oracle8i/OraHome1/rdbms/demo/demo_rdbms.mk:1950: warning:
overriding commands for target `libclntsh.so'
/u01/oracle8i/OraHome1/rdbms/demo/demo_rdbms.mk:1873: warning:
ignoring old commands for target `libclntsh.so'
Building client shared library libclntsh.so ...
and
Using DBI 1.14 installed in
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBI
Writing Makefile for DBD::Oracle

You have a wait.ph file generated by perl h2ph utility.
It does not define a WCOREDUMP function. That's probably an error.
If a DBD::Oracle test fails then you will probably see a message
from Test::Harness about WCOREDUMP being undefined. You can either ignore
it or try to fix your wait.ph file. The message does not reflect the
cause of the test failure, it's just a problem interpreting the failure.

I see no reference to WCOREDUMP in any of the make or make test runs

my full perl version is :
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
osname=linux, osvers=2.2.5-22smp, archname=i386-linux
uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2
09:11:51 edt 1999 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='cc', optimize='-O2 -m486 -fno-strength-reduce',
gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Built under linux
  Compiled at Feb  2 2000 15:35:58
  @INC:
/usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005







 makefile_v.log
 make.log
 make_test_v.log


RE: "Solaris patch" message

2001-02-23 Thread Tim Harsch

> -Original Message-
> From: Joshua Baer [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 11:19 AM
> To: Tim Harsch
> Subject: RE: "Solaris patch" message
>
>
> Hi Tim, I'm sorry to bother you, but I have looked on the net and can't
> seem to find the help file for this email list.

send email to: [EMAIL PROTECTED]

>
> Do you know if there is a digest version of the list, and if so how I go
> about signing up for it?

No digest version that I'm aware of.  Just the fine list.  You could write
email filters to sort incoming mail for just the topics you want or
something.

I think you might be missing out though.  There are a lot of really
knowledgeable people on the list and reading the mail has done a lot to
"contribute to the Perl vault between my ears" as one user put it.

>
> Thanks,
>
> ~Josh
>
> At 01:54 PM 2/22/2001 -0800, Tim Harsch wrote:
> >I missed the link:
> >"A great many references for the Perl DBI can be found on the
> Hermetica Web
> >Server. "
> >on the DBI sign up page
> >http://www.fugue.com/dbi/
> >
> >I don't think that is very clear way to point new users to the archives.
> >
> > > -Original Message-
> > > From: Tim Harsch [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 22, 2001 1:50 PM
> > > To: Hodgson Darin
> > > Cc: [EMAIL PROTECTED]
> > > Subject: RE: "Solaris patch" message
> > >
> > >
> > > it is with the DBD::Oracle distribution that you downloaded.
> > >
> > > I also didn't know how to find the archives since the list
> has undergone
> > > some changes.  So I started at www.perl.org and came accross
> the mail list
> > > sign up page.  There was no link there and some web errors so
> I reported
> > > them to the administrator.
> > >
> > > Perhaps someone on the list can tell you where to find them.
> > >
> > > -Original Message-
> > > From: Hodgson Darin [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 22, 2001 1:10 PM
> > > To: 'Tim Harsch'
> > > Subject: RE: "Solaris patch" message
> > >
> > >
> > > I'm new to using this resource so I'm not sure how to search
> through the
> > > archives?  Also, I searched for the "README.java" file on my
> > > system and was
> > > unable to locate it.
> > > Darin
> > > -Original Message-
> > > From: Tim Harsch [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 22, 2001 12:28 PM
> > > To: Hodgson Darin; [EMAIL PROTECTED]
> > > Subject: RE: "Solaris patch" message
> > >
> > >
> > > See README.java
> > > search these archives for "Solaris patch"
> > > > -Original Message-
> > > > From: Hodgson Darin [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, February 22, 2001 10:56 AM
> > > > To: '[EMAIL PROTECTED]'
> > > > Subject: "Solaris patch" message
> > > >
> > > >
> > > > I was hoping to get a little help/advice with a strange error
> > > > message I am receiving while running a perl script containing DBI
> > > > calls.  The error message is: "You must install a Solaris patch
> > > > to run this version of the Java runtime. Please see the README
> > > > and release notes for more information.".
> > > > Here is some background information about the environment I am
> > > > running on and the script I was running.  Our system is a Sun
> > > > machine running Solaris 2.8, Oracle RDBMS 8.1.6, OAS 4.0.8.2, DBI
> > > > 1.14, DBD 10.8, perl 5.005_03.  The script I was running is
> > > > oracletool.pl freely available on the internet.  I was using the
> > > > oracletool.pl script successfully on this system with everything
> > > > else being the same except the version of OAS was 4.0.8.  It
> > > > worked perfectly before I upgraded to OAS 4.0.8.2.
> > > > I also ran the dbish program to see if I get the same error.
> > > > Once I selected the DBI driver I did get the exact same error.
> > > > Any help you can provide would be appreciated.
> > > > Darin P. Hodgson
> > > > Ogden Development Center
> > > > (801) 620-4120
> > > >
> > > >
> > >
> > >
>
>




Re: "Solaris patch" message

2001-02-23 Thread Elaine -HFB- Ashton

Tim Harsch [[EMAIL PROTECTED]] quoth:
*>>
*>> Do you know if there is a digest version of the list, and if so how I go
*>> about signing up for it?
*>
*>No digest version that I'm aware of.  Just the fine list.  You could write
*>email filters to sort incoming mail for just the topics you want or
*>something.

There is a digest available for all the dbi lists.

Read the help message or just send an empty email to
[EMAIL PROTECTED] and send an empty email to
[EMAIL PROTECTED] to removeyourself from the regular list.

http://lists.cpan.org/ has sub/unsub and post addresses of all the dbi
lists.

e.



Re: Magical Headers and Unsubscribing

2001-02-23 Thread Tommy Wareing

On Fri, Feb 23, 2001 at 09:26:34AM -0600, Ken Crow wrote:
> I am using outlook, and I set a rule that works perfectly.  I put
> [EMAIL PROTECTED] as a contact, and make a rule that if an email is sent to
> dbi-users, it goes into my DBI folder.  Hope this helps.
> 
> Ken

I'm using procmail, and used to use
Sender: [EMAIL PROTECTED]

Now I use 
List-Unsubscribe: 

Which distinguishes between a copy sent to me directly, and a copy
sent via the list. But I'm not a fan of the Unsubscribe header :(

-- 
Tommy Wareing
This .sig deliberately left blank



MS SQL 7 and identity columns insert problem

2001-02-23 Thread Steve Howard

Has anyone been successful in doing explicit inserts into columns with
identity properties from PERL?  I would appreciate any help, or any
experience anyone has had with this.

I am using dbi with dbd::odbc, and MS SQL 7.0. autocommit is left on the
default (off). I have thus far tried unsuccessfully two different ways to do
this.
The first way is as follows:

$sth = $dbh->prepare(qq{SET identity_insert $target..$table ON});
$sth->execute() || print "$target..$table does not have the identity
property \n";

my $insert=qq{INSERT INTO $target..$table ($columnlist) SELECT
$columnlist FROM $source..$table};
my $sth = $dbh->prepare($insert);
$sth->execute || die "Can't execute ($insert): $dbh->errstr";



This prints the message I specified for all tables that do not have identity
property, and the insert works perfectly on them. When it hits a table with
an identity column, even though I have set identity insert on for that
table - and that is session-specific normally - I still get the error
telling me:

Cannot insert explicit value for identity column in table
 when IDENTITY_INSERT is set to off.



The second way I have tried (Doesn't really make sense that a table property
can be set here, but if it can, I don't have it right) is to connect as so:

my $dbh = DBI->connect($dsn, $db_user, $db_password,
{IDENTITY_INSERT=>1});

This does not produce an error - it just doesn't work.

In our case a DTS package to do this migration will be much less flexible,
and much more work for the number of databases, and possible situations than
what we have almost worked out. I would appreciate any help as this is too
close to perfection to be hung on this detail at this point in the project.



Thanks,



Steve Howard




Re: MS SQL 7 and identity columns insert problem

2001-02-23 Thread Michael Peppler

Steve Howard writes:
 > Has anyone been successful in doing explicit inserts into columns with
 > identity properties from PERL?  I would appreciate any help, or any
 > experience anyone has had with this.
 > 
 > I am using dbi with dbd::odbc, and MS SQL 7.0. autocommit is left on the
 > default (off). I have thus far tried unsuccessfully two different ways to do
 > this.
 > The first way is as follows:
 > 
 > $sth = $dbh->prepare(qq{SET identity_insert $target..$table ON});
 > $sth->execute() || print "$target..$table does not have the identity
 > property \n";

 > table - and that is session-specific normally - I still get the error
 > telling me:
 > 
 > Cannot insert explicit value for identity column in table
 >  when IDENTITY_INSERT is set to off.

My guess is that you are getting different physical
connections/sessions. I don't know how/why this happens, though, so it
won't help you much, I'm afraid.

Michael
-- 
Michael Peppler - Data Migrations Inc. - [EMAIL PROTECTED]
http://www.mbay.net/~mpeppler - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: [EMAIL PROTECTED]



FW: MS SQL 7 and identity columns insert problem

2001-02-23 Thread Steve Howard

Sorry, a possibly significant typo in my originalautocommit is left on
the default (ON)- not off.

Thanks,

Steve Howard

Has anyone been successful in doing explicit inserts into columns with
identity properties from PERL?  I would appreciate any help, or any
experience anyone has had with this.

I am using dbi with dbd::odbc, and MS SQL 7.0. autocommit is left on the
default (off). I have thus far tried unsuccessfully two different ways to do
this.
The first way is as follows:

$sth = $dbh->prepare(qq{SET identity_insert $target..$table ON});
$sth->execute() || print "$target..$table does not have the identity
property \n";

my $insert=qq{INSERT INTO $target..$table ($columnlist) SELECT
$columnlist FROM $source..$table};
my $sth = $dbh->prepare($insert);
$sth->execute || die "Can't execute ($insert): $dbh->errstr";



This prints the message I specified for all tables that do not have identity
property, and the insert works perfectly on them. When it hits a table with
an identity column, even though I have set identity insert on for that
table - and that is session-specific normally - I still get the error
telling me:

Cannot insert explicit value for identity column in table
 when IDENTITY_INSERT is set to off.



The second way I have tried (Doesn't really make sense that a table property
can be set here, but if it can, I don't have it right) is to connect as so:

my $dbh = DBI->connect($dsn, $db_user, $db_password,
{IDENTITY_INSERT=>1});

This does not produce an error - it just doesn't work.

In our case a DTS package to do this migration will be much less flexible,
and much more work for the number of databases, and possible situations than
what we have almost worked out. I would appreciate any help as this is too
close to perfection to be hung on this detail at this point in the project.



Thanks,



Steve Howard





best way to select 1 row

2001-02-23 Thread Rolf Kamp

I have a method in a type that I invoke to return one and only one row
with just one value. As with Perl, there's more thatn one way to do it
and I want to make sure I use the best (fastest/most efficient) way to
get the result.

Is it using selectrow_array as:
$value = $dbh->selectrow_array("select s.getcharge('F',24) from site s
where sid=1");
die "bad result from getcharge" unless defined $value;
die "bad value given to  getcharge" unless $value != -1;

or with seelctcol_arrayref as:
$value = $dbh->selectcol_arrayref("select s.getcharge('R',24) from site
s where
sid=30");

Any help is appreicated.






Help in installing DBD::InterBase

2001-02-23 Thread Mirek Rewak

Hi,
I've got problems in compiling DBD::InterBase: make test says:
PERL_DL_NONLAZY=1 /usr/local/perl5.6/bin/perl -Iblib/arch -Iblib/lib
 -I/usr/local/perl5.6//lib/5.6.0/i686-linux -I/usr/local/perl5.6//lib/5.6.0
 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/00baseinstall_driver(InterBase) failed:
  Can't load 'blib/arch/auto/DBD/InterBase/InterBase.so' for module DBD::InterBase:
  blib/arch/auto/DBD/InterBase/InterBase.so: undefined symbol: isc_dsql_execute at
  /usr/local/perl5.6//lib/5.6.0/i686-linux/DynaLoader.pm line 200.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at t/00base.t line 38
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 4-5
Failed 2/5 tests, 60.00% okay
Of course I ran make before and set required variables.
My config: Debian Potato, InterBaseSS_LI 6.0.1, Perl 5.6, DBI 1.14, DBD::InterBase 0.21

Regards
Mirek Rewak
[EMAIL PROTECTED]