Re: Perl and Postgres
Alex Pilosov wrote: On Wed, 11 Jul 2001, Wim De Hul wrote: I'm trying to install DBI 1.18 on a Sparc Solaris 8 server but I still get the following error: snip /usr/perl5/5.00503/ExtUtils/xsubpp -typemap /usr/perl5/5.00503/ExtUtils/typemap Perl.xs xstmp.c mv xstmp.c Perl.c cc -c -xO3 -xdepend-DVERSION=\1.18\ -DXS_VERSION=\1.18\ -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE -DDBI_NO_THREADS Perl.c /usr/ucb/cc: language optional software package not installed Solaris doesn't come with a C compiler. If you installed GCC, try doing: CC=gcc perl Makefile.PL If you haven't installed gcc, install gcc. :) -alex Hello, I tried to use the gcc -compiler (it is installed on my Sun and the dir is in my $PATH) but after the CC=gcc perl Makefile.PL, the make still refers to the old c-compiler (/usr/ucb/cc). Why doesn't the makefile contains the gcc-compiler? Is there a way to compile it anyway with the gcc-compiler? Thanx in advance... Wim
Re: Single value
In a scalar context, fetchrow_array returns the value of the first field. $val = $sth-fetchrow_array; Alternatively, you could use a bind_col thus: my $val; $sth-bind_col(1, $val); while ($sth-fetch) { print $val\n; } -- Simon Oliver
RE: switching to a different database from a DSN to INFORMIX database
When defining a new DSN, you need to supply a database name to connect to by defualt, so it is just the defualt database, that means that I can connect to any database on the Informix server where the defualt database resides. The question here, how? It seems that I am a lecturer :-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 11, 2001 5:42 PM To: [EMAIL PROTECTED] Subject: RE: switching to a different database from a DSN Some databases allow you to share tables form others, so you could try that, I think that it is called a Database Link. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 11 July 2001 14:18 To: [EMAIL PROTECTED] Subject: switching to a different database from a DSN Hi all, I am using DBI::ODBC on windows platform to access Informix database. I defend database x when I created the DSN. Is there a way to switch to a database different from the one defined when creating the DSN. In other words use the same DSN to access all the database on the same database server. $dbh = DBI-connect(dbi:ODBC:myDSN,,,\%attr);
Re: Perl and Postgres
Wim De Hul wrote: I tried to use the gcc -compiler (it is installed on my Sun and the dir is in my $PATH) but after the CC=gcc perl Makefile.PL, I might be wrong. But if you use Solaris and your shell is (t)csh (and not bash or ksh), then CC=gcc perl Makefile.PL won't work. Try perl Makefile.PL and then env CC=/full/path/to/bin/gcc make And also are you sure, that your perl is built with the same gcc? the make still refers to the old c-compiler (/usr/ucb/cc). Why doesn't the makefile contains the gcc-compiler? Is there a way to compile it anyway with the gcc-compiler?
Re: Problem with Oracle Intermedia using DBI-DBD modules
On Tue, Jul 03, 2001 at 04:35:44PM -0400, Madani, Bardia (B.) wrote: I am trying to work with Oracle Intermedia and DBI. I have posted this problem to DBI mailing list, unfortunately no one replied. I hope you can help me. Here is the issue: The Intermedia queries are little different from regular SQL statements. Example of Intermedia Query: [ select MY_TEXT_COL from MY_TABLE where (contains (MY_TEXT_COL,'FOO') 0; ] The DBI prepare statement doesn't return any error. But DBI execute returns this error : Can't execute Query ORA-00904: invalid column name (DBD ERROR: OCIStmtExecute) The Intermedia queries work fine in sqlplus. I am wondering if DBI can handle Intermedia queries? Send me the output of adding $dbh-trace(9,'dbitrace.log') before the prepare() call. Tim.
Writing LONG to DBI::Pg
Hi Can anyone enlighten me? I'm trying to insert a field with 4000 characters into a Pg database which is specified as varchar(4000). I've overcome various hurdles but it produces the following error as soon as it encounters the LONG field: DBD::Pg::st execute failed: PQsendQuery() -- There is no connection to the backend. I've referred to the Programming Perl DBI book and it states: p306: No Bind output values - is this what's causing the problem p307: TEXT datatype has limit of 4096 - is this true? p221: Suggest that I could use: $sth-bind_param(5, 'Introduction', SQL_LONGVARCHAR); but p311: tells me that SQL_LONGVARCHAR is not supported by DBI::Pg. Is there a way to insert LONG data into Pg? Ian
ORA-01008 on Oracle7 with DBD::Oracle v1.07
All, I am getting an ORA-01008 when using bind variables on Oracle7 instances, but not on Oracle8 instances. This has happened on both Unix and Linux OS's. Here is the error: DBD::Oracle::db prepare failed: ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute/Describe) at ddl_test.pl line 40, STDIN chunk 3. This was not happening with prior versions of DBD::Oracle (back with 1.06, I think). Attached is a small test script. Would those of you with a little time please see if you can confirm/deny that you also do/don't get the same error? Also attached is a trace from a failed execution on a Unix host. Thanks! Richard = Richard Sutherland [EMAIL PROTECTED] It doesn't get any easier, you just go faster. -- Greg LeMond __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ #! /usr/bin/perl -w use strict; use DBI; use DDL::Oracle; DBI-trace(3,dbi.trc); print STDERR Enter SID: ; chomp( my $sid = STDIN ); die \nYou must specify a Database SID.\n unless $sid; print STDERR Enter USER: ; chomp( my $user = STDIN ); die \nYou must specify a Username.\n unless $user; print STDERR Enter PASSWORD: ; chomp( my $password = STDIN ); die \nYou must specify a Password.\n unless $password; my $dbh = DBI-connect( dbi:Oracle:$sid, $user, $password, { PrintError = 0, RaiseError = 1 } ); my $stmt = SELECT * FROM dual WHERE dummy = ? ; my $val = 'X'; my $sth = $dbh-prepare( $stmt ); $sth-execute( $val ); my $dummy = $sth-fetchrow_array; print dummy = $dummy\n; DBI 1.08 dispatch trace level set to 3 - DBI-connect(dbi:Oracle:ci_tw1_tst, rsutherl, pebb3343, HASH(0x140002068)) - DBI-install_driver(Oracle) for perl=5.00404 pid=29011 ruid=217 euid=217 install_driver: DBD::Oracle loaded (version 1.06) New DBI::dr (for DBD::Oracle::dr, parent=, id=) dbih_setup_handle(DBI::dr=HASH(0x14010db78)=DBI::dr=HASH(0x1403030e8), DBD::Oracle::dr, 0, Null!) dbih_make_com(Null!, DBD::Oracle::dr, 152) - install_driver= DBI::dr=HASH(0x14010db78) - connect for DBD::Oracle::dr (DBI::dr=HASH(0x14010db78)~0x1403030e8 'ci_tw1_tst' 'rsutherl' 'pebb3343' HASH(0x140050468)) New DBI::db (for DBD::Oracle::db, parent=DBI::dr=HASH(0x1403030e8), id=) dbih_setup_handle(DBI::db=HASH(0x140303028)=DBI::db=HASH(0x1403030d8), DBD::Oracle::db, 14010d908, Null!) dbih_make_com(DBI::dr=HASH(0x1403030e8), DBD::Oracle::db, 192) - connect= DBI::db=HASH(0x140303028)0keys at DBI.pm line 374. - STORE for DBD::Oracle::db (DBI::db=HASH(0x1403030d8)~INNER 'RaiseError' 1) STORE DBI::db=HASH(0x1403030d8) 'RaiseError' = 1 - STORE= 1 at DBI.pm line 399. - STORE for DBD::Oracle::db (DBI::db=HASH(0x1403030d8)~INNER 'PrintError' 0) STORE DBI::db=HASH(0x1403030d8) 'PrintError' = 0 - STORE= 1 at DBI.pm line 399. - STORE for DBD::Oracle::db (DBI::db=HASH(0x1403030d8)~INNER 'AutoCommit' 1) - STORE= 1 at DBI.pm line 399. - connect= DBI::db=HASH(0x140303028) - prepare for DBD::Oracle::db (DBI::db=HASH(0x140303028)~0x1403030d8 ' SELECT * FROM dual WHERE dummy = ? ') New DBI::st (for DBD::Oracle::st, parent=DBI::db=HASH(0x1403030d8), id=) dbih_setup_handle(DBI::st=HASH(0x140303078)=DBI::st=HASH(0x140050528), DBD::Oracle::st, 140303088, Null!) dbih_make_com(DBI::db=HASH(0x1403030d8), DBD::Oracle::st, 336) dbd_preparse scanned 1 distinct placeholders dbd_st_prepare'd sql SELECT dbd_describe SELECT (EXPLICIT, lb 80)... ERROR EVENT -1 'ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute/Describe)' (Handlers: ARRAY) - prepare= undef at ddl_test.pl line 40. !! ERROR: -1 'ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute/Describe)' DESTROY ignored for outer handle DBI::db=HASH(0x140303028) (inner DBI::db=HASH(0x1403030d8)) DESTROY ignored for outer handle DBI::st=HASH(0x140303078) (inner DBI::st=HASH(0x140050528)) - DESTROY for DBD::Oracle::st (DBI::st=HASH(0x140050528)~INNER) - DESTROY= undef at unknown location! - DESTROY for DBD::Oracle::db (DBI::db=HASH(0x1403030d8)~INNER) - DESTROY= undef at unknown location! - DBI::END - disconnect_all for DBD::Oracle::dr (DBI::dr=HASH(0x14010db78)~0x1403030e8) - disconnect_all= '' at DBI.pm line 416. - DBI::END complete - DESTROY in DBD::_::common for DBD::Oracle::dr (DBI::dr=HASH(0x1403030e8)~INNER) - DESTROY= undef during global destruction. DESTROY for DBI::dr=HASH(0x14010db78) ignored (inner handle gone) DBI 1.08 dispatch trace level set to 3 - DBI-connect(dbi:Oracle:ci_tw3_dev, rsutherl, pebb3343, HASH(0x140002068)) - DBI-install_driver(Oracle) for perl=5.00404 pid=25312
Regexp / Sql-perl problem.
Hi guys, I'have an SQL database with a lot of email and name.. from user who registred into. I'd like to do statistics, about mail adresse after the @, you know the 'domain'. So i have this : Id - EMail : 1 - [EMAIL PROTECTED] 12 - [EMAIL PROTECTED] 11 - [EMAIL PROTECTED] 121 - [EMAIL PROTECTED] 52 - [EMAIL PROTECTED] 151 - [EMAIL PROTECTED] 2 - [EMAIL PROTECTED] How should i extract : tata.com, titi.com, and may by count them ? If you have an idea you'll be verry happy ! The other way could be to select all email adresse and regex them do ++ count, and them display, but later it'll take to much of time :/ So do you avec any idea ? -- =-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-= Nicolas JOURDEN #41100039 - +33 0681940905 http://www.wedoo.com - http://ddx.ovh.org Programmeur Perl, CGI, Mysql/PostgreSQL, HTML, JavaScript... =-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=
DBD:Oracle install problem on compaq true64unix
Hi every one, I have excactly the same problem as this message in the archive, but it seems that there were no answers. Is there something I've missed or will I need to dig realy deep into this problem? DBD:Oracle Install problem on Tru64 To: [EMAIL PROTECTED] Subject: DBD:Oracle Install problem on Tru64 From: Ali Zaidi [EMAIL PROTECTED] Date: Fri, 22 Jun 2001 14:05:23 -0400 Delivered-To: mailing list [EMAIL PROTECTED] Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Reply-to: [EMAIL PROTECTED] - cut - \pgj -- Peter Gylling Jørgensen Modelling group, section of Oceanography Royal Danish Administration of Navigation and Hydrography Overgaden o. Vandet 62B DK-1023 København K Phone: +45 32 68 96 85 Email: [EMAIL PROTECTED] www: http://www.fomfrv.dk/
Re: ORA-01008 on Oracle7 with DBD::Oracle v1.07
Are you sure what versions you have?? Richard Sutherland wrote: All, I am getting an ORA-01008 when using bind variables on Oracle7 instances, but not on Oracle8 instances. This has happened on both Unix and Linux OS's. Here is the error: DBD::Oracle::db prepare failed: ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute/Describe) at ddl_test.pl line 40, STDIN chunk 3. This was not happening with prior versions of DBD::Oracle (back with 1.06, I think). From your trace: DBI 1.08 dispatch trace level set to 3 - DBI-connect(dbi:Oracle:ci_tw1_tst, rsutherl, pebb3343, HASH(0x140002068)) - DBI-install_driver(Oracle) for perl=5.00404 pid=29011 ruid=217 euid=217 install_driver: DBD::Oracle loaded (version 1.06) Try upgrading to the current version of DBI/DBD::Oracle I am not sure of the latest version, but I have DBI-1.18 and DBD::Oracle 1.07. perl -MDBD::Oracle -e 'print DBD::Oracle-VERSION' perl -MDBD::Oracle -e 'print DBD::Oracle-VERSION' cheers, jeff
RE: Regexp / Sql-perl problem.
Salut, How should i extract : tata.com, titi.com, and may by count them ? If you have an idea you'll be verry happy ! The other way could be to select all email adresse and regex them do ++ count, and them display, but later it'll take to much of time :/ As you say, I would loop: while (rows) { regexp out $domain $hash{$domain}++; } foreach $domain (keys %hash) ... etc If the characteristics of your table are that there are multiple occurrences of each email address you should select count(*),email from ... group by email and modify the ++ accordingly. This would retrieve less rows at the expense of more DB work. Bonne chance, --Rich
Re: ORA-01008 on Oracle7 with DBD::Oracle v1.07
Jeff, Thanks for the response. You're right -- the Unix version I'm using at work is behind. However, the original bug was reported against DDL::Oracle, which uses DBI/DBD::Oracle. That user claimed to be using: I'm running the latest from the latest software: - RedHat 7.1 - DBI-1.18 - DBD-Oracle-1.07 - DDL-Oracle-1.10 - Oracle Client 8.0.5.0.0 He has multiple Oracle instances, too, and reported it OK on Oracle8 but failing on Oracle7. I'll ask him to confirm, but he said he was a new user and had just installed the latest versions of all of the above. Richard --- Jeff Seger [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Are you sure what versions you have?? Richard Sutherland wrote: All, I am getting an ORA-01008 when using bind variables on Oracle7 instances, but not on Oracle8 instances. This has happened on both Unix and Linux OS's. Here is the error: DBD::Oracle::db prepare failed: ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute/Describe) at ddl_test.pl line 40, STDIN chunk 3. This was not happening with prior versions of DBD::Oracle (back with 1.06, I think). From your trace: DBI 1.08 dispatch trace level set to 3 - DBI-connect(dbi:Oracle:ci_tw1_tst, rsutherl, pebb3343, HASH(0x140002068)) - DBI-install_driver(Oracle) for perl=5.00404 pid=29011 ruid=217 euid=217 install_driver: DBD::Oracle loaded (version 1.06) Try upgrading to the current version of DBI/DBD::Oracle I am not sure of the latest version, but I have DBI-1.18 and DBD::Oracle 1.07. perl -MDBD::Oracle -e 'print DBD::Oracle-VERSION' perl -MDBD::Oracle -e 'print DBD::Oracle-VERSION' cheers, jeff = Richard Sutherland [EMAIL PROTECTED] It doesn't get any easier, you just go faster. -- Greg LeMond __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
HPUX 11 Oracle 7.3.4 DBD::Oracle 1.07 error on make step - desc.h undefined
Hi, Having a problem with the DBD::Oracle 1.07 module, on the make step. The box we are running it on is an N class HP Server running HPUX 11.0, trying to link to Oracle 7.3.4. We get the message: cc: dbdimp.c, line 740: error 1588: desc_h undefined. cc: dbdimp.c, line 740: error 1531: Invalid member of struct or union. *** Error exit code 1 (full log below) Have checked with DBA re. $ORACLE_HOME, $ORACLE_SID, $ORACLE_PATH, $LD_LIBRARY_PATH - all confirmed as correct. We have a working install of Perl 5.6.1, built using HP ANSI C compiler on the local machine, accepting all defaults. Also static version of DBI 1.18, created using commands from DBD::Oracles' README.help: perl Makefile.PL LINKTYPE=static make make perl make test FULLPERL=./perl make install Everything seems fine to this point. To install DBD::Oracle, have tried: perl Makefile.PL LINKTYPE=static perl Makefile.PL -p LINKTYPE=static One of my colleagues who knows C has had a look at the dbdimp.c program. desc_h seems to be defined only for OCI 8, we should be picking up 7 with Oracle 7.3.4? From logs below, I'm also not convinced that the static linking is working correctly. Log files: root@uk200:/tmp/perl perl -V Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=hpux, osvers=11.00, archname=PA-RISC2.0 uname='hp-ux uk200 b.11.00 u 9000800 659349332 unlimited-user license ' config_args='-de' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-D_HPUX_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae', optimize='-O', cppflags='-D_HPUX_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae' ccversion='A.11.01.20', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='ld', ldflags =' -Wl,+vnocompatwarnings -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lsec perllibs=-lnsl -lnm -ldld -lm -lc -lndir -lcrypt -lsec libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='+z', lddlflags='-b +vnocompatwarnings -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under hpux Compiled at Jul 11 2001 09:15:35 @INC: /opt/perl5/lib/5.6.1/PA-RISC2.0 /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0 /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl . perl Makefile.PL -V log Using DBI 1.18 installed in /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBI Configuring DBD::Oracle ... Remember to actually *READ* the README file! Especially if you have any problems. Using Oracle in /oracle/app/oracle/product/7.3.4 4.0.1.0.0Oracle Unix Installer 1.0.1.0.0Oracle On-Line Text Viewer 7.3.4.0.0ORACLE NLS Libraries and Utilities 7.3.4.0.0ORACLE Core Libraries 7.3.4.0.0Oracle Common RDBMS Libraries and Utilities 7.3.4.0.0ORACLE PL/SQL Libraries 7.3.4.0.0ORACLE Common Libraries 7.3.4.0.0ORACLE Common Precomp Libraries 7.3.4.0.0ORACLE Common Network Libraries and Utilities 7.3.4.0.0ORACLE Common Trace Libraries 7.3.4.0.0ORACLE Common Utilities 7.3.4.0.0ORACLE Common Libraries and Utilities 7.3.4.0.0Platform specific Libraries and Utilities 2.3.4.0.0SQL*Net (V2) 2.3.4.0.0TCP/IP Protocol Adapter (V2) 1.3.2.0.0Remote Operations 2.1.4.14.0 ToolKit 2.1 Base 7.3.4.0.0SLAX: parser 2.3.4.0.0PL/SQL V2 7.3.4.0.0Oracle7 Distributed Database option 2.3.4.0.0Oracle Server Manager 7.3.4.0.0Oracle7 Server (RDBMS) 1.0.0.0.1Database
Re: Writing LONG to DBI::Pg
On Thu, Jul 12, 2001 at 11:09:33AM +0100, Ian Summers wrote: Can anyone enlighten me? I'm trying to insert a field with 4000 characters into a Pg database which is specified as varchar(4000). I've overcome various hurdles but it produces the following error as soon as it encounters the LONG field: DBD::Pg::st execute failed: PQsendQuery() -- There is no connection to the backend. What versions are you using? DBD::Pg before 0.96 had a long insert bug. Latest is 1.01 . There are a few other bits and pieces that have been fixed too so it's worth installing 1.01 . p307: TEXT datatype has limit of 4096 - is this true? I don't have the book to hand but PostgreSQL has no such limit - before 7.1 there was a row limit settable at compile-time but the default was never smaller than 8 kb. Is there a way to insert LONG data into Pg? In principle there is no problem with what you're trying to do. Richard
Re: Writing LONG to DBI::Pg
Alessio Thank you for your reply - I'm trying to insert data with up to 4000 characters in a single column. Can you have columns defined to allow 4000 characters? More to the point, can you insert data into them with DBI::Pg? The code that produces an error looks like this (trimmed to the bare minimum) - the error I have returned for every row (which may or may not be relevant) is: DBD::Pg::st execute failed: PQsendQuery() -- There is no connection to the backend. #!/usr/bin/perl use strict; use DBI qw (:sql_types); my $table= tblTable; my $database = 'dbi:Pg:dbname=part'; my $user = 'sa'; my $pass = ''; my $dbh = DBI-connect($database, $user, $pass); $dbh-{RaiseError} = 1; $dbh-{LongReadLen} = 4000; $dbh-{LongTruncOk} = 1; print Can't connect to database unless defined $dbh; insert; $dbh-disconnect(); sub insert { my $filein = webdata/tblTable.txt; # on web site @ARGV = $filein; $_ = ; chomp; s/\t/,/g; my @column = split ',', $_; my $insert_sql = INSERT INTO tblTable (.join(', ', @column).) VALUES (.join(', ', map {'?'} @column).); ### This is where I'd like to put the bind parameter so that it will insert data of up to 4000 characters my $insert_sth-bind_param(5, 'Introduction', SQL_LONGVARCHAR); while () { chomp; my @value = split \t, $_; eval { $insert_sth-execute(@value) }; print \nINSERT failed:\n$@\n if $@; } } Ian
Re: Regexp / Sql-perl problem.
In mysql you could do something like : SELECT MID(email, LOCATE(@, email), 999) AS domain, COUNT(*) FROM email_table GROUP BY domain; I'm not sure about MID and LOCATE in other renditions of SQL though. Jon --_=_NextPart_001_01C10ACA.0C606500 Content-Type: text/plain Salut, How should i extract : tata.com, titi.com, and may by count them ? If you have an idea you'll be verry happy ! The other way could be to select all email adresse and regex them do ++ count, and them display, but later it'll take to much of time :/ As you say, I would loop: while (rows) { regexp out $domain $hash{$domain}++; } foreach $domain (keys %hash) ... etc If the characteristics of your table are that there are multiple occurrences of each email address you should select count(*),email from ... group by email and modify the ++ accordingly. This would retrieve less rows at the expense of more DB work. Bonne chance, --Rich --_=_NextPart_001_01C10ACA.0C606500--
RE: Re(2): RE: .htpasswd and DBD::CSV
There are some things to a CSV file, that are not just easily split(), but for .htpasswd file split() might be all you need. Ilya -Original Message- From: Perl DBI [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 1:58 AM To: [EMAIL PROTECTED] Subject: Re(2): RE: .htpasswd and DBD::CSV [EMAIL PROTECTED] writes: Yeah well, to open an .htpasswd you just use split.. open (HT, .htpasswd) or die; while (chomp ($line = HT)) { @flds = split (/:/, $line); # do your DBI stuff } this is easy!! what's the problem? i thought it's like DBD::CSV where i can connect to a CSV file and use SQL. how about DBD::RAM? tnx guys for your answers... they really help me a lot.
RE: Regexp / Sql-perl problem.
All, SELECT MID(email, LOCATE(@, email), 999) AS domain, COUNT(*) FROM email_table GROUP BY domain; Neat. I'm not sure about MID and LOCATE in other renditions of SQL though. In Oracle MID would be SUBSTR but I cannot think of an alternative to LOCATE. Getting off track I s'pose, more of a SQL debate than Perl :( --Rich
Re: Regexp / Sql-perl problem.
Date sent: Thu, 12 Jul 2001 13:01:42 +0200 From: Nicolas JOURDEN [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject:Regexp / Sql-perl problem. Hi guys, I'have an SQL database with a lot of email and name.. from user who registred into. I'd like to do statistics, about mail adresse after the @, you know the 'domain'. So i have this : Id - EMail : 1 - [EMAIL PROTECTED] 12 - [EMAIL PROTECTED] 11 - [EMAIL PROTECTED] 121 - [EMAIL PROTECTED] 52 - [EMAIL PROTECTED] 151 - [EMAIL PROTECTED] 2 - [EMAIL PROTECTED] How should i extract : tata.com, titi.com, and may by count them ? If you have an idea you'll be verry happy ! The other way could be to select all email adresse and regex them do ++ count, and them display, but later it'll take to much of time :/ If you do not want to use a regex, you need the domain name directly from your database. Restructure your table to hold an additional column called domain, and put the domain name in there. Then you can say SELECT COUNT (domain) AS (Number), domain FROM Emails GROUP BY domain; Nevertheless, this may not be absolutely regex-free, because you must extract the domain somehow before inserting it into the table... In addition, this solution may affect the rest of your app... Another possibility is to dump out the whole table as a text file with your database's dumping facility and solve your problem with the classic approach (scanning linewise: chomp; /\@(.*)$/; $frequency{$1}++;) If any of these approaches are faster than just using your database as is, saying my $sql = SELECT EMail FROM $table; ...prepare and execute... while ( my $email = $sth-fetchrow_array) { $email =~ /\@(.*)$/; $frequency{$1}++; } remains a matter of benchmarking... Bodo [EMAIL PROTECTED]
Re: Single value
- Original Message - From: Simon Oliver [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, July 12, 2001 01:33 Subject: Re: Single value In a scalar context, fetchrow_array returns the value of the first field. $val = $sth-fetchrow_array; Alternatively, you could use a bind_col thus: my $val; $sth-bind_col(1, $val); That should be $sth-bind_col(1, \$val); I personally prefer to uset $sth - bind_columns( \( $var ) );. It's a slightly more work for DBI, but I only have to remember one method regardless of the number of columns. while ($sth-fetch) { print $val\n; }
Re: Regexp / Sql-perl problem.
Great not stupid :) Juste a bug need +1, if there no +1 @ caractere is taken... SELECT MID(email, LOCATE(@, email)+1, 999) AS domain, COUNT (*) FROM email_table GROUP BY domain; Thanks a lot. -- Debut du message initial --- De : Jon Barker [EMAIL PROTECTED] A : [EMAIL PROTECTED], [EMAIL PROTECTED] Copies : Date : Thu, 12 Jul 2001 13:43:09 + Objet : Re: Regexp / Sql-perl problem. In mysql you could do something like : SELECT MID(email, LOCATE(@, email), 999) AS domain, COUNT (*) FROM email_table GROUP BY domain; I'm not sure about MID and LOCATE in other renditions of SQL though. Jon --_=_NextPart_001_01C10ACA.0C606500 Content-Type: text/plain Salut, How should i extract : tata.com, titi.com, and may by count them ? If you have an idea you'll be verry happy ! The other way could be to select all email adresse and regex them do ++ count, and them display, but later it'll take to much of time :/ As you say, I would loop: while (rows) { regexp out $domain $hash{$domain}++; } foreach $domain (keys %hash) ... etc If the characteristics of your table are that there are multiple occurrences of each email address you should select count(*),email from ... group by email and modify the ++ accordingly. This would retrieve less rows at the expense of more DB work. Bonne chance, --Rich --_=_NextPart_001_01C10ACA.0C606500--
RE: HPUX 11 Oracle 7.3.4 DBD::Oracle 1.07 error on make step - desc.h undefined
Sorted the problem with reference to earlier posts - was looking at an old archive... -Original Message- From: Stevenson, Jonathan Sent: 12 July 2001 12:19 To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: HPUX 11 Oracle 7.3.4 DBD::Oracle 1.07 error on make step - desc.h undefined Hi, Having a problem with the DBD::Oracle 1.07 module, on the make step. The box we are running it on is an N class HP Server running HPUX 11.0, trying to link to Oracle 7.3.4. We get the message: cc: dbdimp.c, line 740: error 1588: desc_h undefined. cc: dbdimp.c, line 740: error 1531: Invalid member of struct or union. *** Error exit code 1 (full log below) Have checked with DBA re. $ORACLE_HOME, $ORACLE_SID, $ORACLE_PATH, $LD_LIBRARY_PATH - all confirmed as correct. We have a working install of Perl 5.6.1, built using HP ANSI C compiler on the local machine, accepting all defaults. Also static version of DBI 1.18, created using commands from DBD::Oracles' README.help: perl Makefile.PL LINKTYPE=static make make perl make test FULLPERL=./perl make install Everything seems fine to this point. To install DBD::Oracle, have tried: perl Makefile.PL LINKTYPE=static perl Makefile.PL -p LINKTYPE=static One of my colleagues who knows C has had a look at the dbdimp.c program. desc_h seems to be defined only for OCI 8, we should be picking up 7 with Oracle 7.3.4? From logs below, I'm also not convinced that the static linking is working correctly. Log files: root@uk200:/tmp/perl perl -V Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=hpux, osvers=11.00, archname=PA-RISC2.0 uname='hp-ux uk200 b.11.00 u 9000800 659349332 unlimited-user license ' config_args='-de' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-D_HPUX_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae', optimize='-O', cppflags='-D_HPUX_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae' ccversion='A.11.01.20', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='ld', ldflags =' -Wl,+vnocompatwarnings -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lsec perllibs=-lnsl -lnm -ldld -lm -lc -lndir -lcrypt -lsec libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='+z', lddlflags='-b +vnocompatwarnings -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under hpux Compiled at Jul 11 2001 09:15:35 @INC: /opt/perl5/lib/5.6.1/PA-RISC2.0 /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0 /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl . perl Makefile.PL -V log Using DBI 1.18 installed in /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBI Configuring DBD::Oracle ... Remember to actually *READ* the README file! Especially if you have any problems. Using Oracle in /oracle/app/oracle/product/7.3.4 4.0.1.0.0Oracle Unix Installer 1.0.1.0.0Oracle On-Line Text Viewer 7.3.4.0.0ORACLE NLS Libraries and Utilities 7.3.4.0.0ORACLE Core Libraries 7.3.4.0.0Oracle Common RDBMS Libraries and Utilities 7.3.4.0.0ORACLE PL/SQL Libraries 7.3.4.0.0ORACLE Common Libraries 7.3.4.0.0ORACLE Common Precomp Libraries 7.3.4.0.0ORACLE Common Network Libraries and Utilities 7.3.4.0.0ORACLE Common Trace Libraries 7.3.4.0.0ORACLE Common Utilities 7.3.4.0.0ORACLE Common Libraries and Utilities 7.3.4.0.0Platform specific Libraries and Utilities 2.3.4.0.0SQL*Net (V2) 2.3.4.0.0TCP/IP Protocol Adapter (V2) 1.3.2.0.0Remote Operations 2.1.4.14.0 ToolKit 2.1 Base 7.3.4.0.0SLAX: parser
Re: Makefile on DBD::Oracle quits
Rewrite the relevant lines as foreach (qw(mk.pm Oracle.h dbdimp.h ocitrace.h)) { $self-{PM}-{$_} = '$(INST_ARCHAUTODIR)/'.$_; } Tim. On Thu, Jul 12, 2001 at 04:11:14PM +0200, [EMAIL PROTECTED] wrote: Hi Tim, I've tried to run the Makefile.PL under perl version 5.004_01 on an AIX UNIX machine, but all I get is the following error: syntax error at Makefile.PL line 620, near $_ for Execution of Makefile.PL aborted due to compilation errors. Do you know what this means and how I could fix it so I can proceed to step 2? -- version of Oracle: 8.0.5. -- results of perl -V: Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration: Platform: osname=aix, osvers=4.2.1.0, archname=aix uname='aix iavnr4 2 4 002010076700 ' hint=recommended, useposix=true, d_sigaction=define bincompat3=y useperlio= d_sfio= Compiler: cc='cc', optimize='-O', gccversion= cppflags='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/local/include' ccflags ='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/local/include' stdchar='unsigned char', d_stdstdio=define, usevfork=false voidflags=15, castflags=1, d_casti32=define, d_castneg= intsize=4, alignbytes=8, usemymalloc=n, randbits=15 Linker and Libraries: ld='ld', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl -ldbm -ldl -lld -lm -lc -lbsd -lPW libc=/lib/libc.a, so=a useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_aix.xs, dlext=so, d_dlsymun=, ccdlflags='-bE:perl.exp' cccdlflags=' ', lddlflags='-H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).e xp -b noentry -lc -L/usr/local/lib' Characteristics of this binary (from libperl): Built under aix Compiled at Sep 26 1997 16:06:03 @INC: /usr/local/lib/perl5/aix/5.00401 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/aix /usr/local/lib/perl5/site_perl . Cheers, Maurice Dekker --- This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. ABN AMRO Bank N.V. (including its group companies) shall not be responsible nor liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference. ---
Unsatisfied symbols: dbd_phs_sv_complete (code) dbd_phs_avsv_complete (code)
Hi, I'm trying to build a static version of DBD::Oracle on HPUX 11.0, Oracle 7.3.4. Following the instructions in the README, I have installed Perl 5.6.1 with all defaults, DBI as static without any reported problems. Trying to install DBD::Oracle errors during make perl, with the following error: /usr/ccs/bin/ld: Unsatisfied symbols: dbd_phs_sv_complete (code) dbd_phs_avsv_complete (code) *** Error exit code 1 Stop. Log files: Perl -V Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=hpux, osvers=11.00, archname=PA-RISC2.0 uname='hp-ux uk200 b.11.00 u 9000800 659349332 unlimited-user license ' config_args='-de' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-D_HPUX_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae', optimize='-O', cppflags='-D_HPUX_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae' ccversion='A.11.01.20', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='ld', ldflags =' -Wl,+vnocompatwarnings -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lsec perllibs=-lnsl -lnm -ldld -lm -lc -lndir -lcrypt -lsec libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='+z', lddlflags='-b +vnocompatwarnings -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under hpux Compiled at Jul 11 2001 09:15:35 @INC: /opt/perl5/lib/5.6.1/PA-RISC2.0 /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0 /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl . perl Makefile.PL LINKTYPE=static -v Using DBI 1.18 installed in /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBI Configuring DBD::Oracle ... Remember to actually *READ* the README file! Especially if you have any problems. Using Oracle in /oracle/app/oracle/product/7.3.4 4.0.1.0.0Oracle Unix Installer 1.0.1.0.0Oracle On-Line Text Viewer 7.3.4.0.0ORACLE NLS Libraries and Utilities 7.3.4.0.0ORACLE Core Libraries 7.3.4.0.0Oracle Common RDBMS Libraries and Utilities 7.3.4.0.0ORACLE PL/SQL Libraries 7.3.4.0.0ORACLE Common Libraries 7.3.4.0.0ORACLE Common Precomp Libraries 7.3.4.0.0ORACLE Common Network Libraries and Utilities 7.3.4.0.0ORACLE Common Trace Libraries 7.3.4.0.0ORACLE Common Utilities 7.3.4.0.0ORACLE Common Libraries and Utilities 7.3.4.0.0Platform specific Libraries and Utilities 2.3.4.0.0SQL*Net (V2) 2.3.4.0.0TCP/IP Protocol Adapter (V2) 1.3.2.0.0Remote Operations 2.1.4.14.0 ToolKit 2.1 Base 7.3.4.0.0SLAX: parser 2.3.4.0.0PL/SQL V2 7.3.4.0.0Oracle7 Distributed Database option 2.3.4.0.0Oracle Server Manager 7.3.4.0.0Oracle7 Server (RDBMS) 1.0.0.0.1Database Startup Load Files 7.3.4.0.0Oracle Intelligent Agent 7.3.4Oracle Trace 7.3.4.0.0Precomp 2.2.4.0.0Pro*C 1.8.4.0.0Pro*COBOL 1.1.5.0.0SQL*Module 1.1.5.0.0SQL*Module for C 3.3.4.0.0SQL*Plus 2.1.4.14.0 ToolKit 2.1 Extension 2.0.5.4.0Multimedia APIs 2.1.1.0.0Oracle Help 2.1.3.0.0Oracle Office Automation Core
Commit-Problem
Hi, as I am new on the list, I try to follow all the rules, if not please tell me. While I am using the following comands to change data in an Oracle DB ... while ($z $z_max){ $quoteddatum = $dbho3-quote( $mydatum[$z] ); $dbho3-do(UPDATE Wartungstermine SET Datum = $quoteddatum WHERE Lfdnummer = $myid[$z]); $dbho3-commit() or die Commit hat nicht geklappt!; $z++; } $dbo3-disconnect; the changed data could only be read from the Oracle after the exit(); of the perl-script but not while the program is still running. I have already tried all the possibilties with AutoCommit and so on but nothing helped. But doing the same with our MySQL I don't have any problems with the commit. Any ideas, what I could have forgotten? Thomas
RE: Commit-Problem
What version of DBI/DBD::Oracle are you using? The most likely reason MySQL works fine is because it did not support transaction until recently, so everything was automatically commited. Depending on the version you are using and weather you are using BSD tables, transaction are most likely not supported. Ilya -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 07/12/2001 9:04 AM Subject: Commit-Problem Hi, as I am new on the list, I try to follow all the rules, if not please tell me. While I am using the following comands to change data in an Oracle DB ... while ($z $z_max){ $quoteddatum = $dbho3-quote( $mydatum[$z] ); $dbho3-do(UPDATE Wartungstermine SET Datum = $quoteddatum WHERE Lfdnummer = $myid[$z]); $dbho3-commit() or die Commit hat nicht geklappt!; $z++; } $dbo3-disconnect; the changed data could only be read from the Oracle after the exit(); of the perl-script but not while the program is still running. I have already tried all the possibilties with AutoCommit and so on but nothing helped. But doing the same with our MySQL I don't have any problems with the commit. Any ideas, what I could have forgotten? Thomas
AW: Commit-Problem
What version of DBI/DBD::Oracle are you using? I am using version of DBD 1.07 for Oracle The most likely reason MySQL works fine is because it did not support transaction until recently, so everything was automatically commited. Depending on the version you are using and weather you are using BSD tables, transaction are most likely not supported. Yes, first I was running it with AutoCommit =1 like with the MySQL but this also didn't work. It just should be a simple data update without huge transaction comfort. -Original Message- ... While I am using the following comands to change data in an Oracle DB ... while ($z $z_max){ $quoteddatum = $dbho3-quote( $mydatum[$z] ); $dbho3-do(UPDATE Wartungstermine SET Datum = $quoteddatum WHERE Lfdnummer = $myid[$z]); $dbho3-commit() or die Commit hat nicht geklappt!; $z++; } $dbo3-disconnect; the changed data could only be read from the Oracle after the exit(); of the perl-script but not while the program is still running. I have already tried all the possibilties with AutoCommit and so on but nothing helped. But doing the same with our MySQL I don't have any problems with the commit. Any ideas, what I could have forgotten? Thomas
Re: Access MSSQL from Unix using DBI
You can also use DBD::Sybase and the freetds libraries. On Thu, Jul 12, 2001 at 12:59:03AM -0400, Sterin, Ilya [EMAIL PROTECTED] wrote: Well, what have you tried?? You can either install third party ODBC software and use DBD::ODBC or use DBD::Proxy and DBI::ProxyServer. Ilya -Original Message- From: Venkataramana Mokkapati [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 12:41 AM To: [EMAIL PROTECTED] Subject: Access MSSQL from Unix using DBI I guess, it should be possible. But I have NOT been able to accomplish this. Any clue/help will be greatly appreciated. Thanks, MVRamana _ Get your FREE download of MSN Explorer at http://explorer.msn.com -- David Good [EMAIL PROTECTED] This space intentionally left blank.
Re: .htpasswd and DBD::CSV
Perl DBI wrote: i thought it's like DBD::CSV where i can connect to a CSV file and use SQL. how about DBD::RAM? Actually DBD::RAM has been replaced by DBD::AnyData, and both of them will do what you want -- allow you to run SQL on a .htpasswd file. Here's how: use DBI; my $dbh = DBI-connect('dbi:AnyData:(RaiseError=1)'); my $flags = { col_names = 'user,pass', sep_char = ':' }; my $file = '.htpasswd'; # this could also be an absolute path # or even a url of a file on a remote machine $dbh-func( 'htp', 'CSV', $file, $flags, 'ad_catalog'); print $dbh-selectrow_array(SELECT pass FROM htp WHERE user = 'jeff'); # # ... any other DBI commands using AnyData's subset of SQL In addition to providing SQL access, this method has other advantages over the Text_CSV approach including things like flock (if supported on your platform) and verbose error reporting of file access problems. You could of course also code those by hand, but why bother? -- Jeff
Re: .htpasswd and DBD::CSV
Orlando Andico wrote: in my experience DBD::CSV can be iffy. I just use Text::CSV_XS (where you can better control delimiters and stuff) Sorry, but AFAIK that just ain't true. DBD::CSV *uses* Text::CSV_XS and anything you can set directly in Text_CSV_XS you can set through DBD::CSV including the field and record separators and escape characters. Whether DBD::CSV tells your settings to Text::CSV_XS or you tell them to Text::CSV_XS yourself is fairly irrelevant. and DBD::RAM. =) Which is now DBD::AnyData and which also allows you to set any delimiters, separators, or escape characters that you can set in Text::CSV_XS as well as providing some built-in common variants like CSV, Tab or Pipe delimited, etc. Unlike DBD::CSV, DBD::AnyData does this via its own regexes (variants of Friedl) rather than through Text::CSV_XS but the results should be pretty similar. -- Jeff
RE: Problem with Oracle Intermedia using DBI-DBD modules
Tim, I ran the script from different Unix box to prepare the output of $dbh-trace(9,'dbitrace.log'), fortunately it worked. After investigation, I realized that the script on the original Box was pointing to the database without Intermedia option. And that was the reason that execute statement was failing. So, the original script that I posted is OK. Thank you for your help. -Bardia On Tue, Jul 03, 2001 at 04:35:44PM -0400, Madani, Bardia (B.) wrote: I am trying to work with Oracle Intermedia and DBI. I have posted this problem to DBI mailing list, unfortunately no one replied. I hope you can help me. Here is the issue: The Intermedia queries are little different from regular SQL statements. Example of Intermedia Query: [ select MY_TEXT_COL from MY_TABLE where (contains (MY_TEXT_COL,'FOO') 0; ] The DBI prepare statement doesn't return any error. But DBI execute returns this error : Can't execute Query ORA-00904: invalid column name (DBD ERROR: OCIStmtExecute) The Intermedia queries work fine in sqlplus. I am wondering if DBI can handle Intermedia queries? Send me the output of adding $dbh-trace(9,'dbitrace.log') before the prepare() call. Tim.
Error on -disconnect?
I'm new to DBI programming, and get an error on exiting my program, which does query the database and return values. The problem seems to be with the line $rc = $dbh-disconnect, which does not appear to be executed. Can anyone point out what I'm doing wrong? Rick (begin error messages) (in cleanup) Uncaught exception from user code: Can't call method FETCH on an undefined value at C:/Perl/site/lib/Win32/TieRegistry.pm line 1486, line 4 during global destruction. Win32::TieRegistry::DESTROY('Win32::TieRegistry=HASH(0x22292a0)') called at ora-test.pl line 0 eval {...} called at ora-test.pl line 0 (end error messages) (begin program listing) #!/usr/bin/perl -w use diagnostics; use strict; use DBI; use Term::ReadKey; my ($rc, $user, $passwd) = ''; print Username: ; chomp ($user = ); print Password, please: ; if ($^O eq 'MSWin32') { ReadMode 'noecho'; } else { system (stty -echo); } chomp ($passwd = ); if ($^O eq 'MSWin32') { ReadMode 'normal'; } else { system (stty echo); } my $dbh = DBI-connect(dbi:Oracle:DSDB, lc($user), $passwd) or die Couldn't connect to database: . DBI-errstr; my $sth = $dbh-prepare('SELECT * FROM prsn WHERE pr_surname_nm = ?') or die Couldn't prepare statement: . $dbh-errstr; print \n\nEnter name ; while (my $queryname = ) {# Read input from user chomp $queryname; if ($queryname eq '') { exit }; my @data; $sth-execute(uc($queryname)) # Execute the query or die Couldn't execute statement: . $sth-errstr; # Read the matching records and print them out while (@data = $sth-fetchrow_array()) { my $pn_id = $data[0]; my $last_name = $data[1]; my $first_name = $data[2]; my $middle_name = $data[3]; print \t$pn_id: $first_name $middle_name $last_name\n; } if ($sth-rows == 0) { print No names matched '$queryname'.\n\n; } $sth-finish; print \nEnter name ; } $rc = $dbh-disconnect; print Return code was $rc\n; (end program listing) -- Rick Nakroshis Applications Interface Manager SEIT Contract Team Defense Security Service Ft. Meade, Maryland (301) 677-5015 DSN 923-5015
RE: Error on -disconnect?
That has nothing to do with you disconnect. You are not using finish() properly, which in your case should not be used at all. You are actually disallocating the handle which you prepared and on the second while() run, there is nothing to execute. See documentation on finish(). Ilya -Original Message- From: RICHARD A. NAKROSHIS (Contractor) To: DBI User's Mailing List Sent: 7/12/01 2:23 PM Subject: Error on -disconnect? I'm new to DBI programming, and get an error on exiting my program, which does query the database and return values. The problem seems to be with the line $rc = $dbh-disconnect, which does not appear to be executed. Can anyone point out what I'm doing wrong? Rick (begin error messages) (in cleanup) Uncaught exception from user code: Can't call method FETCH on an undefined value at C:/Perl/site/lib/Win32/TieRegistry.pm line 1486, line 4 during global destruction. Win32::TieRegistry::DESTROY('Win32::TieRegistry=HASH(0x22292a0)') called at ora-test.pl line 0 eval {...} called at ora-test.pl line 0 (end error messages) (begin program listing) #!/usr/bin/perl -w use diagnostics; use strict; use DBI; use Term::ReadKey; my ($rc, $user, $passwd) = ''; print Username: ; chomp ($user = ); print Password, please: ; if ($^O eq 'MSWin32') { ReadMode 'noecho'; } else { system (stty -echo); } chomp ($passwd = ); if ($^O eq 'MSWin32') { ReadMode 'normal'; } else { system (stty echo); } my $dbh = DBI-connect(dbi:Oracle:DSDB, lc($user), $passwd) or die Couldn't connect to database: . DBI-errstr; my $sth = $dbh-prepare('SELECT * FROM prsn WHERE pr_surname_nm = ?') or die Couldn't prepare statement: . $dbh-errstr; print \n\nEnter name ; while (my $queryname = ) {# Read input from user chomp $queryname; if ($queryname eq '') { exit }; my @data; $sth-execute(uc($queryname)) # Execute the query or die Couldn't execute statement: . $sth-errstr; # Read the matching records and print them out while (@data = $sth-fetchrow_array()) { my $pn_id = $data[0]; my $last_name = $data[1]; my $first_name = $data[2]; my $middle_name = $data[3]; print \t$pn_id: $first_name $middle_name $last_name\n; } if ($sth-rows == 0) { print No names matched '$queryname'.\n\n; } $sth-finish; print \nEnter name ; } $rc = $dbh-disconnect; print Return code was $rc\n; (end program listing) -- Rick Nakroshis Applications Interface Manager SEIT Contract Team Defense Security Service Ft. Meade, Maryland (301) 677-5015 DSN 923-5015
Re: DBD-Oracle-1.07 Makefile error on Linux SuSe7.2/Oracle9i
On Thu, Jul 12, 2001 at 09:48:22AM -0700, Dong Wang wrote: Tim, I tried the installation of DBI-1.18, DBD-Oracle-1.07 on a Suse 7.2 Linux box with Oracle 9i (9.0.1) installed. In the process of installing DBD-Oracle-1.07, after perl Makefile.PL, there is an error when doing make: Makefile:2340: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. On line 2340: occi*.type occiobj*.h occiinh*.h occipobj*.h After changing the leading spaces to a tab, make works. I guess other user will have the same problem because this line is extracted from the Oracle file $ORACLE_HOME/rdbms/demo/demo_rdbms.mk. It would be nice to convert that from the perl Makefile.PL step to avoid the hand editing of the Makefile. If you can make a reliable patch that won't falsey trigger the behaviour on any of the countless platforms and countless Oracle versions that people use I'd be very happy to apply it. Possibly not that hard, so worth a try. At the very lest you could just catch this one error by looking for that specific text. So, patches welcome! (I hope to make another DBD::Oracle release before the conference but I'm stuck on some DBI weirdness now.) Tim. Thanks. Dong Wang Grand Central Networks [EMAIL PROTECTED] -Original Message- From: Tim Bunce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 7:49 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Makefile on DBD::Oracle quits Rewrite the relevant lines as foreach (qw(mk.pm Oracle.h dbdimp.h ocitrace.h)) { $self-{PM}-{$_} = '$(INST_ARCHAUTODIR)/'.$_; } Tim. On Thu, Jul 12, 2001 at 04:11:14PM +0200, [EMAIL PROTECTED] wrote: Hi Tim, I've tried to run the Makefile.PL under perl version 5.004_01 on an AIX UNIX machine, but all I get is the following error: syntax error at Makefile.PL line 620, near $_ for Execution of Makefile.PL aborted due to compilation errors. Do you know what this means and how I could fix it so I can proceed to step 2? -- version of Oracle: 8.0.5. -- results of perl -V: Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration: Platform: osname=aix, osvers=4.2.1.0, archname=aix uname='aix iavnr4 2 4 002010076700 ' hint=recommended, useposix=true, d_sigaction=define bincompat3=y useperlio= d_sfio= Compiler: cc='cc', optimize='-O', gccversion= cppflags='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/local/include' ccflags ='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/local/include' stdchar='unsigned char', d_stdstdio=define, usevfork=false voidflags=15, castflags=1, d_casti32=define, d_castneg= intsize=4, alignbytes=8, usemymalloc=n, randbits=15 Linker and Libraries: ld='ld', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl -ldbm -ldl -lld -lm -lc -lbsd -lPW libc=/lib/libc.a, so=a useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_aix.xs, dlext=so, d_dlsymun=, ccdlflags='-bE:perl.exp' cccdlflags=' ', lddlflags='-H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).e xp -b noentry -lc -L/usr/local/lib' Characteristics of this binary (from libperl): Built under aix Compiled at Sep 26 1997 16:06:03 @INC: /usr/local/lib/perl5/aix/5.00401 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/aix /usr/local/lib/perl5/site_perl . Cheers, Maurice Dekker --- This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. ABN AMRO Bank N.V. (including its group companies) shall not be responsible nor liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference. ---
Compile problems with DBD::ODBC
Environment: Solaris 2.7 Perl v5.6 Dirver Manager: Merant DBI v1.18 DBD-ODBC v0.28 I'm having problems compiling DBD::ODBC. DBI compiled fine. I'm sorry if this has been discussed before, but I couldn't locate an answer. Below is the output from make. make test complains about a missing shared library. I don't have llibdbodbc.so anywhere on my system. Can someone tell if if this missing library is *really* the problem or am I doing something wrong? If the problem is this missing library, can someone direct me to where I can find it? BEGIN COMPILE DUMP ### perl Makefile.PL Unrecognized escape \i passed through at Makefile.PL line 217. Configuring DBD::ODBC ... Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Using ODBC in /opt/odbc Umm, this looks like a unixodbc type of driver manager. We expect to find the sql.h, sqlext.h and (which were supplied with unixODBC) in $ODBCHOME/include directory alongside the /opt/odbc/lib/libdbodbc.so /opt/odbc/lib/liblsxodb c.so /opt/odbc/lib/libodbc.so /opt/odbc/lib/libodbcinst.so /opt/odbc/lib/llibdbodbc.so /opt/odbc/lib/odbccurs.so /opt/odbc/lib/odbctrac.so library. in $ODBCHOME/lib Checking if your kit is complete... Looks good Note (probably harmless): No library found for - llibdbodbc.so Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Writing Makefile for DBD::ODBC The DBD::ODBC tests will use these values for the database connection: DBI_DSN=dbi:ODBC:SUNODBCe.g. dbi:ODBC:demo DBI_USER=xxx DBI_PASS=xxx make gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE - I/opt/odbc/include ODBC.c gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE - I/opt/odbc/include dbdimp.c Running Mkbootstrap for DBD::ODBC () chmod 644 ODBC.bs LD_RUN_PATH= gcc -o blib/arch/auto/DBD/ODBC/ODBC.so -G -L/usr/local/lib ODBC.o dbdimp.o chmod 755 blib/arch/auto/DBD/ODBC/ODBC.so cp ODBC.bs blib/arch/auto/DBD/ODBC/ODBC.bs chmod 644 blib/arch/auto/DBD/ODBC/ODBC.bs Manifying blib/man3/DBD::ODBC.3 make test TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.0/sun4-solaris - I/usr/local/lib/perl5/5.6.0 -e 'use Test::Harness qw(runtests $verbose); $verbose=1; runtests @ARGV;' t/*.t t/01baseinstall_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4-solaris/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/01base.t line 14 1..5 ok 1 ok 2 ok 3 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 4-5 Failed 2/5 tests, 60.00% okay t/02simple..1..14 ok 1 Test 2: connecting to the database install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4-solaris/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/02simple.t line 16 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-14 Failed 13/14 tests, 7.14% okay t/03dbatt...1..6 ok 1 install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4-solaris/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/03dbatt.t line 12 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-6 Failed 5/6 tests, 16.67% okay t/05meth1..6 ok 1 install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol
RE: Compile problems with DBD::ODBC
What is Merant is that the distributor of you ODBC for *NIX software. Do you have third party ODBC libs installed. Ilya -Original Message- From: Farouk Khawaja To: [EMAIL PROTECTED] Sent: 7/12/01 2:50 PM Subject: Compile problems with DBD::ODBC Environment: Solaris 2.7 Perl v5.6 Dirver Manager: Merant DBI v1.18 DBD-ODBC v0.28 I'm having problems compiling DBD::ODBC. DBI compiled fine. I'm sorry if this has been discussed before, but I couldn't locate an answer. Below is the output from make. make test complains about a missing shared library. I don't have llibdbodbc.so anywhere on my system. Can someone tell if if this missing library is *really* the problem or am I doing something wrong? If the problem is this missing library, can someone direct me to where I can find it? BEGIN COMPILE DUMP ### perl Makefile.PL Unrecognized escape \i passed through at Makefile.PL line 217. Configuring DBD::ODBC ... Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Using ODBC in /opt/odbc Umm, this looks like a unixodbc type of driver manager. We expect to find the sql.h, sqlext.h and (which were supplied with unixODBC) in $ODBCHOME/include directory alongside the /opt/odbc/lib/libdbodbc.so /opt/odbc/lib/liblsxodb c.so /opt/odbc/lib/libodbc.so /opt/odbc/lib/libodbcinst.so /opt/odbc/lib/llibdbodbc.so /opt/odbc/lib/odbccurs.so /opt/odbc/lib/odbctrac.so library. in $ODBCHOME/lib Checking if your kit is complete... Looks good Note (probably harmless): No library found for - llibdbodbc.so Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Writing Makefile for DBD::ODBC The DBD::ODBC tests will use these values for the database connection: DBI_DSN=dbi:ODBC:SUNODBCe.g. dbi:ODBC:demo DBI_USER=xxx DBI_PASS=xxx make gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE - I/opt/odbc/include ODBC.c gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE - I/opt/odbc/include dbdimp.c Running Mkbootstrap for DBD::ODBC () chmod 644 ODBC.bs LD_RUN_PATH= gcc -o blib/arch/auto/DBD/ODBC/ODBC.so -G -L/usr/local/lib ODBC.o dbdimp.o chmod 755 blib/arch/auto/DBD/ODBC/ODBC.so cp ODBC.bs blib/arch/auto/DBD/ODBC/ODBC.bs chmod 644 blib/arch/auto/DBD/ODBC/ODBC.bs Manifying blib/man3/DBD::ODBC.3 make test TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.0/sun4-solaris - I/usr/local/lib/perl5/5.6.0 -e 'use Test::Harness qw(runtests $verbose); $verbose=1; runtests @ARGV;' t/*.t t/01baseinstall_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4-solaris/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/01base.t line 14 1..5 ok 1 ok 2 ok 3 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 4-5 Failed 2/5 tests, 60.00% okay t/02simple..1..14 ok 1 Test 2: connecting to the database install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4-solaris/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/02simple.t line 16 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-14 Failed 13/14 tests, 7.14% okay t/03dbatt...1..6 ok 1 install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4-solaris/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/03dbatt.t line 12 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-6
RE: Compile problems with DBD::ODBC
Yes, my ODBC drivers are from Merant. The libs are installed in /opt/odbc/lib. I have a lib there called libdbodbc.so but no llibdbodbc.so Sterin, Ilya [EMAIL PROTECTED] wrote: What is Merant is that the distributor of you ODBC for *NIX software. Do you have third party ODBC libs installed. Ilya -Original Message- From: Farouk Khawaja To: [EMAIL PROTECTED] Sent: 7/12/01 2:50 PM Subject: Compile problems with DBD::ODBC Environment: Solaris 2.7 Perl v5.6 Dirver Manager: Merant DBI v1.18 DBD-ODBC v0.28 I'm having problems compiling DBD::ODBC. DBI compiled fine. I'm sorry if this has been discussed before, but I couldn't locate an answer. Below is the output from make. make test complains about a missing shared library. I don't have llibdbodbc.so anywhere on my system. Can someone tell if if this missing library is *really* the problem or am I doing something wrong? If the problem is this missing library, can someone direct me to where I can find it? BEGIN COMPILE DUMP ### perl Makefile.PL Unrecognized escape \i passed through at Makefile.PL line 217. Configuring DBD::ODBC ... Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Using ODBC in /opt/odbc Umm, this looks like a unixodbc type of driver manager. We expect to find the sql.h, sqlext.h and (which were supplied with unixODBC) in $ODBCHOME/include directory alongside the /opt/odbc/lib/libdbodbc.so /opt/odbc/lib/liblsxodb c.so /opt/odbc/lib/libodbc.so /opt/odbc/lib/libodbcinst.s o /opt/odbc/lib/llibdbodbc.so /opt/odbc/lib/odbccurs.s o /opt/odbc/lib/odbctrac.so library. in $ODBCHOME/lib Checking if your kit is complete... Looks good Note (probably harmless): No library found for - llibdbodbc.so Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Writing Makefile for DBD::ODBC The DBD::ODBC tests will use these values for the database connection: DBI_DSN=dbi:ODBC:SUNODBCe.g. dbi:ODBC:demo DBI_USER=xxx DBI_PASS=xxx make gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4- solaris/CORE - I/opt/odbc/include ODBC.c gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4- solaris/CORE - I/opt/odbc/include dbdimp.c Running Mkbootstrap for DBD::ODBC () chmod 644 ODBC.bs LD_RUN_PATH= gcc -o blib/arch/auto/DBD/ODBC/ODBC.so -G -L/usr/local/lib ODBC.o dbdimp.o chmod 755 blib/arch/auto/DBD/ODBC/ODBC.so cp ODBC.bs blib/arch/auto/DBD/ODBC/ODBC.bs chmod 644 blib/arch/auto/DBD/ODBC/ODBC.bs Manifying blib/man3/DBD::ODBC.3 make test TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.0/sun4-solaris - I/usr/local/lib/perl5/5.6.0 -e 'use Test::Harness qw(runtests $verbose); $verbose=1; runtests @ARGV;' t/*.t t/01baseinstall_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/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/01base.t line 14 1..5 ok 1 ok 2 ok 3 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 4-5 Failed 2/5 tests, 60.00% okay t/02simple..1..14 ok 1 Test 2: connecting to the database install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/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/02simple.t line 16 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-14 Failed 13/14 tests, 7.14% okay t/03dbatt...1..6 ok 1 install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol
RE: Compile problems with DBD::ODBC
also, opt/odbc/lib is defined in LD_LIBRARY_PATH Sterin, Ilya [EMAIL PROTECTED] wrote: What is Merant is that the distributor of you ODBC for *NIX software. Do you have third party ODBC libs installed. Ilya -Original Message- From: Farouk Khawaja To: [EMAIL PROTECTED] Sent: 7/12/01 2:50 PM Subject: Compile problems with DBD::ODBC Environment: Solaris 2.7 Perl v5.6 Dirver Manager: Merant DBI v1.18 DBD-ODBC v0.28 I'm having problems compiling DBD::ODBC. DBI compiled fine. I'm sorry if this has been discussed before, but I couldn't locate an answer. Below is the output from make. make test complains about a missing shared library. I don't have llibdbodbc.so anywhere on my system. Can someone tell if if this missing library is *really* the problem or am I doing something wrong? If the problem is this missing library, can someone direct me to where I can find it? BEGIN COMPILE DUMP ### perl Makefile.PL Unrecognized escape \i passed through at Makefile.PL line 217. Configuring DBD::ODBC ... Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Using ODBC in /opt/odbc Umm, this looks like a unixodbc type of driver manager. We expect to find the sql.h, sqlext.h and (which were supplied with unixODBC) in $ODBCHOME/include directory alongside the /opt/odbc/lib/libdbodbc.so /opt/odbc/lib/liblsxodb c.so /opt/odbc/lib/libodbc.so /opt/odbc/lib/libodbcinst.s o /opt/odbc/lib/llibdbodbc.so /opt/odbc/lib/odbccurs.s o /opt/odbc/lib/odbctrac.so library. in $ODBCHOME/lib Checking if your kit is complete... Looks good Note (probably harmless): No library found for - llibdbodbc.so Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Writing Makefile for DBD::ODBC The DBD::ODBC tests will use these values for the database connection: DBI_DSN=dbi:ODBC:SUNODBCe.g. dbi:ODBC:demo DBI_USER=xxx DBI_PASS=xxx make gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4- solaris/CORE - I/opt/odbc/include ODBC.c gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4- solaris/CORE - I/opt/odbc/include dbdimp.c Running Mkbootstrap for DBD::ODBC () chmod 644 ODBC.bs LD_RUN_PATH= gcc -o blib/arch/auto/DBD/ODBC/ODBC.so -G -L/usr/local/lib ODBC.o dbdimp.o chmod 755 blib/arch/auto/DBD/ODBC/ODBC.so cp ODBC.bs blib/arch/auto/DBD/ODBC/ODBC.bs chmod 644 blib/arch/auto/DBD/ODBC/ODBC.bs Manifying blib/man3/DBD::ODBC.3 make test TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.0/sun4-solaris - I/usr/local/lib/perl5/5.6.0 -e 'use Test::Harness qw(runtests $verbose); $verbose=1; runtests @ARGV;' t/*.t t/01baseinstall_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/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/01base.t line 14 1..5 ok 1 ok 2 ok 3 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 4-5 Failed 2/5 tests, 60.00% okay t/02simple..1..14 ok 1 Test 2: connecting to the database install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/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/02simple.t line 16 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-14 Failed 13/14 tests, 7.14% okay t/03dbatt...1..6 ok 1 install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/DynaLoader.pm
Re: Regexp / Sql-perl problem.
On Thu, Jul 12, 2001 at 01:52:41PM +0100, Rich Buckley wrote: SELECT MID(email, LOCATE(@, email), 999) AS domain, COUNT(*) FROM email_table GROUP BY domain; Neat. I'm not sure about MID and LOCATE in other renditions of SQL though. In Oracle MID would be SUBSTR but I cannot think of an alternative to LOCATE. That would be INSTR: SELECT SUBSTR(email, INSTR(email, '@')), COUNT(*) FROM email_table GROUP BY SUBSTR(email, INSTR(email, '@')) Ronald
DBI, DBD-Oracle for Solaris 2.8 i386
Hello Which is the version of DBI and DBD-Oracle to be installed on Solaris 2.8 i386. I have Oracle 8.1.6 loaded on my machine. Please reply Thanks in Advance Shiv _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
DBI, DBD::Oracle for Solaris 2.8 on Intel
Hello, Please tell me what version of DBI DBD::Oracle I need to install on Solaris 2.8 on i386 (Intel) Perl : 5.005 Oracle : 8.1.6 Thanks Shiv _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Makefile on DBD::Oracle quits
Hi Tim, I've tried to run the Makefile.PL under perl version 5.004_01 on an AIX UNIX machine, but all I get is the following error: syntax error at Makefile.PL line 620, near $_ for Execution of Makefile.PL aborted due to compilation errors. Do you know what this means and how I could fix it so I can proceed to step 2? -- version of Oracle: 8.0.5. -- results of perl -V: Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration: Platform: osname=aix, osvers=4.2.1.0, archname=aix uname='aix iavnr4 2 4 002010076700 ' hint=recommended, useposix=true, d_sigaction=define bincompat3=y useperlio= d_sfio= Compiler: cc='cc', optimize='-O', gccversion= cppflags='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/local/include' ccflags ='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/local/include' stdchar='unsigned char', d_stdstdio=define, usevfork=false voidflags=15, castflags=1, d_casti32=define, d_castneg= intsize=4, alignbytes=8, usemymalloc=n, randbits=15 Linker and Libraries: ld='ld', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl -ldbm -ldl -lld -lm -lc -lbsd -lPW libc=/lib/libc.a, so=a useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_aix.xs, dlext=so, d_dlsymun=, ccdlflags='-bE:perl.exp' cccdlflags=' ', lddlflags='-H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).e xp -b noentry -lc -L/usr/local/lib' Characteristics of this binary (from libperl): Built under aix Compiled at Sep 26 1997 16:06:03 @INC: /usr/local/lib/perl5/aix/5.00401 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/aix /usr/local/lib/perl5/site_perl . Cheers, Maurice Dekker --- This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. ABN AMRO Bank N.V. (including its group companies) shall not be responsible nor liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference. ---
Re: Error on -disconnect?
This is a problem that happens in Win32 if you reach global destruction with a database handle still defined even though it is not open. Assign undef to $dbh after you call $dbh-disconnect to cause it to be deallocated before global destruction. $sth-finish is unnecessary and is strongly not recommended in this case, but it shouldn't do any active harm. -- Mac :}) ** I normally forward private questions to the appropriate mail list. ** Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age. - Original Message - From: Sterin, Ilya [EMAIL PROTECTED] To: 'RICHARD A. NAKROSHIS (Contractor) ' [EMAIL PROTECTED]; 'DBI User's Mailing List ' [EMAIL PROTECTED] Sent: Thursday, July 12, 2001 13:29 Subject: RE: Error on -disconnect? That has nothing to do with you disconnect. You are not using finish() properly, which in your case should not be used at all. You are actually disallocating the handle which you prepared and on the second while() run, there is nothing to execute. See documentation on finish(). -Original Message- From: RICHARD A. NAKROSHIS (Contractor) To: DBI User's Mailing List Sent: 7/12/01 2:23 PM Subject: Error on -disconnect? I'm new to DBI programming, and get an error on exiting my program, which does query the database and return values. The problem seems to be with the line $rc = $dbh-disconnect, which does not appear to be executed. Can anyone point out what I'm doing wrong? Rick (begin error messages) (in cleanup) Uncaught exception from user code: Can't call method FETCH on an undefined value at C:/Perl/site/lib/Win32/TieRegistry.pm line 1486, line 4 during global destruction. Win32::TieRegistry::DESTROY('Win32::TieRegistry=HASH(0x22292a0)') called at ora-test.pl line 0 eval {...} called at ora-test.pl line 0
Re: DBI, DBD::Oracle for Solaris 2.8 on Intel
The latest ones you can find in CPAN. You might want to use ActiveState's Perl binary and use PPM to install all you modules. -- Mac :}) ** I normally forward private questions to the appropriate mail list. ** Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age. - Original Message - From: Shivkumar G Ganesan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 12, 2001 19:21 Subject: DBI, DBD::Oracle for Solaris 2.8 on Intel Please tell me what version of DBI DBD::Oracle I need to install on Solaris 2.8 on i386 (Intel) Perl : 5.005 Oracle : 8.1.6
StoreProc
Hi all, I am trying to pass several values to a store proc, as Ilya sugested I am using bind_param however, right i am able to pass only one arg to a proc. Do you have any idea how to make it happen wtih more than one ? Thats what I am using: my $csr = $dbh-prepare(q{ BEGIN BOXV2.DO_ALL (:instr_id); END; }); # The value of $instr_id is _copied_ here $csr-bind_param(:instr_id, $instr_id); $csr-execute; In the perldoc there is something that I cant make sense of. where do they pass several args at once?: my $test_num = 5; my $is_odd; $csr = $db-prepare(q{ BEGIN PLSQL_EXAMPLE.PROC_IN_INOUT(:test_num, :is_odd); END; }); # The value of $test_num is _copied_ here $csr-bind_param(:test_num, $test_num); $csr-bind_param_inout(:is_odd, \$is_odd, 1); # The execute will automagically update the value of $is_odd $csr-execute; print $test_num is , ($is_odd) ? odd - ok : even - error!, \n; Can you please suggest on anything? Thanx a lot, Daniel Daniel Rozengurtel Analyst II -Data Mining/WHSE IT Clearing-Settlements Banc of America Securities, LLC 9 West 57th Street, 18th Floor, NYC Email: [EMAIL PROTECTED] Phone: (212) 847-6253 _ IMPORTANT NOTICES: This message is intended only for the addressee. Please notify the sender by e-mail if you are not the intended recipient. If you are not the intended recipient, you may not copy, disclose, or distribute this message or its contents to any other person and any such actions may be unlawful. Banc of America Securities LLC(BAS) does not accept time sensitive, action-oriented messages or transaction orders, including orders to purchase or sell securities, via e-mail. BAS reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the BAS e-mail system.
DBI modules
Hi All, Hope some one might be able to help out here. I was in the process upgrading a few of our DBI and related modules thru CPAN, and screwed up! When attempting to install the DBD::mysql module, I was prompted to upgraded Perl from the 5.005 to 5.006 I believe, to support it. During the install of Perl, it prompted for location /usr/local by default setting and I think I screwed it by using /usr/bin instead and now, needless to say, things are a bit screwed up. What would be the best way to tell the server to use the original Perl that was installed before I screwed by installing the newer version of Perl!! Any help would be much appreciated! Good thing this is a development server :) Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Re: FW: Need some help with DBI/ODBC
Patricio M. Rueda wrote: Can some one shine the light on this problem. When I use the AS clause in my SELECT statement and then try to print the table rows by using the ORDER BY tot statement (new column TOT name), I get the following error: DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. The too few parameters error message is familiar indeed. I got it when I mistyped a column name. This is the query: my $sQuery = SELECT MachineID, AgentID, instanceKey, AgentID + instanceKey AS TOT FROM dbo_CD_ROM_DATA ORDER BY TOT DESC;; I think it might have something to do with the +, that maybe this makes access assume a wrong parameter type for the columns involved. Or add parens around the sum, before the AS. HTH, Bart.
RE: Compile problems with DBD::ODBC
HELP! I really need someone to help me on this. After reading Tim Bunce's readme for DBI, which states that: If you get an error like fatal: relocation error: symbol not found: ... do not use GNU as or GNU ld on Solaris. Delete or rename them, they are just bad news. I've verified that gcc is not using GNU ld. Can someone offer a suggestion. Sterin, Ilya [EMAIL PROTECTED] wrote: What is Merant is that the distributor of you ODBC for *NIX software. Do you have third party ODBC libs installed. Ilya -Original Message- From: Farouk Khawaja To: [EMAIL PROTECTED] Sent: 7/12/01 2:50 PM Subject: Compile problems with DBD::ODBC Environment: Solaris 2.7 Perl v5.6 Dirver Manager: Merant DBI v1.18 DBD-ODBC v0.28 I'm having problems compiling DBD::ODBC. DBI compiled fine. I'm sorry if this has been discussed before, but I couldn't locate an answer. Below is the output from make. make test complains about a missing shared library. I don't have llibdbodbc.so anywhere on my system. Can someone tell if if this missing library is *really* the problem or am I doing something wrong? If the problem is this missing library, can someone direct me to where I can find it? BEGIN COMPILE DUMP ### perl Makefile.PL Unrecognized escape \i passed through at Makefile.PL line 217. Configuring DBD::ODBC ... Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Using ODBC in /opt/odbc Umm, this looks like a unixodbc type of driver manager. We expect to find the sql.h, sqlext.h and (which were supplied with unixODBC) in $ODBCHOME/include directory alongside the /opt/odbc/lib/libdbodbc.so /opt/odbc/lib/liblsxodb c.so /opt/odbc/lib/libodbc.so /opt/odbc/lib/libodbcinst.s o /opt/odbc/lib/llibdbodbc.so /opt/odbc/lib/odbccurs.s o /opt/odbc/lib/odbctrac.so library. in $ODBCHOME/lib Checking if your kit is complete... Looks good Note (probably harmless): No library found for - llibdbodbc.so Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Writing Makefile for DBD::ODBC The DBD::ODBC tests will use these values for the database connection: DBI_DSN=dbi:ODBC:SUNODBCe.g. dbi:ODBC:demo DBI_USER=xxx DBI_PASS=xxx make gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4- solaris/CORE - I/opt/odbc/include ODBC.c gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4- solaris/CORE - I/opt/odbc/include dbdimp.c Running Mkbootstrap for DBD::ODBC () chmod 644 ODBC.bs LD_RUN_PATH= gcc -o blib/arch/auto/DBD/ODBC/ODBC.so -G -L/usr/local/lib ODBC.o dbdimp.o chmod 755 blib/arch/auto/DBD/ODBC/ODBC.so cp ODBC.bs blib/arch/auto/DBD/ODBC/ODBC.bs chmod 644 blib/arch/auto/DBD/ODBC/ODBC.bs Manifying blib/man3/DBD::ODBC.3 make test TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.0/sun4-solaris - I/usr/local/lib/perl5/5.6.0 -e 'use Test::Harness qw(runtests $verbose); $verbose=1; runtests @ARGV;' t/*.t t/01baseinstall_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/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/01base.t line 14 1..5 ok 1 ok 2 ok 3 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 4-5 Failed 2/5 tests, 60.00% okay t/02simple..1..14 ok 1 Test 2: connecting to the database install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/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/02simple.t line 16 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 2-14 Failed 13/14 tests, 7.14% okay
RE: DBI modules
Use the full path:-) Why did you screw it up, just use the perl installation in the /usr/bin, I don't see a problem, unless you are not telling us something. Ilya -Original Message- From: ThunderRain Publishing Corp. [mailto:ThunderRain Publishing Corp.]On Behalf Of MikemickaloBlezien Sent: Thursday, July 12, 2001 7:46 PM To: [EMAIL PROTECTED] Subject: DBI modules Hi All, Hope some one might be able to help out here. I was in the process upgrading a few of our DBI and related modules thru CPAN, and screwed up! When attempting to install the DBD::mysql module, I was prompted to upgraded Perl from the 5.005 to 5.006 I believe, to support it. During the install of Perl, it prompted for location /usr/local by default setting and I think I screwed it by using /usr/bin instead and now, needless to say, things are a bit screwed up. What would be the best way to tell the server to use the original Perl that was installed before I screwed by installing the newer version of Perl!! Any help would be much appreciated! Good thing this is a development server :) Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
RE: Compile problems with DBD::ODBC
-Original Message- From: Farouk Khawaja [mailto:[EMAIL PROTECTED]] Sent: Friday, July 13, 2001 7:09 AM To: Sterin, Ilya; '[EMAIL PROTECTED] ' Subject: RE: Compile problems with DBD::ODBC also, opt/odbc/lib is defined in LD_LIBRARY_PATH Looks like the wrong driver manager. This should identify itself as the intersolve driver manager, otherwise there is something wrong with your configuration. The default directories I get are /usr/sqlnk/{$VERSION} so unless you deliberately overrode or moved this the driver manager should be here. --Neil Sterin, Ilya [EMAIL PROTECTED] wrote: What is Merant is that the distributor of you ODBC for *NIX software. Do you have third party ODBC libs installed. Ilya -Original Message- From: Farouk Khawaja To: [EMAIL PROTECTED] Sent: 7/12/01 2:50 PM Subject: Compile problems with DBD::ODBC Environment: Solaris 2.7 Perl v5.6 Dirver Manager: Merant DBI v1.18 DBD-ODBC v0.28 I'm having problems compiling DBD::ODBC. DBI compiled fine. I'm sorry if this has been discussed before, but I couldn't locate an answer. Below is the output from make. make test complains about a missing shared library. I don't have llibdbodbc.so anywhere on my system. Can someone tell if if this missing library is *really* the problem or am I doing something wrong? If the problem is this missing library, can someone direct me to where I can find it? BEGIN COMPILE DUMP ### perl Makefile.PL Unrecognized escape \i passed through at Makefile.PL line 217. Configuring DBD::ODBC ... Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Using ODBC in /opt/odbc Umm, this looks like a unixodbc type of driver manager. We expect to find the sql.h, sqlext.h and (which were supplied with unixODBC) in $ODBCHOME/include directory alongside the /opt/odbc/lib/libdbodbc.so /opt/odbc/lib/liblsxodb c.so /opt/odbc/lib/libodbc.so /opt/odbc/lib/libodbcinst.s o /opt/odbc/lib/llibdbodbc.so /opt/odbc/lib/odbccurs.s o /opt/odbc/lib/odbctrac.so library. in $ODBCHOME/lib Checking if your kit is complete... Looks good Note (probably harmless): No library found for - llibdbodbc.so Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI Writing Makefile for DBD::ODBC The DBD::ODBC tests will use these values for the database connection: DBI_DSN=dbi:ODBC:SUNODBCe.g. dbi:ODBC:demo DBI_USER=xxx DBI_PASS=xxx make gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4- solaris/CORE - I/opt/odbc/include ODBC.c gcc -c -I. - I/usr/local/lib/perl5/site_perl/5.6.0/sun4- solaris/auto/DBI -fno-strict-aliasing -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\0.28\ - DXS_VERSION=\0.28\ -fPIC -I/usr/local/lib/perl5/5.6.0/sun4- solaris/CORE - I/opt/odbc/include dbdimp.c Running Mkbootstrap for DBD::ODBC () chmod 644 ODBC.bs LD_RUN_PATH= gcc -o blib/arch/auto/DBD/ODBC/ODBC.so -G -L/usr/local/lib ODBC.o dbdimp.o chmod 755 blib/arch/auto/DBD/ODBC/ODBC.so cp ODBC.bs blib/arch/auto/DBD/ODBC/ODBC.bs chmod 644 blib/arch/auto/DBD/ODBC/ODBC.bs Manifying blib/man3/DBD::ODBC.3 make test TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.0/sun4-solaris - I/usr/local/lib/perl5/5.6.0 -e 'use Test::Harness qw(runtests $verbose); $verbose=1; runtests @ARGV;' t/*.t t/01baseinstall_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/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/01base.t line 14 1..5 ok 1 ok 2 ok 3 dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 4-5 Failed 2/5 tests, 60.00% okay t/02simple..1..14 ok 1 Test 2: connecting to the database install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.6.0/sun4- solaris/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
Re: StoreProc
I'm not sure what's puzzling you. There are two types of bind variables (also known as placeholders): IN and INOUT. The second example you give in your message has one of each type of bind variable. If you want more of either or both types, just define them the same way. -- Mac :}) ** I normally forward private questions to the appropriate mail list. ** Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age. - Original Message - From: Rozengurtel, Daniel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 12, 2001 16:16 Subject: StoreProc I am trying to pass several values to a store proc, as Ilya sugested I am using bind_param however, right i am able to pass only one arg to a proc. Do you have any idea how to make it happen wtih more than one ? Thats what I am using: my $csr = $dbh-prepare(q{ BEGIN BOXV2.DO_ALL (:instr_id); END; }); # The value of $instr_id is _copied_ here $csr-bind_param(:instr_id, $instr_id); $csr-execute; In the perldoc there is something that I cant make sense of. where do they pass several args at once?: my $test_num = 5; my $is_odd; $csr = $db-prepare(q{ BEGIN PLSQL_EXAMPLE.PROC_IN_INOUT(:test_num, :is_odd); END; }); # The value of $test_num is _copied_ here $csr-bind_param(:test_num, $test_num); $csr-bind_param_inout(:is_odd, \$is_odd, 1); # The execute will automagically update the value of $is_odd $csr-execute; print $test_num is , ($is_odd) ? odd - ok : even - error!, \n; Can you please suggest on anything?
Re: DBI modules
Perl is working fine, except when Perl 5.006 got installed, instead of using the default pervious setup of /usr/local/lib/perl5/ for the existing 5.005, it's now /usr/bin/lib/perl5/... Perl 5.005 is still there with all the modules. All I need to do is reset the paths back to what they where so we don't have re-install all the existing modules in the Perl 5.005 which are not there now for the Perl 5.006 as the @INC all point to /usr/bin... instead of /usr/local/... and I haven't figured out how to change back without going thru a whole bunch of headaches! :) I thought using 'setenv PERLIB.' to reset the paths back would do it, but it didn't! On Fri, 13 Jul 2001 00:06:24 -0400, Sterin, Ilya [EMAIL PROTECTED] wrote: Use the full path:-) Why did you screw it up, just use the perl installation in the /usr/bin, I don't see a problem, unless you are not telling us something. Ilya -Original Message- From: ThunderRain Publishing Corp. [mailto:ThunderRain Publishing Corp.]On Behalf Of MikemickaloBlezien Sent: Thursday, July 12, 2001 7:46 PM To: [EMAIL PROTECTED] Subject: DBI modules Hi All, Hope some one might be able to help out here. I was in the process upgrading a few of our DBI and related modules thru CPAN, and screwed up! When attempting to install the DBD::mysql module, I was prompted to upgraded Perl from the 5.005 to 5.006 I believe, to support it. During the install of Perl, it prompted for location /usr/local by default setting and I think I screwed it by using /usr/bin instead and now, needless to say, things are a bit screwed up. What would be the best way to tell the server to use the original Perl that was installed before I screwed by installing the newer version of Perl!! Any help would be much appreciated! Good thing this is a development server :) Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
RE: StoreProc
Why can't you bind more than one arg. Show me a code where you try to and it is failing. bind_param_inout is used if you are expecting values back from the proc, so you pass it a reference and it will *automagically* update that scalar with the value. Ilya -Original Message- From: Rozengurtel, Daniel [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 7:16 PM To: [EMAIL PROTECTED] Subject: StoreProc Hi all, I am trying to pass several values to a store proc, as Ilya sugested I am using bind_param however, right i am able to pass only one arg to a proc. Do you have any idea how to make it happen wtih more than one ? Thats what I am using: my $csr = $dbh-prepare(q{ BEGIN BOXV2.DO_ALL (:instr_id); END; }); # The value of $instr_id is _copied_ here $csr-bind_param(:instr_id, $instr_id); $csr-execute; In the perldoc there is something that I cant make sense of. where do they pass several args at once?: my $test_num = 5; my $is_odd; $csr = $db-prepare(q{ BEGIN PLSQL_EXAMPLE.PROC_IN_INOUT(:test_num, :is_odd); END; }); # The value of $test_num is _copied_ here $csr-bind_param(:test_num, $test_num); $csr-bind_param_inout(:is_odd, \$is_odd, 1); # The execute will automagically update the value of $is_odd $csr-execute; print $test_num is , ($is_odd) ? odd - ok : even - error!, \n; Can you please suggest on anything? Thanx a lot, Daniel Daniel Rozengurtel Analyst II -Data Mining/WHSE IT Clearing-Settlements Banc of America Securities, LLC 9 West 57th Street, 18th Floor, NYC Email: [EMAIL PROTECTED] Phone: (212) 847-6253 _ IMPORTANT NOTICES: This message is intended only for the addressee. Please notify the sender by e-mail if you are not the intended recipient. If you are not the intended recipient, you may not copy, disclose, or distribute this message or its contents to any other person and any such actions may be unlawful. Banc of America Securities LLC(BAS) does not accept time sensitive, action-oriented messages or transaction orders, including orders to purchase or sell securities, via e-mail. BAS reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the BAS e-mail system.
RE: DBI modules
You can install again, but this time with the correct directory. That way you will have two 5.6 installs. Ilya -Original Message- From: ThunderRain Publishing Corp. [mailto:ThunderRain Publishing Corp.]On Behalf Of MikemickaloBlezien Sent: Friday, July 13, 2001 12:08 AM To: Sterin, Ilya Cc: [EMAIL PROTECTED] Subject: Re: DBI modules Perl is working fine, except when Perl 5.006 got installed, instead of using the default pervious setup of /usr/local/lib/perl5/ for the existing 5.005, it's now /usr/bin/lib/perl5/... Perl 5.005 is still there with all the modules. All I need to do is reset the paths back to what they where so we don't have re-install all the existing modules in the Perl 5.005 which are not there now for the Perl 5.006 as the @INC all point to /usr/bin... instead of /usr/local/... and I haven't figured out how to change back without going thru a whole bunch of headaches! :) I thought using 'setenv PERLIB.' to reset the paths back would do it, but it didn't! On Fri, 13 Jul 2001 00:06:24 -0400, Sterin, Ilya [EMAIL PROTECTED] wrote: Use the full path:-) Why did you screw it up, just use the perl installation in the /usr/bin, I don't see a problem, unless you are not telling us something. Ilya -Original Message- From: ThunderRain Publishing Corp. [mailto:ThunderRain Publishing Corp.]On Behalf Of MikemickaloBlezien Sent: Thursday, July 12, 2001 7:46 PM To: [EMAIL PROTECTED] Subject: DBI modules Hi All, Hope some one might be able to help out here. I was in the process upgrading a few of our DBI and related modules thru CPAN, and screwed up! When attempting to install the DBD::mysql module, I was prompted to upgraded Perl from the 5.005 to 5.006 I believe, to support it. During the install of Perl, it prompted for location /usr/local by default setting and I think I screwed it by using /usr/bin instead and now, needless to say, things are a bit screwed up. What would be the best way to tell the server to use the original Perl that was installed before I screwed by installing the newer version of Perl!! Any help would be much appreciated! Good thing this is a development server :) Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Re: DBI modules
On Fri, 13 Jul 2001 00:19:04 -0400, Sterin, Ilya [EMAIL PROTECTED] wrote: I was hoping to avoid that, but it looks like that's the only alternative! :) I tried using CPAN to install Perl, but it keeps failing, can't do 'make' successfully for some reason! And some other modules are missing that CPAN looks for, MD5, LWP.. Which where all there with Perl 5.005! but CPAN can't find those. Damn!! :) Well a good learning experience here.!!! Stay with the defaults settings when your not sure!! :) You can install again, but this time with the correct directory. That way you will have two 5.6 installs. Ilya -Original Message- From: ThunderRain Publishing Corp. [mailto:ThunderRain Publishing Corp.]On Behalf Of MikemickaloBlezien Sent: Friday, July 13, 2001 12:08 AM To: Sterin, Ilya Cc: [EMAIL PROTECTED] Subject: Re: DBI modules Perl is working fine, except when Perl 5.006 got installed, instead of using the default pervious setup of /usr/local/lib/perl5/ for the existing 5.005, it's now /usr/bin/lib/perl5/... Perl 5.005 is still there with all the modules. All I need to do is reset the paths back to what they where so we don't have re-install all the existing modules in the Perl 5.005 which are not there now for the Perl 5.006 as the @INC all point to /usr/bin... instead of /usr/local/... and I haven't figured out how to change back without going thru a whole bunch of headaches! :) I thought using 'setenv PERLIB.' to reset the paths back would do it, but it didn't! On Fri, 13 Jul 2001 00:06:24 -0400, Sterin, Ilya [EMAIL PROTECTED] wrote: Use the full path:-) Why did you screw it up, just use the perl installation in the /usr/bin, I don't see a problem, unless you are not telling us something. Ilya -Original Message- From: ThunderRain Publishing Corp. [mailto:ThunderRain Publishing Corp.]On Behalf Of MikemickaloBlezien Sent: Thursday, July 12, 2001 7:46 PM To: [EMAIL PROTECTED] Subject: DBI modules Hi All, Hope some one might be able to help out here. I was in the process upgrading a few of our DBI and related modules thru CPAN, and screwed up! When attempting to install the DBD::mysql module, I was prompted to upgraded Perl from the 5.005 to 5.006 I believe, to support it. During the install of Perl, it prompted for location /usr/local by default setting and I think I screwed it by using /usr/bin instead and now, needless to say, things are a bit screwed up. What would be the best way to tell the server to use the original Perl that was installed before I screwed by installing the newer version of Perl!! Any help would be much appreciated! Good thing this is a development server :) Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Placeholder Info
Hi All I wanted to know the significance of placeholders in SQL statements, can anybody guide me or provide me with links from where I will get easy to understand tutorial on the same. Regards Joel -- QuantumLink Communications, Bombay, India
Problems installing DBI 1.14 on SunOS 5.6 (Solaris 2.6)
Hello, I am trying to get DBI 1.14 installed for client and have been unsuccessful. I'm really stuck between a rock and a hard place here, so any help would be greatly appreciated. Would be willing to pay someone to get DBI and DBD::mysql installed if anyone is interested. Here are the results of the attempted installation: # 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 Warning: I could not locate your pod2man program. Please make sure, your pod2man program is in your PATH before you execute 'make' 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. # make make: Warning: Can't find `default.mk': No such file or directory /usr/bin/perl -I/usr/local/lib/perl5/sun4-solaris/5.00404 -I/usr/local/l ib/p erl5 /usr/local/lib/perl5/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/ExtUtils/typemap DBI.xs xstmp.c mv xstmp.c DBI.c gcc -c -I/usr/local/include -O -DVERSION=\1.14\ -DXS_VERSION=\1 .14\ -fpic -I/usr/local/lib/perl5/sun4-solaris/5.00404/CORE -Wall -Wno-comm ent -DDBI_NO_THREADS DBI.c sh: gcc: not found *** Error code 1 make: Fatal error: Command failed for target `DBI.o' # make test make: Warning: Can't find `default.mk': No such file or directory /usr/bin/perl -I/usr/local/lib/perl5/sun4-solaris/5.00404 -I/usr/local/l ib/p erl5 /usr/local/lib/perl5/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/ExtUtils/typemap DBI.xs xstmp.c mv xstmp.c DBI.c gcc -c -I/usr/local/include -O -DVERSION=\1.14\ -DXS_VERSION=\1 .14\ -fpic -I/usr/local/lib/perl5/sun4-solaris/5.00404/CORE -Wall -Wno-comm ent -DDBI_NO_THREADS DBI.c sh: gcc: not found *** Error code 1 make: Fatal error: Command failed for target `DBI.o' # make test TEST_VERBOSE=1 make: Warning: Can't find `default.mk': No such file or directory /usr/bin/perl -I/usr/local/lib/perl5/sun4-solaris/5.00404 -I/usr/local/l ib/p erl5 /usr/local/lib/perl5/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/ExtUtils/typemap DBI.xs xstmp.c mv xstmp.c DBI.c gcc -c -I/usr/local/include -O -DVERSION=\1.14\ -DXS_VERSION=\1 .14\ -fpic -I/usr/local/lib/perl5/sun4-solaris/5.00404/CORE -Wall -Wno-comm ent -DDBI_NO_THREADS DBI.c sh: gcc: not found *** Error code 1 make: Fatal error: Command failed for target `DBI.o' # make install make: Warning: Can't find `default.mk': No such file or directory /usr/bin/perl -I/usr/local/lib/perl5/sun4-solaris/5.00404 -I/usr/local/l ib/p erl5 /usr/local/lib/perl5/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/ExtUtils/typemap DBI.xs xstmp.c mv xstmp.c DBI.c gcc -c -I/usr/local/include -O -DVERSION=\1.14\ -DXS_VERSION=\1 .14\ -fpic -I/usr/local/lib/perl5/sun4-solaris/5.00404/CORE -Wall -Wno-comm ent -DDBI_NO_THREADS DBI.c sh: gcc: not found *** Error code 1 make: Fatal error: Command failed for target `DBI.o' # perl -V Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration: Platform: osname=solaris, osvers=2.6, archname=sun4-solaris uname='sunos 5.6 generic sun4u sparc sunw,ultra-1 ' hint=recommended, useposix=true, d_sigaction=define bincompat3=y useperlio=undef d_sfio=undef Compiler: cc='gcc', optimize='-O', gccversion=2.8.1 cppflags='-I/usr/local/include' ccflags ='-I/usr/local/include' stdchar='unsigned char', d_stdstdio=define, usevfork=false voidflags=15, castflags=0, d_casti32=define, d_castneg=define intsize=4, alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc -lcrypt libc=/lib/libc.so, so=so useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib' Characteristics of this binary (from libperl): Built under solaris Compiled at Jul 8 1998 01:43:26 @INC: /usr/local/lib/perl5/sun4-solaris/5.00404 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/sun4-solaris
Re: Writing LONG to DBI::Pg
a) check if you have nulls in the data. If you do, you must use type 'bytea' and SQL_BINARY to bind to it. b) Postgres prior to 7.0 had a limit of 4096 bytes per tuple. Tuple header takes around 50 bytes, so if you had any other fields, you'd be screwed. Upgrade to latest. On Thu, 12 Jul 2001, Ian Summers wrote: Hi Can anyone enlighten me? I'm trying to insert a field with 4000 characters into a Pg database which is specified as varchar(4000). I've overcome various hurdles but it produces the following error as soon as it encounters the LONG field: DBD::Pg::st execute failed: PQsendQuery() -- There is no connection to the backend. I've referred to the Programming Perl DBI book and it states: p306: No Bind output values - is this what's causing the problem p307: TEXT datatype has limit of 4096 - is this true? p221: Suggest that I could use: $sth-bind_param(5, 'Introduction', SQL_LONGVARCHAR); but p311: tells me that SQL_LONGVARCHAR is not supported by DBI::Pg. Is there a way to insert LONG data into Pg? Ian
Re: Writing LONG to DBI::Pg
Ian Summers wrote: Is there a way to insert LONG data into Pg? Can you give us some more details? There is no thing as a LONG datatype in PostgreSQL. -- Alessio F. Bragadini[EMAIL PROTECTED] APL Financial Services http://village.albourne.com Nicosia, Cyprus phone: +357-2-755750 It is more complicated than you think -- The Eighth Networking Truth from RFC 1925
Identifying the server connected to via DBI-connect(dbi:Oracle:)
I've written some perl that, given a TNS alias, will get the hostname from the effective tnsnames.ora file. My problem is I don't know how to get the hostname if the client's using Oracle*Names. For such a configuration there is no tnsnames.ora file to parse. Is there something in DBI or DBD::Oracle that reveals components of the TNS alias description? If not, is there some API that would allow someone to retrieve the TNS alias description from 'the master' (i.e., an Oracle*Names server)? If there is such an API and no one has written a perl wrapper for it, I'd be willing it. Thanks, Jeff Jeff Holt Chief Scientist, Hotsos LLC mailto:[EMAIL PROTECTED] +1.817.821.9553 tel +1.413.480.7346 fax http://www.hotsos.com Join the Oracle Performance Revolution!