Re: DBD::Oracle 1.80 & Oracle client 19c Segfaults on Destroy
On 6/20/20 1:51 PM, Scott wrote: More info, this error does not occur with DBD::Oracle 1.76. DBD::Oracle 1.80 => works with 18c client, but fails with 19c. DBD::Oracle 1.76 => works with all client versions. On 6/19/20 5:48 PM, Scott wrote: We have run into an issue when we upgraded to Oracle client 19c. Some of the users processes are segfaulting on exit. #0 0x7f82ee84ccc0 in pthread_mutex_lock () from /lib64/libpthread.so.0 #1 0x7f82e6444f43 in kputxabt () from /u01/app/oracle/product/19.3.0.0/lib/libclntsh.so.19.1 #2 0x7f82e926e6c3 in ora_db_rollback () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so #3 0x7f82e9266b11 in XS_DBD__Oracle__db_DESTROY () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so #4 0x7f82ed10291d in XS_DBI_dispatch () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBI/DBI.so I tested the same process on a server still using the 18c client and the core dump does not happen. Our DBA is creating ticket with Oracle, but I wanted to see if anyone else has had the same issue. Thanks, Scott I assuming this is the change causing the segfault with 19c client. Destroy envhp with last dbh (GH#93, GH#89, Dean Hamstead, CarstenGrohmann) diff -w ../DBD-Oracle-1.76/dbdimp.c ./dbdimp.c 1 218,222d217 < if (imp_drh->envhp) { < /* Free cached environment handle. */ < OCIHandleFree_log_stat(imp_drh, imp_drh->envhp, OCI_HTYPE_ENV, status); < } < 319c314 < case ORA_XMLTYPE: /* SQLT_NTY must be carefull here as its value (108) is the same for an embedded object Well realy only XML clobs not embedded objects */ --- > case ORA_XMLTYPE: /* SQLT_NTY must be careful here as its value (108) is the same for an embedded object Well really only XML clobs not embedded objects */ 863c858 < session_pool_t pool_data = { }; --- > session_pool_t pool_data = {0}; 1258a1254 > /* free session environment handle */ 1260a1257,1266 > if ( status == OCI_SUCCESS ) { > imp_dbh->envhp = NULL; > } > /* free global environment handle during destruction of last connection */ > } else if ( (imp_dbh->envhp == imp_drh->envhp) && (SvTRUE(perl_get_sv("DBI::PERL_ENDING",0))) ) { > OCIHandleFree_log_stat(imp_dbh, imp_dbh->envhp, OCI_HTYPE_ENV, status); > if ( status == OCI_SUCCESS ) { > imp_dbh->envhp = NULL; > imp_drh->envhp = NULL; > } 3739c3745 < as we may have more thatn one exe on a prepare*/ --- > as we may have more than one exe on a prepare*/ 4779c4785 < bool can_taf = 0; --- > boolean can_taf = 0;
Re: DBD::Oracle 1.80 & Oracle client 19c Segfaults on Destroy
More info, this error does not occur with DBD::Oracle 1.76. DBD::Oracle 1.80 => works with 18c client, but fails with 19c. DBD::Oracle 1.76 => works with all client versions. On 6/19/20 5:48 PM, Scott wrote: We have run into an issue when we upgraded to Oracle client 19c. Some of the users processes are segfaulting on exit. #0 0x7f82ee84ccc0 in pthread_mutex_lock () from /lib64/libpthread.so.0 #1 0x7f82e6444f43 in kputxabt () from /u01/app/oracle/product/19.3.0.0/lib/libclntsh.so.19.1 #2 0x7f82e926e6c3 in ora_db_rollback () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so #3 0x7f82e9266b11 in XS_DBD__Oracle__db_DESTROY () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so #4 0x7f82ed10291d in XS_DBI_dispatch () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBI/DBI.so I tested the same process on a server still using the 18c client and the core dump does not happen. Our DBA is creating ticket with Oracle, but I wanted to see if anyone else has had the same issue. Thanks, Scott
DBD::Oracle 1.80 & Oracle client 19c Segfaults on Destroy
We have run into an issue when we upgraded to Oracle client 19c. Some of the users processes are segfaulting on exit. #0 0x7f82ee84ccc0 in pthread_mutex_lock () from /lib64/libpthread.so.0 #1 0x7f82e6444f43 in kputxabt () from /u01/app/oracle/product/19.3.0.0/lib/libclntsh.so.19.1 #2 0x7f82e926e6c3 in ora_db_rollback () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so #3 0x7f82e9266b11 in XS_DBD__Oracle__db_DESTROY () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so #4 0x7f82ed10291d in XS_DBI_dispatch () from /usr/local/perl-5.22.0-thr/lib/site_perl/5.22.0/x86_64-linux-thread-multi/auto/DBI/DBI.so I tested the same process on a server still using the 18c client and the core dump does not happen. Our DBA is creating ticket with Oracle, but I wanted to see if anyone else has had the same issue. Thanks, Scott
DBD::DB2 install failure
Hello, I'm new to this list. I'm trying to install DBD::DB2 on a Win 10 machine running Strawberry Perl v5.28.1, using the cpan tool. I'm getting some strange "did you mean...?" errors, e.g. "C:\Strawberry\perl\bin\perl.exe" "C:\Strawberry\perl\lib\ExtUtils/xsubpp" -typemap C:\STRAWB~1\perl\lib\ExtUtils\typemap Constants.xs > Constants.xsc "C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- Constants.xsc Constants.c gcc -c -I"C:/PROGRA~1/IBM/SQLLIB/include" -I"C:\STRAWB~1\perl\site\lib/auto/DBI" -I"C:\STRAWB~1\perl\lib/auto/DBI" -I"C:\STRAWB~1\perl\vendor\lib/auto/DBI" -I"C:\STRAWB~1\perl\site\lib/auto/DBI" -I"C:/PROGRA~1/IBM/SQLLIB/include" -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"1.85\" -DXS_VERSION=\"1.85\" "-IC:\STRAWB~1\perl\lib\CORE" -DDB2_CACHE_FIXConstants.c In file included from C:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:987:0, from Constants.xs:16: C:/PROGRA~1/IBM/SQLLIB/include/sqlext.h:1748:5: error: unknown type name '__in_ecount'; did you mean 'SAL__in_ecount'? __in_ecount(cchConnStrIn) ^~~ SAL__in_ecount C:/PROGRA~1/IBM/SQLLIB/include/sqlext.h:1751:5: error: unknown type name '__out_ecount_opt'; did you mean 'SAL__out_ecount_opt'? __out_ecount_opt(cchConnStrOutMax) ^~~~ SAL__out_ecount_opt C:/PROGRA~1/IBM/SQLLIB/include/sqlext.h:1754:5: error: unknown type name '__out_opt'; did you mean '_Out_opt_'? __out_opt ^ _Out_opt_ C:/PROGRA~1/IBM/SQLLIB/include/sqlext.h:1865:5: error: unknown type name '__in_ecount'; did you mean 'SAL__in_ecount'? __in_ecount(cchConnStrIn) ^~~ ... and it fails to install. Am I trying to install something out of date? Thanks for any tips. Scott
Re: Generic way of fetching a list of databases
convert to 'rest'ful JSON? Barack-O-phobia: The fear of politicians who think (more) government is the solution to every problem. On Thursday, November 15, 2018, 9:09:44 PM EST, Daniel Kasak wrote: Hi all. I have a project that has to support pretty much every major database around, plus a number of more esoteric "big data" platforms as well. Until now, I've had a bunch of methods, implementing fetching databases, schemas, tables, etc, per database, with database-specific queries ( eg against information_schema ). Some of the newer databases I'm trying to support have very little documentation, and in some cases no apparent way of fetching in the schema via SQL. I've had a conversation with one of the tech support people for a DB product who said that there were generic ODBC functions we can call for this kind of thing. Is this the case? I've done quite a bit of search, but can't find any docs that mention fetching *databases* - either in ODBC docs or in Perl/DBI docs. The closest I've found that *might* have worked was DBI's tables() method: https://metacpan.org/pod/DBI#tables ... but: - this doesn't work in cases where there is a separation between hierarchies at the database level ( eg postgres only lists schemas and tables in the current database )- this isn't returning *anything* for me with any of the ODBC drivers I've tried So is it possible to retrieve a list of databases in a generic way? Failing that, assuming that there *is* some ODBC call ( as suggested by one DB vendor ) that I can use, is there some way of calling it from Perl with DBD::ODBC? Thanks :) Dan
Re: DBD::CSV and skip_first_line
On 11/26/2012 11:56 AM, H.Merijn Brand wrote: On Mon, 26 Nov 2012 11:49:49 -0500, Scott R. Godin scot...@mhg2.com wrote: On 11/25/2012 04:16 AM, Jens Rehsack wrote: On 25.11.12 10:00, H.Merijn Brand wrote: On Fri, 23 Nov 2012 17:43:50 -0500, Scott R. Godin scot...@mhg2.com wrote: I've run into an issue where I need both col_names set and skip_first_line still set to TRUE, because of malformed colnames in the original dumpfiles that conflict with SQL Reserved Words (such as 'key') that I am unable to find any other acceptable workaround short of Why not automate the hacking using Text::CSV_XS and rewrite the header before using DBD::CSV? Or simply quote the column names in your SQL statement? I tried various quoting mechanisms up to and including attempting to use backticks, but all result in errors of one kind or another Can you attach the first 4 lines of your csv datafile? Unfortunately, no, as I am under HIPAA restrictions. key consists of seemingly random alphanumeric [A-Z0-9] sequences that may or may not contain one dash (at about position 11), of 16-char length PHM_ID consists of P\d{7} and may repeat across records of the other two fields DAW_CD is numeric(1) and GENBRND_CD is boolean all records are pipe-delimited The actual csv contains 44 columns; in the interest of brevity I limited the sample to the below four. :) $dbh-prepare(q{Select 'key', PHM_ID, DAW_CD, GENBRND_CD from clms limit 10}) results in every record having the literal value key for the column `key` same if I try select 'key' as PKEY if I switch to double-quotes rather than single quotes around key in the above, I get the following error: Execution ERROR: No such column 'key' called from clms_test.pl at 23. I'll look into playing with Text::CSV_XS, and see what I can come up with. I still think it would be easier if skip_first_line were not presumed (forced to) false if col_names is set, but rather presumed false only if not set explicitly true. We agree, investigating what is actually required (and should be documented) -- Scott R. Godin, Senior Programmer MAD House Graphics 302.468.6230 - main office 302.722.5623 - home office
Re: DBD::CSV and skip_first_line
On 11/26/2012 11:56 AM, H.Merijn Brand wrote: Can you attach the first 4 lines of your csv datafile? Here is some randomized data that closely resembles the data in the csv if this is any help in working with variations on $dbh-prepare(q{Select key, PHM_ID, DAW_CD, GENBRND_CD from clms limit 10}); (bearing in mind the csv contains 44, not 4 columns and this is just a sample) key|PHM_ID|DAW_CD|GENBRND_CD 667291120KNM4728|P1951532|2|0 858525298EEA3248|P8697017|5|0 286424010HTG2644|P8607393|3|1 344987842DYH2950|P8662248|3|0 225509049XEU3393|P1222508|1|0 061473729SFZ1183|P2785408|6|0 370501125YPF2594|P1534462|2|0 620354050CRF3119|P4438944|3|1 901228431AUF5822|P5315769|1|0 969358370QPO9757|P1523687|8|0 543692286WTA5861|P5993819|1|0 591327753QVR5452|P1013462|4|0 159204117LXL0308|P5358769|8|1 352853355KYT5615|P2810873|3|1 195099617GNE7056|P1306424|6|0 -- Scott R. Godin, Senior Programmer MAD House Graphics 302.468.6230 - main office 302.722.5623 - home office
Trying to use perl to call oracle stored proc to return an object.
All: I'm trying to use perl to invoke a stored procedure to return an object. Oracle Procedure is defined as PROCEDURE FetchTrackObjbyID ( p_ID IN TRACK.ID%TYPE , p_TARGET OUT TARGET ) Where p_ID is numeric and p_TARGET is the TARGET object type. When I 'execute', I get DBD::Oracle::st execute failed: ORA-06550: line 2, column 5: PLS-00306: wrong number or types of arguments in call to 'FETCHTRACKOBJBYID' ORA-06550: line 2, column 5: PL/SQL: Statement ignored (DBD ERROR: error possibly near * indicator at char 10 in 'BEGIN *FetchTrackObjbyID(:p_id, :p_target); END; ') [for Statement BEGIN FetchTrackObjbyID(:p_ID, :p_Target); END; with ParamValues: :p_id=1, :p_target=undef] at So far, I've got my $i = 5; my $p_Target; # should this be either @p_Target or %p_Target my $sqlstmt= END_SQL; BEGIN FetchTrackObjbyID(:p_ID, :p_Target); END; END_SQL my $sth = $dbh-prepare($sqlstmt) or die Can't prepare statement\n$sqlstmt\n$DBI::errstr\n; $sth-bind_param_inout(:p_Target,\$p_Target, 20) or die bind(target) err is $DBI::errstr; # Should I specify a bind type and if so, what type? $sth-bind_param(:p_ID,$i) or die bind(ID) err is $DBI::errstr\n; $sth-execute(); Hoping it is something really simple. Thanks for any help E. Scott Stricker @ Work
RE: EXT :Re: Trying to use perl to call oracle stored proc to return an object.
Thanks for the reply Robert. PROCEDURE FetchTrackObjbyID ( p_ID IN TRACK.ID%TYPE, p_TARGET OUT TARGET ) PROCEDURE is defined with an IN and OUT param. May have also tried it with an in out vs simply an out param and this made no difference. $sth-bind_param_inout(:p_Target,\$p_Target, 20) or die bind(target) err is $DBI::errstr; # Should I specify a bind type and if so, what type? $sth-bind_param(:p_ID,$i) or die bind(ID) err is $DBI::errstr\n; Do a bind_param_inout with the OUT and a bind_param with the IN param. E. Scott Stricker 703-561-3671 -Original Message- From: Robert Durgin [mailto:rdur...@texterity.com] Sent: Wednesday, May 02, 2012 12:19 PM To: Stricker, Scott (IS) Cc: dbi-users@perl.org Subject: EXT :Re: Trying to use perl to call oracle stored proc to return an object. Did you specify the direction for each parameter? - Original Message - From: Scott Stricker (IS) scott.stric...@ngc.com To: dbi-users@perl.org Sent: Wednesday, May 2, 2012 12:06:05 PM Subject: Trying to use perl to call oracle stored proc to return an object. All: I'm trying to use perl to invoke a stored procedure to return an object. Oracle Procedure is defined as PROCEDURE FetchTrackObjbyID ( p_ID IN TRACK.ID%TYPE , p_TARGET OUT TARGET ) Where p_ID is numeric and p_TARGET is the TARGET object type. When I 'execute', I get DBD::Oracle::st execute failed: ORA-06550: line 2, column 5: PLS-00306: wrong number or types of arguments in call to 'FETCHTRACKOBJBYID' ORA-06550: line 2, column 5: PL/SQL: Statement ignored (DBD ERROR: error possibly near * indicator at char 10 in 'BEGIN *FetchTrackObjbyID(:p_id, :p_target); END; ') [for Statement BEGIN FetchTrackObjbyID(:p_ID, :p_Target); END; with ParamValues: :p_id=1, :p_target=undef] at So far, I've got my $i = 5; my $p_Target; # should this be either @p_Target or %p_Target my $sqlstmt= END_SQL; BEGIN FetchTrackObjbyID(:p_ID, :p_Target); END; END_SQL my $sth = $dbh-prepare($sqlstmt) or die Can't prepare statement\n$sqlstmt\n$DBI::errstr\n; $sth-bind_param_inout(:p_Target,\$p_Target, 20) or die bind(target) err is $DBI::errstr; # Should I specify a bind type and if so, what type? $sth-bind_param(:p_ID,$i) or die bind(ID) err is $DBI::errstr\n; $sth-execute(); Hoping it is something really simple. Thanks for any help E. Scott Stricker @ Work -- Robert Durgin Sr. Software Engineer Texterity • 144 Turnpike Road Southborough , MA 01772 rdur...@texterity.com www.texterity.com
Maintaining simultaneous support for two Oracle versions in DBI
My workplace is transitioning from Oracle version 9 to version 11. I would like to build the DBD driver to support connecting to the Oracle 11 database. However, until all the data are migrated from the old database to the new one, I would need to maintain connectivity to the old Oracle 9 database. Since the driver and shared objects built for the new database would be incompatible, I would need to build separate objects for the Oracle 11 connection. Some of the items I can identify are: The module should be Oracle11.pm rather than Oracle.pm (called as DBI-connect(dbi:Oracle11:, ...) rather than DBI-connect(dbi:Oracle:, ...)). The shared object and bootstrap files as Oracle11.so and Oracle11.bs respectively. (Should these go in the same directory or should they be in the directory Oracle11 and does the package name in Oracle11.pm have to be changed to DBD::Oracle11 in order to find things there?) I have some idea of what I need to change in Makefile.PL in order to achieve at least part of this. What I have so far is changing references to Oracle.pm to Oracle11.pm and $opts{NAME} from DBD::Oracle to Oracle 11. Am I right about the second? Are there others I should have included? Thanks for any help, Scott Smith
DBD::ODBC fails, SQL*Plus works
Folks, I could use a tip or lead with the following issue: I have a Windows Server 2008 R2 box with Oracle Instant Client 11.2, with the SQL*Plus and ODBC modules installed. No other Oracle software is installed. I am connecting to an Oracle 10g instance. The following SQL*Plus works: sqlplus user/passwd@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.15.200)(PORT=1535)))(CONNECT_DATA=(SID=PROD77))). The perl script that contains the following does not: use DBI; # Oracle / Remedy info my $oracle_sid = PROD77; my $oracle_host = 10.128 192.15.200:1535; my $oracle_userid = user; my $oracle_passwd = passwd; my $dsn = Driver={Oracle in instantclient_11_2};server=$oracle_host;sid=$oracle_sid; my $dbh = DBI-connect(dbi:ODBC:$dsn, $oracle_userid, $oracle_passwd); It returns (after a few seconds) with an ORA-12154 error: TNS:could not resolve the connect identifier specified ( SQL-08004). Thanks for any help... Scott...
Re: :ODBC fails, SQL*Plus works
I'm sorry - that was just fat fingers on the cut/paste... In actuality it is $oracle_host = 192.168.15.200:1535 On Oct 5, 2011, at 12:13 PM, Nelson, Erick [HDS] wrote: Your $oracle_host Perl var looks like it has more that just the host ip address and port in it. What is the 10.128 ? -Original Message- From: Scott Stansbury [mailto:sstansb...@aol.com] Sent: Wednesday, October 05, 2011 9:09 AM To: dbi-users@perl.org Subject: DBD::ODBC fails, SQL*Plus works Folks, I could use a tip or lead with the following issue: I have a Windows Server 2008 R2 box with Oracle Instant Client 11.2, with the SQL*Plus and ODBC modules installed. No other Oracle software is installed. I am connecting to an Oracle 10g instance. The following SQL*Plus works: sqlplus user/passwd@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192. 168.15.200)(PORT=1535)))(CONNECT_DATA=(SID=PROD77))). The perl script that contains the following does not: use DBI; # Oracle / Remedy info my $oracle_sid = PROD77; my $oracle_host = 192.168.15.200:1535; my $oracle_userid = user; my $oracle_passwd = passwd; my $dsn = Driver={Oracle in instantclient_11_2};server=$oracle_host;sid=$oracle_sid; my $dbh = DBI-connect(dbi:ODBC:$dsn, $oracle_userid, $oracle_passwd); It returns (after a few seconds) with an ORA-12154 error: TNS:could not resolve the connect identifier specified ( SQL-08004). Thanks for any help... Scott... Scott...
Re: :ODBC fails, SQL*Plus works
On Oct 5, 2011, at 1:00 PM, Kong, Alan wrote: Since you are using DBI::ODBC, you should create an ODBC data source pointing to your Oracle database first, and then calling the connect function by passing the data source name you just created for ODBC data source. That's our standard config, but in this case that is failing also. Configuring the DSN via the ODBC Data Source Administrator control panel and hitting Test Connection yields the same error: Unable to connect SQLState=08004 [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified. I added the connection parameters and credentials to the script to see if it was windows talking to the Oracle InstantClient ODBC layer that was causing the problem... Scott...
Re: :ODBC fails, SQL*Plus works
On Oct 5, 2011, at 1:47 PM, Kong, Alan wrote: It is different than typing the whole connection description in the command prompt as it will bypass tnsnames.ora entry. ODBC is looking for the tnsnames.ora entry for connection description, so using the above connection method, I bet it will fail also. If this is the case, that means your tnsnames.ora entry is somehow corrupted by the unknown characters. What I am usually do is to type the tnsnames.ora entry manually, it should fix your problem. Hope this is the case. It appears that was a contributing factor. Thanks for your help! Scott...
Re: DBD::ODBC fails, SQL*Plus works
On Oct 5, 2011, at 1:53 PM, Bruce Johnson wrote: Basic questions: the script is running in an environment where the env variables $ORACLE_HOME and $TNS_ADMIN are available? Your tnsnames.ora file is present and correct? I did have the env variables configured, and the tnsnames.ora is now correct. Thank you. I do have a question, though. In other installations, the combination of Oracle Instant Client and Microsoft's ODBC Data Source Administrator control panel have been sufficient to gain access to an Oracle db, with no need for a tnsnames.ora file. Indeed, Oracle touts that a a benefit of the Instant Client. In the ODBC Data Source Administrator, what they call the TNS Service Name is of the format //hostname:port/sid. Could it be that setting up the data source via the control panel only uses the EZCONNECT format, and if the db instance that I was querying didn't have EZCONNECT enabled via it's sqlnet.ora file ( NAMES.DIRECTORY_PATH=(ezconnect, tnsnames) ), I would see the issues that I did? It's possible that I've never run into the issue before as that (EZCONNECT enabled) is the default? Or does this not make sense at all? ;) Once again, thanks for taking the time to help... Scott...
Re: Problem compiling DBD::Oracle on FreeBSD with Oracle 10g Instant Client
On Sun, 2010-10-03 at 18:45 +0200, Eric Yellin wrote: Hi, I am trying to compile DBD::Oracle that will work with Oracle 10g on FreeBSD 6.3 Eric, Are you compiling a linux Perl? It won't work with out it. I have the port emulators/linux_dist-gentoo-stage3 installed. With a chroot to the gentoo dir, I am able to compile a linux Perl and DBI, DBD::Oracle...etc. I copied the Perl install to /usr/compat/linux. Here is what I have done so far: 1. Installed the 3 Oracle Instant Client ports: - linux-oracle-instantclient-basic - linux-oracle-instantclient-sdk - linux-oracle-instantclient-sqlplus These install as follows: _The basic files install in:_ /usr/compat/linux/usr/lib/Oracle/10.2.0.3/client/lib _The sqlplus installes in _: /usr/compat/linux/usr/lib/Oracle/10.2.0.3/client/bin _The sdk split between:_ /usr/compat/linux/usr/include/Oracle/10.2.0.3/client/lib (the include directory) and: /usr/compat/linux/usr/share/Oracle/10.2.0.3/client/lib (the demo directory) 2. Downloaded latest DBD::Oracle (1.25) 3. Set Environment variables as follows: setenv LD_LIBRARY_PATH /usr/compat/linux/usr/lib/oracle/10.2.0.3/client/lib setenv ORACLE_HOME /usr/compat/linux/usr/lib/oracle/10.2.0.3/client 4. Ran perl Makefile.PL for DBD:Oracle and recieved the follwoing error: /Unable to locate an oracle.mk, proc.mk or other suitable *.mk/ 5. changed the ORACLE_HOME variable to: setenv ORACLE_HOME /usr/compat/linux/usr/lib/oracle/10.2.0.3/client/lib and ran perl Makefile.PL again and now received the following message: /I can't find the header files I need in your Oracle installation. You probably need to install some more Oracle components. For Instant Client that means the SDK package/ 6. Copied the sdk files directly from the ports work directory leaving them in the original structure and placing them under the /usr/compat/linux/usr/lib/oracle/10.2.0.3/client/lib directory and ran perl Makefile.PL again. Now it built the Makefile succesfully with a few warnings: /WARNING: If you have problems you may need to rebuild perl with threading enabled. WARNING: If you have problems you may need to rebuild perl with -Uusemymalloc. WARNING: META_MERGE is not a known parameter. 'META_MERGE' is not a known MakeMaker parameter name./ 7. Ran 'make' and it compiled smoothly. 8. Ran 'make test' and got the following error: /Failed to load Oracle extension and/or shared libraries: install_driver(Oracle) failed: Can't load '/home/packages/Oracle/DBD-Oracle-1.25/blib/arch/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: Shared object libdl.so.2 not found, required by libclntsh.so.10.1 at /usr/local/lib/perl5/5.8.8/mach/DynaLoader.pm line 230. at (eval 9) line 3 Compilation failed in require at (eval 9) line 3. Perhaps a required shared library or dll isn't installed where expected at t/01base.t line 19 The remaining tests will probably also fail with the same error./ The libdl.so.2 file is located in /usr/compat/linux/lib and the compiled DBD::Oracle module does 'know' not see that directory. How can I move on from here to link the necessary shared libraries during runtime ? (Tried doing this with symlinks, but kept getting errors and eventually reached a dead end where symlinking did not help anymore. I assume there must be a different way to do it) Thanks, Eric
RE: Having a problem conneting to an Oracle 11gr2 RAC
Thanks for the info John. Agreed that it is probably an issue with the connect string. More details on the environment The oracle RAC environment is 64bit 11gR2 running on windows server 2003. The client is currently a 32 bit 10.2 oracle client running on a different 64 bit windows server 2003 box. There is no TNSNAMES.ORA file on this box. Also, from this box, I can connect to a standalone 64 bit 11gR1 oracle server running on another box. Host environment XYZ-3 - 64bit windows 2003 server client box running 32 bit 10.2 oracle client and activestate perl with DBI 1.609 and DBD-Oracle 1.21 XYZ-1 - 64bit windows 2003 server running 64bit standalone 11gR1 oracle (host alias dbserver) XYZ-2 XYZ-10 64bit windows 2003 servers running 64bit 11gR2 oracle RAC (host alias edc-dbserver) Can connect with perl to XYZ-1 (dbserver) box Error trying to connect with perl to XYZ-2 XYZ-10 (edc-dbserver) box E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax) From: John Scoles [mailto:byter...@hotmail.com] Sent: Thursday, April 29, 2010 6:11 PM To: Stricker, Scott (IS); dbi-users@perl.org Subject: RE: Having a problem conneting to an Oracle 11gr2 RAC It is somthing in you connection string or you do not have the TNS_ADMIN env car set TNS_ADMIN should point to your TNSNAMES.ORA file Subject: Having a problem conneting to an Oracle 11gr2 RAC Date: Thu, 29 Apr 2010 15:03:18 -0500 From: scott.stric...@ngc.com To: dbi-users@perl.org Don't know if anyone has worked with the Oracle RAC environment and perl. Using sqlplus, I can do the following C:\sqlplus ais_dbo/passw...@edc-dbserver/HCSMDA SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 29 11:55:35 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options And then execute queries, updates ... From ActiveState perl running on a windows 2003 server box with DBD-Oracle 1.21 and DBI 1.609 C:\perl -v This is perl, v5.8.9 built for MSWin32-x86-multi-thread (with 9 registered patches, see perl -V for more detail) Copyright 1987-2008, Larry Wall Binary build 825 [288577] provided by ActiveState http://www.ActiveState.com Built Dec 14 2008 21:07:41 Perl code follows #!/usr/bin/perl -I . require 5.001; use strict; use DBI; MAIN: { print Started\n; my $dbh = DBI-connect(dbi:Oracle:host=edc-dbserver;sid=HCSMDA, ais_dbo,PASSWORD, {RaiseError=1, PrintError=0}); my $sqlstmt = SELECT COUNT(*) FROM VESSEL_IDENTIFIERS; my($no_of_ships) = $dbh-selectrow_array($sqlstmt); print Got $no_of_ships ships\n } Executing the above, I get Started DBI connect('host=edc-dbserver;sid=HCSMDA','ais_dbo',...) failed: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) at C:\adbtest.pl line 15 I've got a standalone oracle database (11gr1) pointed to by host alias dbserver. If I use dbserver above instead of edc-dbserver, the script works fine. Also, tnsping gives the following C:\tnsping edc-dbserver TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-APR-2010 12:57:46 Copyright (c) 1997, 2005, Oracle. All rights reserved. Used parameter files: C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora Used HOSTNAME adapter to resolve the alias Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=edc-dbserver.nais.org))(ADDRESS =(PROTOCOL=TCP)(HOST=10.166.135.110)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)( HOST=10.166.135.112)(PORT=1521))) OK (0 msec) Any help would be greatly appreciated. E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax) Got a phone? Get Hotmail Messenger for mobile! http://go.microsoft.com/?linkid=9724457
RE: Having a problem conneting to an Oracle 11gr2 RAC
Found the issue. Had been connecting as my $dbh = DBI-connect(dbi:Oracle:host=edc-dbserver;sid=HCSMDA, ais_dbo, PASSWORD,... and getting the error. Changed it to my $dbh = DBI-connect('dbi:Oracle:', 'ais_...@edc-dbserver/HCSMDA','PASSWORD',... and all is well. Thanks for the help. E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax) -Original Message- From: Stricker, Scott (IS) [mailto:scott.stric...@ngc.com] Sent: Friday, April 30, 2010 8:49 AM To: John Scoles; dbi-users@perl.org Subject: RE: Having a problem conneting to an Oracle 11gr2 RAC Thanks for the info John. Agreed that it is probably an issue with the connect string. More details on the environment The oracle RAC environment is 64bit 11gR2 running on windows server 2003. The client is currently a 32 bit 10.2 oracle client running on a different 64 bit windows server 2003 box. There is no TNSNAMES.ORA file on this box. Also, from this box, I can connect to a standalone 64 bit 11gR1 oracle server running on another box. Host environment XYZ-3 - 64bit windows 2003 server client box running 32 bit 10.2 oracle client and activestate perl with DBI 1.609 and DBD-Oracle 1.21 XYZ-1 - 64bit windows 2003 server running 64bit standalone 11gR1 oracle (host alias dbserver) XYZ-2 XYZ-10 64bit windows 2003 servers running 64bit 11gR2 oracle RAC (host alias edc-dbserver) Can connect with perl to XYZ-1 (dbserver) box Error trying to connect with perl to XYZ-2 XYZ-10 (edc-dbserver) box E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax) From: John Scoles [mailto:byter...@hotmail.com] Sent: Thursday, April 29, 2010 6:11 PM To: Stricker, Scott (IS); dbi-users@perl.org Subject: RE: Having a problem conneting to an Oracle 11gr2 RAC It is somthing in you connection string or you do not have the TNS_ADMIN env car set TNS_ADMIN should point to your TNSNAMES.ORA file Subject: Having a problem conneting to an Oracle 11gr2 RAC Date: Thu, 29 Apr 2010 15:03:18 -0500 From: scott.stric...@ngc.com To: dbi-users@perl.org Don't know if anyone has worked with the Oracle RAC environment and perl. Using sqlplus, I can do the following C:\sqlplus ais_dbo/passw...@edc-dbserver/HCSMDA SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 29 11:55:35 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options And then execute queries, updates ... From ActiveState perl running on a windows 2003 server box with DBD-Oracle 1.21 and DBI 1.609 C:\perl -v This is perl, v5.8.9 built for MSWin32-x86-multi-thread (with 9 registered patches, see perl -V for more detail) Copyright 1987-2008, Larry Wall Binary build 825 [288577] provided by ActiveState http://www.ActiveState.com Built Dec 14 2008 21:07:41 Perl code follows #!/usr/bin/perl -I . require 5.001; use strict; use DBI; MAIN: { print Started\n; my $dbh = DBI-connect(dbi:Oracle:host=edc-dbserver;sid=HCSMDA, ais_dbo,PASSWORD, {RaiseError=1, PrintError=0}); my $sqlstmt = SELECT COUNT(*) FROM VESSEL_IDENTIFIERS; my($no_of_ships) = $dbh-selectrow_array($sqlstmt); print Got $no_of_ships ships\n } Executing the above, I get Started DBI connect('host=edc-dbserver;sid=HCSMDA','ais_dbo',...) failed: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) at C:\adbtest.pl line 15 I've got a standalone oracle database (11gr1) pointed to by host alias dbserver. If I use dbserver above instead of edc-dbserver, the script works fine. Also, tnsping gives the following C:\tnsping edc-dbserver TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-APR-2010 12:57:46 Copyright (c) 1997, 2005, Oracle. All rights reserved. Used parameter files: C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora Used HOSTNAME adapter to resolve the alias Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=edc-dbserver.nais.org))(ADDRESS =(PROTOCOL=TCP)(HOST=10.166.135.110)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)( HOST=10.166.135.112)(PORT=1521))) OK (0 msec) Any help would be greatly appreciated. E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax) Got a phone? Get Hotmail Messenger for mobile! http://go.microsoft.com/?linkid
Having a problem conneting to an Oracle 11gr2 RAC
Don't know if anyone has worked with the Oracle RAC environment and perl. Using sqlplus, I can do the following C:\sqlplus ais_dbo/passw...@edc-dbserver/HCSMDA SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 29 11:55:35 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options And then execute queries, updates ... From ActiveState perl running on a windows 2003 server box with DBD-Oracle 1.21 and DBI 1.609 C:\perl -v This is perl, v5.8.9 built for MSWin32-x86-multi-thread (with 9 registered patches, see perl -V for more detail) Copyright 1987-2008, Larry Wall Binary build 825 [288577] provided by ActiveState http://www.ActiveState.com Built Dec 14 2008 21:07:41 Perl code follows #!/usr/bin/perl -I . require 5.001; use strict; use DBI; MAIN: { print Started\n; my $dbh = DBI-connect(dbi:Oracle:host=edc-dbserver;sid=HCSMDA, ais_dbo,PASSWORD, {RaiseError=1, PrintError=0}); my $sqlstmt = SELECT COUNT(*) FROM VESSEL_IDENTIFIERS; my($no_of_ships) = $dbh-selectrow_array($sqlstmt); print Got $no_of_ships ships\n } Executing the above, I get Started DBI connect('host=edc-dbserver;sid=HCSMDA','ais_dbo',...) failed: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) at C:\adbtest.pl line 15 I've got a standalone oracle database (11gr1) pointed to by host alias dbserver. If I use dbserver above instead of edc-dbserver, the script works fine. Also, tnsping gives the following C:\tnsping edc-dbserver TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-APR-2010 12:57:46 Copyright (c) 1997, 2005, Oracle. All rights reserved. Used parameter files: C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora Used HOSTNAME adapter to resolve the alias Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=edc-dbserver.nais.org))(ADDRESS =(PROTOCOL=TCP)(HOST=10.166.135.110)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)( HOST=10.166.135.112)(PORT=1521))) OK (0 msec) Any help would be greatly appreciated. E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax)
Re: Looking for clever solution: Different versions of Oracle .so files within single Perl build
Try RMI::Client::ForkedPipes. Have the child process use one lib, and the parent use the other. The child can give back with one DBI/DBD, and the parent can produce handles from the other. This is effectively the proxy solution, but you're just forking and proxying to a private sub-process you created. (Full disclosure: I wrote the RMI modules. If they break for you please email me.) Scott jeff wrote: You make an incorrect assumption :-( Not trying to fool anyone or hide my identity, just hoping for further input. If you don't want to answer, then don't - but there is no need to be nasty about it. You shouldn't view people so negatively. As it turns out, the proxyserver is not a solution and database links are not an option - Not allowed to create. On Mon, 2009-12-14 at 20:54 +0100, Alexander Foken wrote: OK, while you were busy creating new threads, I remembered that this problem was discussed some time ago on this mailing list. I was about to mail you a link to that discussion for further information, like http://www.mail-archive.com/dbi-users@perl.org/msg32448.html, but then I saw that that therad was also started by you. We gave you several pointers how to solve this problem, from using a specific oracle client over proxy solutions to database links. We told you that it is impossible to include two different Oracle client libraries into one process. And we told you that you do not need to include two different Oracle client libraries into one process. Now, you ask basically the same question again, hoping that no body remembered that thread startet two months ago. Well, I did, and it seems you are resistant to consulting, both from Oracle experts and from experienced DBI users. So, why do you waste our time? Alexander On 14.12.2009 13:18, jeff wrote: I need to connect simultaneously to both Oracle 8 and oracle 10 from the same script using 'external' connection (ie, no username or password). The Oracle libraries, from my experimentations, are not compatible for external connections. Oracle 8 uses system ID and Oracle 10 uses wallet and they do not overlap. I need to stress that this is NOT an option. I have no say in this regardless of how insecure it may sound. Anyway, since Oracle DBD can only be built against 1 at a time , this presents a problem. I have been trying to use DBI Proxy in a PAR standalone for Oracle 8 connections and the usual setup for Oracle 10 connections with some limited success. What would be ideal would be to have 2 different Oracle DBD connections from within the same perl build. Any suggestions or ideas for potential solutions out there ? Thanks. Jeff
Re: Success ! Different versions of Oracle .so files within single Perl build
Great. Glad it works for you! jeff wrote: Thank you, Scott ! In case anyone else needs this sort of setup: I wanted to share this quick dirty successful test using Scott's RMI to connect to both oracle 10 with a wallet and oracle 8 with external authentication - no user names or passwords provided in script. ora8_lib contains the Oracle DBD for oracle 8 and only the forked server sees it. ld_library_path is also set to pick up both oracle clients. And prepare returns the query info as well - which is why proxyserver didn't work for me. looking very good so far ! use RMI::Client::ForkedPipes; use DBI; $c = RMI::Client::ForkedPipes-new(); $c-call_use('DBI'); my $paths = $c-call_eval('@main::x = @INC; return \...@main::x;'); foreach my $path (@{$paths}) { print $path\n; } print \n; $c-call_use_lib('/home/owuser1/perl58/perl_ora10/ora8_lib'); # A build of Oracle DBD using oracle 8 client my $paths = $c-call_eval('@main::x = @INC; return \...@main::x;'); foreach my $path (@{$paths}) { print $path\n; } print \n; $remote_dbh = $c-call_class_method('DBI','connect',dbi:Oracle:OWSERV1,'',''); print $remote_dbh\n; if (defined $remote_dbh) { my $sth = $remote_dbh-prepare(select sys_context('userenv','session_user') from dual); foreach my $name (@{$sth-{NAME}}) { print \t$name\n; } $sth-execute; print $sth-fetch; print OK :) Oracle8\n; } else { print No Connection Oracle8\n; } $remote_dbh-disconnect; my $db3=DBI-connect(dbi:Oracle:OWSERV2,'',''); print $db3\n; if (defined $db3) { my $sth = $db3-prepare(select sys_context('userenv','session_user') from dual); foreach my $name (@{$sth-{NAME}}) { print \t$name\n; } $sth-execute; print $sth-fetch; print OK :) Oracle10\n; } else { print No Connection Oracle10\n; } $db3-disconnect; $remote_dbh = $c-call_class_method('DBI','connect',dbi:Oracle:OWSERV1,'',''); print $remote_dbh\n; if (defined $remote_dbh) { my $sth = $remote_dbh-prepare(select sys_context('userenv','session_user') from dual); foreach my $name (@{$sth-{NAME}}) { print \t$name\n; } $sth-execute; print $sth-fetch; print OK :) Oracle8\n; } else { print No Connection Oracle8\n; } $remote_dbh-disconnect; On Mon, 2009-12-14 at 20:09 -0600, Scott Smith wrote: Try RMI::Client::ForkedPipes. Have the child process use one lib, and the parent use the other. The child can give back with one DBI/DBD, and the parent can produce handles from the other. This is effectively the proxy solution, but you're just forking and proxying to a private sub-process you created. (Full disclosure: I wrote the RMI modules. If they break for you please email me.) Scott
RE: Retrieving warnings after executing a MySQL INSERT statement
David, Thanks for the suggestion. It seems that $DBI::errstr is indeed empty after the INSERT statement that attempt to insert a string into an int column (example + output is below). One solution to this to not use DBI, and instead use the LOAD DATA statement via a Perl system statement with output directed to a file. That way I can keep track of errors when data is inserted into the database. -- EXAMPLE: my $table='people'; my $schema=EOF; CREATE TABLE $table ( name varchar(32) NOT NULL, age int NULL ); EOF $dbh-do(DROP TABLE IF EXISTS $table) or die Error dropping table $table: $DBI::errstr; $dbh-do($schema) or die Error initializing table $table: $DBI::errstr; my $insert=EOF; INSERT INTO $table VALUES (Bob,abc); EOF $dbh-do($insert) or die Error inserting data into table $table: $DBI::errstr; print Successful do operation: $insert; defined $DBI::errstr ? print DBI::errstr=$DBI::errstr\n : print DBI::errstr is not defined\n; print Goodbye\n; exit 0; OUTPUT: Successful do operation: INSERT INTO people VALUES (Bob,abc); DBI::errstr is not defined Goodbye -- Scott -Original Message- From: David Goodman [mailto:dtzgd...@yahoo.com] Sent: Tuesday, July 28, 2009 11:19 AM To: dbi-users@perl.org Subject: Re: Retrieving warnings after executing a MySQL INSERT statement Hello Scott: I suggest that you check to see if the string $DBI::errstr is empty rather than just whether the 'do' function executed correctly. It seems that the SQL is correctly submitted from the DBI side but the database server actually produces an error message. So this is a server side error message rather than a client side error message. regards, David --- On Tue, 7/28/09, Saccone, Scott ssacc...@wustl.edu wrote: From: Saccone, Scott ssacc...@wustl.edu Subject: Retrieving warnings after executing a MySQL INSERT statement To: dbi-users@perl.org dbi-users@perl.org Date: Tuesday, July 28, 2009, 11:19 AM Hello, I was wondering if the DBI can determine if there are warnings after an INSERT statement. For example, here's some MySQL code: mysql INSERT INTO test(id,name,age) VALUES (1,Bob,abc); Query OK, 1 row affected, 1 warning (0.00 sec) mysql show warnings; +-+--+--+ | Level | Code | Message | +-+--+--+ | Warning | 1366 | Incorrect integer value: 'sdc' for column 'age' at row 1 | +-+--+--+ 1 row in set (0.00 sec) If I do the same thing in the DBI, I don't seem to see any errors or warnings raised: $code=EOF; INSERT INTO test(id,name,age) VALUES(1,Bob,abc); EOF $dbh-do($code) or die Error loading data: $DBI::errstr; Thanks, Scott Scott Saccone, Ph.D. Department of Psychiatry, Box 8134 Washington University School of Medicine 660 South Euclid Avenue Saint Louis, Missouri 63110-1093 Voice: (314) 286-2581 FAX: (314) 286-2577 Email: ssacc...@wustl.edumailto:ssacc...@wustl.edu The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail. The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.
Retrieving warnings after executing a MySQL INSERT statement
Hello, I was wondering if the DBI can determine if there are warnings after an INSERT statement. For example, here's some MySQL code: mysql INSERT INTO test(id,name,age) VALUES (1,Bob,abc); Query OK, 1 row affected, 1 warning (0.00 sec) mysql show warnings; +-+--+--+ | Level | Code | Message | +-+--+--+ | Warning | 1366 | Incorrect integer value: 'sdc' for column 'age' at row 1 | +-+--+--+ 1 row in set (0.00 sec) If I do the same thing in the DBI, I don't seem to see any errors or warnings raised: $code=EOF; INSERT INTO test(id,name,age) VALUES(1,Bob,abc); EOF $dbh-do($code) or die Error loading data: $DBI::errstr; Thanks, Scott Scott Saccone, Ph.D. Department of Psychiatry, Box 8134 Washington University School of Medicine 660 South Euclid Avenue Saint Louis, Missouri 63110-1093 Voice: (314) 286-2581 FAX: (314) 286-2577 Email: ssacc...@wustl.edumailto:ssacc...@wustl.edu The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.
problems compiling DBD::mysql on solaris
Compiles fine : === I will use the following settings for compiling and testing: cflags(mysql_config ) = -I/usr/sfw/include/mysql -xstrconst -mt embedded (mysql_config ) = libs (mysql_config ) = -R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm mysql_config (Users choice ) = /usr/sfw/bin/mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb(default ) = test testhost (User's choice) = filesrv testpassword (User's choice) = tiger testsocket(default ) = testuser (User's choice) = scott To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Using DBI 1.609 (for perl 5.008009 on i86pc-solaris) installed in /usr/local/perl-5.8.9/lib/site_perl/5.8.9/i86pc-solaris/auto/DBI/ Writing Makefile for DBD::mysql sasserver3make\ cc -c -I/usr/local/perl-5.8.9/lib/site_perl/5.8.9/i86pc-solaris/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -O -DVERSION=\4.012\ -DXS_VERSION=\4.012\ -KPIC -I/usr/local/perl-5.8.9/lib/5.8.9/i86pc-solaris/CORE dbdimp.c cc -c -I/usr/local/perl-5.8.9/lib/site_perl/5.8.9/i86pc-solaris/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -O -DVERSION=\4.012\ -DXS_VERSION=\4.012\ -KPIC -I/usr/local/perl-5.8.9/lib/5.8.9/i86pc-solaris/CORE mysql.c mysql.xs, line 724: warning: implicit function declaration: is_prefix Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f blib/arch/auto/DBD/mysql/mysql.so LD_RUN_PATH=/usr/sfw/lib:/usr/lib /usr/local/bin/perl myld cc -G -L/usr/lib -L/usr/ccs/lib -L/opt/sunstudio12.1/prod/lib -L/lib -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so \ -R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm \ chmod 755 blib/arch/auto/DBD/mysql/mysql.so cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs chmod 644 blib/arch/auto/DBD/mysql/mysql.bs Manifying blib/man3/DBD::mysql.3 Manifying blib/man3/DBD::mysql::INSTALL.3 Manifying blib/man3/Bundle::DBD::mysql.3 = Then 00base.t fails, perl -Mblib t/00base.t 1..6 ok 1 - use DBI; not ok 2 - use DBD::mysql; # Failed test 'use DBD::mysql;' # at t/00base.t line 21. # Tried to use 'DBD::mysql'. # Error: Can't load '/usr/local/perl-5.8.9/cpan/build/DBD-mysql-4.012-5jjwv5/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /usr/local/perl-5.8.9/cpan/build/DBD-mysql-4.012-5jjwv5/blib/arch/auto/DBD/mysql/mysql.so: symbol net_buffer_length: referenced symbol not found at /usr/local/perl-5.8.9/lib/5.8.9/i86pc-solaris/DynaLoader.pm line 226. # at (eval 9) line 2 # Compilation failed in require at (eval 9) line 2. # BEGIN failed--compilation aborted at (eval 9) line 2. Bail out! Unable to load DBD::mysql = ldd /usr/local/perl-5.8.9/cpan/build/DBD-mysql-4.012-5jjwv5/blib/arch/auto/DBD/mysql/mysql.so libz.so.1 = /usr/lib/libz.so.1 librt.so.1 =/lib/librt.so.1 libcrypt_d.so.1 = /usr/lib/libcrypt_d.so.1 libgen.so.1 = /lib/libgen.so.1 libsocket.so.1 =/lib/libsocket.so.1 libnsl.so.1 = /lib/libnsl.so.1 libm.so.2 = /lib/libm.so.2 libc.so.1 = /lib/libc.so.1 libaio.so.1 = /lib/libaio.so.1 libmd.so.1 =/lib/libmd.so.1 libmp.so.2 =/lib/libmp.so.2 libscf.so.1 = /lib/libscf.so.1 libdoor.so.1 = /lib/libdoor.so.1 libuutil.so.1 = /lib/libuutil.so.1 I can't figure out why the libmysqlclient is not being linked into the mysql.so? = Summary of my perl5 (revision 5 version 8 subversion 9) configuration: Platform: osname=solaris, osvers=2.10, archname=i86pc-solaris uname='sunos sasserver3 5.10 generic_141415-03 i86pc i386 i86pc ' config_args='-de -Dprefix=/usr/local/perl-5.8.9 ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE
Re: DBD::ODBC make test fails - unixODBC/Easysoft/SQL Server 2008
Yes. Thank you again. Best regards, Scott... On Jun 30, 2009, at 11:52 AM, Martin Evans wrote: Scott Stansbury wrote: Getting closer :) I'm trying to connect to a SQL Server 2008 instance from a CentOS5 box: unixODBC: 2.2.14 FreeTDS:0.82 Easysoft: odbc-sqlserver-1.1.26-linux-x86 (this morning, thank you again Martin and Wez...) osql/isql work fine with both the FreeTDS and the Easysoft drivers. Connecting to a SQL Server 2008 instance running on a Server 2008 box. DBB::ODBC make test fails as follows: [r...@server1 DBD-ODBC-1.22-D2_Zne]# make test PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/*.t t/01base.t .. ok t/02simple.t 3/65 # # Perl 5.8.8 # osname=linux, osvers=2.6.18-53.el5, archname=i386-linux-thread- multi # Using DBI 1.609 # Using DBD::ODBC 1.22 # Using DBMS_NAME 'Microsoft SQL Server' # Using DBMS_VER '10.00.1600' # Using DRIVER_NAME 'libessqlsrv.so' # Using DRIVER_VER '01.01.0026' # odbc_has_unicode 0 t/02simple.t 35/65 # Failed test 'data sources test' # at t/02simple.t line 259. # '0' # # '0' # Looks like you failed 1 test of 65. t/02simple.t Dubious, test returned 1 (wstat 256, 0x100) Failed 1/65 subtests t/03dbatt.t . 3/29 # # N.B. Some drivers (postgres/cache) may return ODBC 2.0 column names for the SQLTables result-set e.g. TABLE_QUALIFIER instead of TABLE_CAT t/03dbatt.t . ok t/05meth.t .. ok t/07bind.t .. ok t/08bind2.t . ok t/09multi.t . ok t/10handler.t ... ok t/12blob.t .. ok t/20SqlServer.t . ok t/30Oracle.t ok t/40UnicodeRoundTrip.t .. ok t/41Unicode.t ... ok t/pod-coverage.t ok t/pod.t . ok t/rt_38977.t ok t/rt_39841.t ok t/rt_39897.t ok t/rt_43384.t ok t/rt_46597.t ok t/rt_null_nvarchar.t ok Test Summary Report --- t/02simple.t (Wstat: 256 Tests: 65 Failed: 1) Failed test: 56 Non-zero exit status: 1 Files=21, Tests=445, 33 wallclock secs ( 0.02 usr 0.26 sys + 0.27 cusr 2.17 csys = 2.72 CPU) Result: FAIL Failed 1/21 test programs. 1/445 subtests failed. make: *** [test_dynamic] Error 255 As always, thanks! Best regards, Scott... Scott, Sorry for not answering sooner - somehow I missed your follow up. The test that fails is looking for a data source i.e., it called DBI-data_sources('ODBC') and it should be testing the returned array to check there is more than 0 entries but in fact it does: cmp_ok($#data_sources, '', 0, data sources test); so if you only have one data source it fails. You can rectify the test yourself by changing the above to =. This does not indicate any problem with the driver your are using or your setup. Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com
DBD::ODBC make test fails - unixODBC/Easysoft/SQL Server 2008
Getting closer :) I'm trying to connect to a SQL Server 2008 instance from a CentOS5 box: unixODBC: 2.2.14 FreeTDS:0.82 Easysoft: odbc-sqlserver-1.1.26-linux-x86 (this morning, thank you again Martin and Wez...) osql/isql work fine with both the FreeTDS and the Easysoft drivers. Connecting to a SQL Server 2008 instance running on a Server 2008 box. DBB::ODBC make test fails as follows: [r...@server1 DBD-ODBC-1.22-D2_Zne]# make test PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/*.t t/01base.t .. ok t/02simple.t 3/65 # # Perl 5.8.8 # osname=linux, osvers=2.6.18-53.el5, archname=i386-linux-thread-multi # Using DBI 1.609 # Using DBD::ODBC 1.22 # Using DBMS_NAME 'Microsoft SQL Server' # Using DBMS_VER '10.00.1600' # Using DRIVER_NAME 'libessqlsrv.so' # Using DRIVER_VER '01.01.0026' # odbc_has_unicode 0 t/02simple.t 35/65 # Failed test 'data sources test' # at t/02simple.t line 259. # '0' # # '0' # Looks like you failed 1 test of 65. t/02simple.t Dubious, test returned 1 (wstat 256, 0x100) Failed 1/65 subtests t/03dbatt.t . 3/29 # # N.B. Some drivers (postgres/cache) may return ODBC 2.0 column names for the SQLTables result-set e.g. TABLE_QUALIFIER instead of TABLE_CAT t/03dbatt.t . ok t/05meth.t .. ok t/07bind.t .. ok t/08bind2.t . ok t/09multi.t . ok t/10handler.t ... ok t/12blob.t .. ok t/20SqlServer.t . ok t/30Oracle.t ok t/40UnicodeRoundTrip.t .. ok t/41Unicode.t ... ok t/pod-coverage.t ok t/pod.t . ok t/rt_38977.t ok t/rt_39841.t ok t/rt_39897.t ok t/rt_43384.t ok t/rt_46597.t ok t/rt_null_nvarchar.t ok Test Summary Report --- t/02simple.t (Wstat: 256 Tests: 65 Failed: 1) Failed test: 56 Non-zero exit status: 1 Files=21, Tests=445, 33 wallclock secs ( 0.02 usr 0.26 sys + 0.27 cusr 2.17 csys = 2.72 CPU) Result: FAIL Failed 1/21 test programs. 1/445 subtests failed. make: *** [test_dynamic] Error 255 As always, thanks! Best regards, Scott...
DBD::ODBC make test fails - unixODBC/Easysoft/SQL Server 2008
, test returned 13 (wstat 3328, 0xd00) Failed 2/11 subtests t/rt_39841.t ok t/rt_39897.t ok t/rt_43384.t ok t/rt_46597.t ok t/rt_null_nvarchar.t ok Test Summary Report --- t/20SqlServer.t (Wstat: 512 Tests: 65 Failed: 2) Failed tests: 7, 11 Non-zero exit status: 2 t/rt_38977.t (Wstat: 3328 Tests: 10 Failed: 1) Failed test: 8 Non-zero exit status: 13 Parse errors: Bad plan. You planned 11 tests but ran 10. Files=21, Tests=444, 30 wallclock secs ( 0.02 usr 0.28 sys + 0.35 cusr 2.49 csys = 3.14 CPU) Result: FAIL Failed 2/21 test programs. 3/444 subtests failed. make: *** [test_dynamic] Error 255 Thanks for any insight... Best regards, Scott...
Re: Announce: DBI 1.609
On Fri, 2009-06-12 at 14:38 -0700, Greg Eldridge wrote: How long until it moves into cpan[0] install DBD ?? typo? should be 'install DBI' or 'install Bundle::DBI' Thanks, Greg On Tue, 2009-06-09 at 16:46 +0100, Tim Bunce wrote: file: $CPAN/authors/id/T/TI/TIMB/DBI-1.609.tar.gz size: 510309 bytes md5: e4689870b3f7ce503022a076c53284ed =head2 Changes in DBI 1.609 (svn r12816) 8th June 2009 Fixes to DBD::File (H.Merijn Brand) added f_schema attributeH table names case sensitive when quoted, insensitive when unquoted workaround a bug in SQL::Statement (temporary fix) related to the You passed x parameters where y required error Added ImplementorClass and Name info to the Issuing rollback() due to DESTROY without explicit disconnect warning to identify the handle. Applies to compiled drivers when they are recompiled. Added DBI-visit_handles($coderef) method. Added $h-visit_child_handles($coderef) method. Added docs for column_info()'s COLUMN_DEF value. Clarified docs on stickyness of data type via bind_param(). Clarified docs on stickyness of data type via bind_col(). =cut Enjoy! Tim.
RE: unable to write from a select into outfile
All: I'm running on a windows XP box with latest MS updates, ActiveState perl (v5.10.0 built for MSWin32-x86-multi-thread) DBI (1.607) DBD-ODBC (1.21) SQL Server 2005 (SP3) Seems like all of a sudden queries against my database are not returning the correct data. First noticed when executing a query like Select a, b, c from vtbl where a like 'test%' And nothing was returned. I've got a record where a is 'test.' After playing with that for a while, for example trying select a,b,c from vtbl where a='test.', I tried select a,b,c from vtbl where a like 'a%' and got back 9 out of 8013 expected records. Most of the records that I did not get back have embedded periods or single quotes or dashes. Note that the same queries executed in the sql server enterprise manager and sqlcmd return the correct results. Also, I have not tried with earlier versions of dbd-odbc yet. Any light that can be shed on this would be greatly appreciated. E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax)
RE: unable to write from a select into outfile
Apologies for the email. I've got about a dozen web sites in my dev environment. Changed IIS params for one and apparently hosed up all. Fixed the params and all is well again. Found it by tracing and not connecting to the database I thought I was connecting to. Enough overlap in the DBs that I did not pick up on it right away. E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax) -Original Message- From: Martin Evans [mailto:martin.ev...@easysoft.com] Sent: Friday, May 15, 2009 1:02 PM To: Stricker, Scott E (IS) Cc: dbi-users@perl.org Subject: Re: unable to write from a select into outfile -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stricker, Scott E (IS) wrote: All: I'm running on a windows XP box with latest MS updates, ActiveState perl (v5.10.0 built for MSWin32-x86-multi-thread) DBI (1.607) DBD-ODBC (1.21) SQL Server 2005 (SP3) Seems like all of a sudden queries against my database are not returning the correct data. First noticed when executing a query like Select a, b, c from vtbl where a like 'test%' And nothing was returned. I've got a record where a is 'test.' After playing with that for a while, for example trying select a,b,c from vtbl where a='test.', I tried select a,b,c from vtbl where a like 'a%' and got back 9 out of 8013 expected records. Most of the records that I did not get back have embedded periods or single quotes or dashes. Note that the same queries executed in the sql server enterprise manager and sqlcmd return the correct results. Also, I have not tried with earlier versions of dbd-odbc yet. Any light that can be shed on this would be greatly appreciated. E. Scott Stricker Senior Software Engineer Northrop Grumman - Information Systems - C2SD MailStop 4S02 2340 Dulles Corner Blvd. Herndon, VA 20171 703-561-3671 703-713-1601 (fax) If you enable a DBI trace at level 15 and send it to me I'll take a look. It would also be good if you can add the following to the start of your test script as it enables extra logging that would be useful: use DBD::ODBC; DBI-trace(DBD::ODBC-parse_trace_flags('odbcconnection|odbcunicode')); Perhaps you could explain what you mean by all of a sudden. Before this happened what was happening correctly with what versions? Martin - -- Martin J. Evans Easysoft Limited http://www.easysoft.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFKDaAchd1KVpsamNgRAgQLAJ98VUcsp6uFJpJ7RhTw5xe84XmbYwCfc4SG XE1lPlcVEkTx+jwVNRKv5p8= =qz+a -END PGP SIGNATURE-
5.8.9 eating up memory with AUTOLOAD
Hello, I'm having a strange problem. I compiled 5.8.9 on SUSE Linux Enterprise Server 10 (x86_64), installed DBI DBD::Oracle. We are running Oracle 11g on this server. Running a program that uses DBI/DBD::Oracle, the process locked the server up by using all the memory and swap. The server has 32 gig of memory and I believe 16 gig of swap. Running in the debugger, I isolated the problem in DBD/Oracle.pm, my $oci = DBD::Oracle::ORA_OCI(); sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname); *$AUTOLOAD = sub { $val }; goto $AUTOLOAD; } AUTOLOAD loads DBD::Oracle::ORA_OCI, which triggers the loading of DBD::Oracle::constant. DBD::Oracle::constant is not found, so constant is loaded, not found, constant loadedetc I checked Oracle.so (just in case for some crazy reason constant didn't get in the so) it's there. What perplexes me is this perl install is the just like several other servers we have. The one big difference is there is an 11g Oracle server running on this box. I have the same set up on an open-SuSE box that works fine, but it is only using the 11g client. The only problems I had when compiling DBD::Oracle was the lob-plsql test failing, otherwise everything worked fine. I don't even know if Oracle is the issue here. Should I post to P5P? Thanks Scott Summary of my perl5 (revision 5 version 8 subversion 9) configuration: Platform: osname=linux, osvers=2.6.27.19, archname=x86_64-linux uname='linux srv12 2.6.27.19 #1 smp mon feb 23 16:46:24 cst 2009 x86_64 x86_64 x86_64 gnulinux ' config_args='-de -Dprefix=/usr/local/perl-5.8.9 -Dnoextensions=ODBM_File -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dldflags=-L/usr/local/lib64 -Duse64bitall=define' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.1.2 20070115 (SUSE Linux)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.4.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_FAST_STDIO USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Mar 31 2009 10:07:10 %ENV: PERL5LIB=/usr/local/lib/tools/perlmodules @INC: /usr/local/lib/tools/perlmodules /usr/local/perl-5.8.9/lib/5.8.9/x86_64-linux /usr/local/perl-5.8.9/lib/5.8.9 /usr/local/perl-5.8.9/lib/site_perl/5.8.9/x86_64-linux /usr/local/perl-5.8.9/lib/site_perl/5.8.9 .
Re: 5.8.9 eating up memory with AUTOLOAD in DBD::Oracle
Wanted to change the subject. On Wed, 2009-04-01 at 11:11 -0500, Scott T. Hildreth wrote: Hello, I'm having a strange problem. I compiled 5.8.9 on SUSE Linux Enterprise Server 10 (x86_64), installed DBI DBD::Oracle. We are running Oracle 11g on this server. Running a program that uses DBI/DBD::Oracle, the process locked the server up by using all the memory and swap. The server has 32 gig of memory and I believe 16 gig of swap. Running in the debugger, I isolated the problem in DBD/Oracle.pm, my $oci = DBD::Oracle::ORA_OCI(); sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname); *$AUTOLOAD = sub { $val }; goto $AUTOLOAD; } AUTOLOAD loads DBD::Oracle::ORA_OCI, which triggers the loading of DBD::Oracle::constant. DBD::Oracle::constant is not found, so constant is loaded, not found, constant loadedetc I checked Oracle.so (just in case for some crazy reason constant didn't get in the so) it's there. What perplexes me is this perl install is the just like several other servers we have. The one big difference is there is an 11g Oracle server running on this box. I have the same set up on an open-SuSE box that works fine, but it is only using the 11g client. The only problems I had when compiling DBD::Oracle was the lob-plsql test failing, otherwise everything worked fine. I don't even know if Oracle is the issue here. Should I post to P5P? Thanks Scott Summary of my perl5 (revision 5 version 8 subversion 9) configuration: Platform: osname=linux, osvers=2.6.27.19, archname=x86_64-linux uname='linux srv12 2.6.27.19 #1 smp mon feb 23 16:46:24 cst 2009 x86_64 x86_64 x86_64 gnulinux ' config_args='-de -Dprefix=/usr/local/perl-5.8.9 -Dnoextensions=ODBM_File -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dldflags=-L/usr/local/lib64 -Duse64bitall=define' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.1.2 20070115 (SUSE Linux)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.4.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_FAST_STDIO USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Mar 31 2009 10:07:10 %ENV: PERL5LIB=/usr/local/lib/tools/perlmodules @INC: /usr/local/lib/tools/perlmodules /usr/local/perl-5.8.9/lib/5.8.9/x86_64-linux /usr/local/perl-5.8.9/lib/5.8.9 /usr/local/perl-5.8.9/lib/site_perl/5.8.9/x86_64-linux /usr/local/perl-5.8.9/lib/site_perl/5.8.9 .
Re: 5.8.9 eating up memory with AUTOLOAD in DBD::Oracle
On Wed, 2009-04-01 at 12:54 -0500, Scott T. Hildreth wrote: Wanted to change the subject. On Wed, 2009-04-01 at 11:11 -0500, Scott T. Hildreth wrote: Hello, I'm having a strange problem. I compiled 5.8.9 on SUSE Linux Enterprise Server 10 (x86_64), installed DBI DBD::Oracle. We are running Oracle 11g on this server. Running a program that uses DBI/DBD::Oracle, the process locked the server up by using all the memory and swap. The server has 32 gig of memory and I believe 16 gig of swap. Running in the debugger, I isolated the problem in DBD/Oracle.pm, So, I asked our Dba to install the 10g client for me. I recompiled DBD::Oracle using the 10g client. Ran the same code and wa la. I really am not liking the 11g client libraries. my $oci = DBD::Oracle::ORA_OCI(); sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname); *$AUTOLOAD = sub { $val }; goto $AUTOLOAD; } AUTOLOAD loads DBD::Oracle::ORA_OCI, which triggers the loading of DBD::Oracle::constant. DBD::Oracle::constant is not found, so constant is loaded, not found, constant loadedetc I checked Oracle.so (just in case for some crazy reason constant didn't get in the so) it's there. What perplexes me is this perl install is the just like several other servers we have. The one big difference is there is an 11g Oracle server running on this box. I have the same set up on an open-SuSE box that works fine, but it is only using the 11g client. The only problems I had when compiling DBD::Oracle was the lob-plsql test failing, otherwise everything worked fine. I don't even know if Oracle is the issue here. Should I post to P5P? Thanks Scott Summary of my perl5 (revision 5 version 8 subversion 9) configuration: Platform: osname=linux, osvers=2.6.27.19, archname=x86_64-linux uname='linux srv12 2.6.27.19 #1 smp mon feb 23 16:46:24 cst 2009 x86_64 x86_64 x86_64 gnulinux ' config_args='-de -Dprefix=/usr/local/perl-5.8.9 -Dnoextensions=ODBM_File -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dldflags=-L/usr/local/lib64 -Duse64bitall=define' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.1.2 20070115 (SUSE Linux)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.4.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_FAST_STDIO USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Mar 31 2009 10:07:10 %ENV: PERL5LIB=/usr/local/lib/tools/perlmodules @INC: /usr/local/lib/tools/perlmodules /usr/local/perl-5.8.9/lib/5.8.9/x86_64-linux /usr/local/perl-5.8.9/lib/5.8.9 /usr/local/perl-5.8.9/lib/site_perl/5.8.9/x86_64-linux /usr/local/perl-5.8.9/lib/site_perl/5.8.9 .
Re: DBD::Oracle on Oracle 11g 64 bit fedora 10
On Thu, 2009-03-26 at 06:49 -0400, John Scoles wrote: Scott T. Hildreth wrote: On Mon, 2009-01-19 at 20:26 +, Russell, Gordon wrote: Hi. I am hoping someone can look over this install info and tell me if it is all ok? I am having some worries with a new install of fedora 10. I also installed oracle 11.1.0.7. I have the latest DBI and am installing DBD Oracle 1.22. Note I have used DBD and Oracle for many many years. I have a 64 bit environment, UTF8 database and linux, with 32 bit compatibility libraries installed only to make the oracle installer tests happy. Gordon, Did you ever resolve this? We are moving to 11g now and I am having the same issue. I originally thought it was a 11g client = 10g db problem, but I can reproduce it trying to compile DBD::Oracle using a 11g db. Oracle 11.1.0.7.0 is installed on SUSE Linux Enterprise Server 10 (x86_64). Thanks, Scott. In short, it works but produces some test errors. Not sure if I should just ignore them! Plenty of information follows... any suggestions appreciated. When building DBD Oracle, the tests come up with 3 fails: Test Summary Report --- t/26exe_array (Wstat: 512 Tests: 14 Failed: 2) Failed tests: 11, 14 Non-zero exit status: 2 I have raised this many time with Oracle as I think it is a bug on the 11g side as no code has changed. They of course say it is DBD::Oracle fault. It might have to do with space, buffering or permissions unfortunately I do not have steady access to an 11 db to do more extensive testing. John, are you specifically talking about the exe_array here? Just for the record all my tests pass, except the plsql test in 31lob.t t/30long(Wstat: 512 Tests: 30 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 479 tests but ran 30. t/31lob (Wstat: 256 Tests: 6 Failed: 1) Failed test: 6 Non-zero exit status: 1 Parse errors: Bad plan. You planned 9 tests but ran 6. The actual errors are: t/26exe_array... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/14 subtests t/30longpanic: sv_len_utf8 cache 10240 real 81920 for 1234 t/31lob.DBD::Oracle::st execute failed: ORA-24813: cannot send or receive an unsupported LOB (DBD ERROR: OCIStmtExecute) [for Statement BEGIN ? := DBMS_LOB.GETLENGTH( ? ); END; with ParamValues: :p1=undef, :p2=OCILobLocatorPtr=SCALAR(0x19cb018)] at t/31lob.t line 108. Installing it anyway seems ok, but running: my $dbh = DBI-connect_cached('dbi:Oracle:sid',username,password,{ RaiseError= 1, PrintError= 0, ShowErrorStatement= 1, AutoCommit= 0, ora_verbose=6 }) Produces: OCINlsEnvironmentVariableGet(871,0,93,0,2)=SUCCESS OCINlsEnvironmentVariableGet(871,0,94,0,2)=SUCCESS OCINlsEnvCreate(1b8c5d0,THREADED | OBJECT,3,0,0,0,0,0,0,871,871)=SUCCESS OCIHandleAlloc(1c06220,1b8c5d8,OCI_HTYPE_ERROR,0,0)=SUCCESS charset id=871, name=UTF8, ncharset id=871, name=UTF8 (csid: utf8=871 al32utf8=873) OCIHandleAlloc(1c06220,1b8c5e0,OCI_HTYPE_SERVER,0,0)=SUCCESS OCIHandleAlloc(1c06220,1b8c5e8,OCI_HTYPE_SVCCTX,0,0)=SUCCESS OCIServerAttach(1c45608, 1c44e68, sid, 3, mode=DEFAULT,0)=SUCCESS OCIAttrSet(1c44d90,OCI_HTYPE_SVCCTX,1c45608,0,6,1c44e68)=SUCCESS OCIHandleAlloc(1c06220,1b8c5f0,OCI_HTYPE_SESSION,0,0)=SUCCESS OCIAttrSet(1c81838,OCI_HTYPE_SESSION,1a1d348,8,22,1c44e68)=SUCCESS OCIAttrSet(1c81838,OCI_HTYPE_SESSION,1917d08,6,23,1c44e68)=SUCCESS OCISessionBegin(1c44d90,1c44e68,1c81838,1,mode=DEFAULT 0)=SUCCESS OCIAttrSet(1c44d90,OCI_HTYPE_SVCCTX,1c81838,0,7,1c44e68)=SUCCESS DBI::db=HASH(0x1919710) is not exported by the DBD::Oracle module Can't continue after import errors at ./demo.pl line 7 BEGIN failed--compilation aborted at ./demo.pl line 15. OCITransRollback(1c44d90,1c44e68,mode=DEFAULT 0)=SUCCESS OCISessionEnd(1c44d90,1c44e68,1c81838,mode=DEFAULT 0)=SUCCESS OCIServerDetach(1c45608,1c44e68,mode=DEFAULT,0)=SUCCESS OCIHandleFree(1c81838,OCI_HTYPE_SESSION)=SUCCESS OCIHandleFree(1c45608,OCI_HTYPE_SERVER)=SUCCESS OCIHandleFree(1c44d90,OCI_HTYPE_SVCCTX)=SUCCESS OCIHandleFree(1c44e68,OCI_HTYPE_ERROR)=SUCCESS Looking through the makefile and running ldd on the .so file it seems to have only used the 64 bit oracle libraries Let me know if I can add anything. Thanks Gordon. Napier University is the best modern university in Scotland* and number one in Scotland for graduate employability** (*Guardian University Guide 2009) (**HESA 2008) This message is intended for the addressee(s) only and should not be read
Re: DBD::Oracle on Oracle 11g 64 bit fedora 10
On Thu, 2009-03-26 at 11:45 -0400, John Scoles wrote: Scott T. Hildreth wrote: On Thu, 2009-03-26 at 06:49 -0400, John Scoles wrote: Scott T. Hildreth wrote: On Mon, 2009-01-19 at 20:26 +, Russell, Gordon wrote: Hi. I am hoping someone can look over this install info and tell me if it is all ok? I am having some worries with a new install of fedora 10. I also installed oracle 11.1.0.7. I have the latest DBI and am installing DBD Oracle 1.22. Note I have used DBD and Oracle for many many years. I have a 64 bit environment, UTF8 database and linux, with 32 bit compatibility libraries installed only to make the oracle installer tests happy. Gordon, Did you ever resolve this? We are moving to 11g now and I am having the same issue. I originally thought it was a 11g client = 10g db problem, but I can reproduce it trying to compile DBD::Oracle using a 11g db. Oracle 11.1.0.7.0 is installed on SUSE Linux Enterprise Server 10 (x86_64). Thanks, Scott. In short, it works but produces some test errors. Not sure if I should just ignore them! Plenty of information follows... any suggestions appreciated. When building DBD Oracle, the tests come up with 3 fails: Test Summary Report --- t/26exe_array (Wstat: 512 Tests: 14 Failed: 2) Failed tests: 11, 14 Non-zero exit status: 2 I have raised this many time with Oracle as I think it is a bug on the 11g side as no code has changed. They of course say it is DBD::Oracle fault. It might have to do with space, buffering or permissions unfortunately I do not have steady access to an 11 db to do more extensive testing. John, are you specifically talking about the exe_array here? Just for the record all my tests pass, except the plsql test in 31lob.t Yes that is the case I was talking about the exe_array. I wonder it there is a patch difference in your two Oracles or you have some different settings? I can have the DBA send me what patches have been applied, if you like. I am going to debug the 31lob.t test some more, I will report back my findings. cheers t/30long(Wstat: 512 Tests: 30 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 479 tests but ran 30. t/31lob (Wstat: 256 Tests: 6 Failed: 1) Failed test: 6 Non-zero exit status: 1 Parse errors: Bad plan. You planned 9 tests but ran 6. The actual errors are: t/26exe_array... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/14 subtests t/30longpanic: sv_len_utf8 cache 10240 real 81920 for 1234 t/31lob.DBD::Oracle::st execute failed: ORA-24813: cannot send or receive an unsupported LOB (DBD ERROR: OCIStmtExecute) [for Statement BEGIN ? := DBMS_LOB.GETLENGTH( ? ); END; with ParamValues: :p1=undef, :p2=OCILobLocatorPtr=SCALAR(0x19cb018)] at t/31lob.t line 108. Installing it anyway seems ok, but running: my $dbh = DBI-connect_cached('dbi:Oracle:sid',username,password,{ RaiseError= 1, PrintError= 0, ShowErrorStatement= 1, AutoCommit= 0, ora_verbose=6 }) Produces: OCINlsEnvironmentVariableGet(871,0,93,0,2)=SUCCESS OCINlsEnvironmentVariableGet(871,0,94,0,2)=SUCCESS OCINlsEnvCreate(1b8c5d0,THREADED | OBJECT,3,0,0,0,0,0,0,871,871)=SUCCESS OCIHandleAlloc(1c06220,1b8c5d8,OCI_HTYPE_ERROR,0,0)=SUCCESS charset id=871, name=UTF8, ncharset id=871, name=UTF8 (csid: utf8=871 al32utf8=873) OCIHandleAlloc(1c06220,1b8c5e0,OCI_HTYPE_SERVER,0,0)=SUCCESS OCIHandleAlloc(1c06220,1b8c5e8,OCI_HTYPE_SVCCTX,0,0)=SUCCESS OCIServerAttach(1c45608, 1c44e68, sid, 3, mode=DEFAULT,0)=SUCCESS OCIAttrSet(1c44d90,OCI_HTYPE_SVCCTX,1c45608,0,6,1c44e68)=SUCCESS OCIHandleAlloc(1c06220,1b8c5f0,OCI_HTYPE_SESSION,0,0)=SUCCESS OCIAttrSet(1c81838,OCI_HTYPE_SESSION,1a1d348,8,22,1c44e68)=SUCCESS OCIAttrSet(1c81838,OCI_HTYPE_SESSION,1917d08,6,23,1c44e68)=SUCCESS OCISessionBegin(1c44d90,1c44e68,1c81838,1,mode=DEFAULT 0)=SUCCESS OCIAttrSet(1c44d90,OCI_HTYPE_SVCCTX,1c81838,0,7,1c44e68)=SUCCESS DBI::db=HASH(0x1919710) is not exported by the DBD::Oracle module Can't continue after import errors at ./demo.pl line 7 BEGIN failed--compilation aborted at ./demo.pl line 15. OCITransRollback(1c44d90,1c44e68,mode=DEFAULT 0)=SUCCESS OCISessionEnd(1c44d90,1c44e68,1c81838,mode=DEFAULT 0)=SUCCESS OCIServerDetach(1c45608,1c44e68,mode=DEFAULT,0)=SUCCESS OCIHandleFree(1c81838,OCI_HTYPE_SESSION)=SUCCESS OCIHandleFree(1c45608,OCI_HTYPE_SERVER)=SUCCESS OCIHandleFree(1c44d90,OCI_HTYPE_SVCCTX)=SUCCESS
Re: DBD::Oracle on Oracle 11g 64 bit fedora 10
On Thu, 2009-03-26 at 10:48 -0500, Scott T. Hildreth wrote: On Thu, 2009-03-26 at 11:45 -0400, John Scoles wrote: Scott T. Hildreth wrote: On Thu, 2009-03-26 at 06:49 -0400, John Scoles wrote: Scott T. Hildreth wrote: On Mon, 2009-01-19 at 20:26 +, Russell, Gordon wrote: Hi. I am hoping someone can look over this install info and tell me if it is all ok? I am having some worries with a new install of fedora 10. I also installed oracle 11.1.0.7. I have the latest DBI and am installing DBD Oracle 1.22. Note I have used DBD and Oracle for many many years. I have a 64 bit environment, UTF8 database and linux, with 32 bit compatibility libraries installed only to make the oracle installer tests happy. Gordon, Did you ever resolve this? We are moving to 11g now and I am having the same issue. I originally thought it was a 11g client = 10g db problem, but I can reproduce it trying to compile DBD::Oracle using a 11g db. Oracle 11.1.0.7.0 is installed on SUSE Linux Enterprise Server 10 (x86_64). Thanks, Scott. In short, it works but produces some test errors. Not sure if I should just ignore them! Plenty of information follows... any suggestions appreciated. When building DBD Oracle, the tests come up with 3 fails: Test Summary Report --- t/26exe_array (Wstat: 512 Tests: 14 Failed: 2) Failed tests: 11, 14 Non-zero exit status: 2 I have raised this many time with Oracle as I think it is a bug on the 11g side as no code has changed. They of course say it is DBD::Oracle fault. It might have to do with space, buffering or permissions unfortunately I do not have steady access to an 11 db to do more extensive testing. John, are you specifically talking about the exe_array here? Just for the record all my tests pass, except the plsql test in 31lob.t Yes that is the case I was talking about the exe_array. I wonder it there is a patch difference in your two Oracles or you have some different settings? I can have the DBA send me what patches have been applied, if you like. I am going to debug the 31lob.t test some more, I will report back my findings. It is definitely a 11g client issue. I can use a 10g client, connecting to a 11g db and the test works fine. Our DBA had me declare local vars inside the plsql test, just testing different things, so my statement is a little different; same problem, ok 1 - returned valid locator ok 2 - returned valid locator ok 3 - returned valid locator ok 4 - returned length ok 5 - returned written value DBD::Oracle::st execute failed: ORA-24813: cannot send or receive an unsupported LOB (DBD ERROR: OCIStmtExecute) [for Statement declare xlen number ; xlob blob; B xlob := ?; xlen := DBMS_LOB.GETLENGTH( xlob ); END; with ParamValues: :p1=undef, :p2=OCILobLocatorPtr=SCALAR(0xa5b490)] at t/31lob.t line 108. at t/31lob.t line 108 not ok 6 - returned length via PL/SQL Errors in file : OCI-21500: internal error code, arguments: [kghufree_06], [0x00100AF68], [0], [0], [0], [], [], [] Errors in file : OCI-21500: internal error code, arguments: [kghufree_06], [0x00100AF68], [0], [0], [0], [], [], [] cheers t/30long(Wstat: 512 Tests: 30 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 479 tests but ran 30. t/31lob (Wstat: 256 Tests: 6 Failed: 1) Failed test: 6 Non-zero exit status: 1 Parse errors: Bad plan. You planned 9 tests but ran 6. The actual errors are: t/26exe_array... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/14 subtests t/30longpanic: sv_len_utf8 cache 10240 real 81920 for 1234 t/31lob.DBD::Oracle::st execute failed: ORA-24813: cannot send or receive an unsupported LOB (DBD ERROR: OCIStmtExecute) [for Statement BEGIN ? := DBMS_LOB.GETLENGTH( ? ); END; with ParamValues: :p1=undef, :p2=OCILobLocatorPtr=SCALAR(0x19cb018)] at t/31lob.t line 108. Installing it anyway seems ok, but running: my $dbh = DBI-connect_cached('dbi:Oracle:sid',username,password,{ RaiseError= 1, PrintError= 0, ShowErrorStatement= 1, AutoCommit= 0, ora_verbose=6 }) Produces: OCINlsEnvironmentVariableGet(871,0,93,0,2)=SUCCESS OCINlsEnvironmentVariableGet(871,0,94,0,2)=SUCCESS OCINlsEnvCreate(1b8c5d0,THREADED | OBJECT,3,0,0,0,0,0,0,871,871)=SUCCESS OCIHandleAlloc(1c06220,1b8c5d8,OCI_HTYPE_ERROR,0,0)=SUCCESS charset id=871, name=UTF8, ncharset id=871, name=UTF8 (csid: utf8=871 al32utf8=873) OCIHandleAlloc(1c06220,1b8c5e0,OCI_HTYPE_SERVER,0,0)=SUCCESS
Re: DBD::Oracle on Oracle 11g 64 bit fedora 10
On Mon, 2009-01-19 at 20:26 +, Russell, Gordon wrote: Hi. I am hoping someone can look over this install info and tell me if it is all ok? I am having some worries with a new install of fedora 10. I also installed oracle 11.1.0.7. I have the latest DBI and am installing DBD Oracle 1.22. Note I have used DBD and Oracle for many many years. I have a 64 bit environment, UTF8 database and linux, with 32 bit compatibility libraries installed only to make the oracle installer tests happy. Gordon, Did you ever resolve this? We are moving to 11g now and I am having the same issue. I originally thought it was a 11g client = 10g db problem, but I can reproduce it trying to compile DBD::Oracle using a 11g db. Oracle 11.1.0.7.0 is installed on SUSE Linux Enterprise Server 10 (x86_64). Thanks, Scott. In short, it works but produces some test errors. Not sure if I should just ignore them! Plenty of information follows... any suggestions appreciated. When building DBD Oracle, the tests come up with 3 fails: Test Summary Report --- t/26exe_array (Wstat: 512 Tests: 14 Failed: 2) Failed tests: 11, 14 Non-zero exit status: 2 t/30long(Wstat: 512 Tests: 30 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 479 tests but ran 30. t/31lob (Wstat: 256 Tests: 6 Failed: 1) Failed test: 6 Non-zero exit status: 1 Parse errors: Bad plan. You planned 9 tests but ran 6. The actual errors are: t/26exe_array... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/14 subtests t/30longpanic: sv_len_utf8 cache 10240 real 81920 for 1234 t/31lob.DBD::Oracle::st execute failed: ORA-24813: cannot send or receive an unsupported LOB (DBD ERROR: OCIStmtExecute) [for Statement BEGIN ? := DBMS_LOB.GETLENGTH( ? ); END; with ParamValues: :p1=undef, :p2=OCILobLocatorPtr=SCALAR(0x19cb018)] at t/31lob.t line 108. Installing it anyway seems ok, but running: my $dbh = DBI-connect_cached('dbi:Oracle:sid',username,password,{ RaiseError= 1, PrintError= 0, ShowErrorStatement= 1, AutoCommit= 0, ora_verbose=6 }) Produces: OCINlsEnvironmentVariableGet(871,0,93,0,2)=SUCCESS OCINlsEnvironmentVariableGet(871,0,94,0,2)=SUCCESS OCINlsEnvCreate(1b8c5d0,THREADED | OBJECT,3,0,0,0,0,0,0,871,871)=SUCCESS OCIHandleAlloc(1c06220,1b8c5d8,OCI_HTYPE_ERROR,0,0)=SUCCESS charset id=871, name=UTF8, ncharset id=871, name=UTF8 (csid: utf8=871 al32utf8=873) OCIHandleAlloc(1c06220,1b8c5e0,OCI_HTYPE_SERVER,0,0)=SUCCESS OCIHandleAlloc(1c06220,1b8c5e8,OCI_HTYPE_SVCCTX,0,0)=SUCCESS OCIServerAttach(1c45608, 1c44e68, sid, 3, mode=DEFAULT,0)=SUCCESS OCIAttrSet(1c44d90,OCI_HTYPE_SVCCTX,1c45608,0,6,1c44e68)=SUCCESS OCIHandleAlloc(1c06220,1b8c5f0,OCI_HTYPE_SESSION,0,0)=SUCCESS OCIAttrSet(1c81838,OCI_HTYPE_SESSION,1a1d348,8,22,1c44e68)=SUCCESS OCIAttrSet(1c81838,OCI_HTYPE_SESSION,1917d08,6,23,1c44e68)=SUCCESS OCISessionBegin(1c44d90,1c44e68,1c81838,1,mode=DEFAULT 0)=SUCCESS OCIAttrSet(1c44d90,OCI_HTYPE_SVCCTX,1c81838,0,7,1c44e68)=SUCCESS DBI::db=HASH(0x1919710) is not exported by the DBD::Oracle module Can't continue after import errors at ./demo.pl line 7 BEGIN failed--compilation aborted at ./demo.pl line 15. OCITransRollback(1c44d90,1c44e68,mode=DEFAULT 0)=SUCCESS OCISessionEnd(1c44d90,1c44e68,1c81838,mode=DEFAULT 0)=SUCCESS OCIServerDetach(1c45608,1c44e68,mode=DEFAULT,0)=SUCCESS OCIHandleFree(1c81838,OCI_HTYPE_SESSION)=SUCCESS OCIHandleFree(1c45608,OCI_HTYPE_SERVER)=SUCCESS OCIHandleFree(1c44d90,OCI_HTYPE_SVCCTX)=SUCCESS OCIHandleFree(1c44e68,OCI_HTYPE_ERROR)=SUCCESS Looking through the makefile and running ldd on the .so file it seems to have only used the 64 bit oracle libraries Let me know if I can add anything. Thanks Gordon. Napier University is the best modern university in Scotland* and number one in Scotland for graduate employability** (*Guardian University Guide 2009) (**HESA 2008) This message is intended for the addressee(s) only and should not be read, copied or disclosed to anyone else outwith the University without the permission of the sender. It is your responsibility to ensure that this message and any attachments are scanned for viruses or other defects. Napier University does not accept liability for any loss or damage which may result from this email or any attachment, or for errors or omissions arising after it was sent. Email is not a secure medium. Email entering the University's system is subject to routine monitoring and filtering by the University. Napier University is a registered Scottish charity. Registration number SC018373
Re: NULL = undef, even in Perl list?
Hi Brian, What was the return value of execute()? Was there a DBI error message set afterward? ($sth_upd[$_]-errstr) You're right that passing undef should work just fine as one of the execution params should translate into a NULL on the database side. Yeah, as long as it's in the 1st or 2nd position (part of the update not the where) you should be fine. Of course x = NULL is always false in SQL, but you know that won't work. I'd lay money that you have an error message explaining things, there isn't a row with that value at that point, or one of your triggers is at play. Best, Scott Brian H. Oak wrote: I *think* this used to work, but recently stopped working. I have a program that is designed to work on MS SQL Server. My program prepares an array of statement handle references by repeatedly interpolating several scalar variables with placeholders: for ( 0..$#uptabcol ) { $sqlcommand= update $uptab set $upcol = ?; $sqlcommand .= , $paqcol = ?; $sqlcommand .= where $lucol = ?; $sth_upd[ $_ ] = $dbh-prepare( $sqlcommand ); } Later, it executes the update statement handles using calculated and looked-up placeholder values (which are sometimes NULL): for ( 0..$#uptabcol ) { my @exargs = ( $linkedname ); my ( $paqstatus ) = $sth_paq[ $_ ]-fetchrow_array; push( @exargs, $paqstatus eq ? undef : $paqstatus ); push( @exargs, $luval ); $sth_upd[ $_ ]-execute( @exargs ); } Please note that for reasons of brevity I have not shown preparation of the $sth_paq statement handle, but it is correctly defined and prepared. Also, the where clause is never NULL, so that is not a problem here. I'm simply trying to update the values of the $upcol and $paqcol. The $upcol value is never NULL, but the $paqcol value is frequently NULL. I'm pretty sure that passing a list, one of the values of which is undef, used to work for setting the desired column value to NULL. But I installed my program on a new server last week and ran it over the weekend, only to find that it skipped updating the $paqcol any time the update value was NULL. It didn't drop $exargs[2] down into the undefined position -- that would have messed the whole thing up. But it's definitely not updating the value of $paqcol, because a trigger that I'm trying to avoid setting off by updating $paqcol with *any* value is getting tripped every time $paqcol is supposed to be NULL. Any ideas? Has something changed in the handling of undef/NULL? Have I been doing something wrong since the first release of my program, but dumb luck has blinded me? -Brian
Re: How to iterate through database tables
I think his issue is getting list to the server side without concatenating strings. You can't use bind variables as table names or column names. You may be able to write a stored procedure which takes a table name as a variable, does the string concatenation on the server side, and uses Oracle's execute immediate to effectively eval the SQL there.. Scott Dale wrote: On Tue, Feb 3, 2009 at 8:47 AM, Deviloper devilo...@slived.net wrote: Hello there! lets assume that one has a list of tables @db_tables. (For Example one per Month) Lets assume one wants to find some data in the tables. (For Example sold Items.) select sales from $db_tables[0]; # gives all sold items in January You could use a UNION in the database to combine the common data (you can create a view and use that for your select): CREATE VIEW v_combined_months AS SELECT 'January' AS Month,sales FROM jan_sales UNION ALL SELECT 'February' AS Month,sales FROM feb_sales UNION ALL SELECT 'March' AS Month,sales FROM march_sales [...]
Re: Perl 5.10.0
Thank you for your quick reply. I actually feel a bit embarrassed to tell you that I was missing the header files for perl! Doh! # urpmi perl-devel I will submit a request to the package maintainer to include the perl-devel rpm in the buildrequires. Thanks again for the reply and the work on the module. On Thu, Jun 5, 2008 at 10:44 AM, Jonathan Leffler [EMAIL PROTECTED] wrote: On Thu, Jun 5, 2008 at 12:54 AM, Scott Ryan [EMAIL PROTECTED] wrote: Hi I am struggling to build the DBD-Oracle module on mandriva 2008.1. It uses perl 5.10.0 and I get the following: [EMAIL PROTECTED] DBD-Oracle-1.21]# make cp Oracle.pm blib/lib/DBD/Oracle.pm cp mkta.pl blib/lib/DBD/mkta.pl cp oraperl.ph blib/lib/oraperl.ph cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h cp Oraperl.pm blib/lib/Oraperl.pm cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm /usr/bin/perl5.10.0 -p -e s/~DRIVER~/Oracle/g /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/auto/DBI/Driver.xst Oracle.xsi /usr/bin/perl5.10.0 /usr/lib/perl5/5.10.0/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.10.0/ExtUtils/typemap -typemap typemap Oracle.xs Oracle.xsc mv Oracle.xsc Oracle.c make: *** No rule to make target `/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE/EXTERN.h', needed by `Oracle.o'. Stop. Any help would be appreciated as google throws up nothing. Assuming that the file doesn't exist - rather than no permissions - then look to see whether there is any other file in the CORE directory. On my Solaris machine, the equivalent file exists. If your CORE directory is non-existent, or mostly empty (should be over 50 files in it), then your best bet is probably build your own Perl. If just the one file is missing, you could try a reinstall. -- Jonathan Leffler [EMAIL PROTECTED] #include disclaimer.h Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org Blessed are we who can laugh at ourselves, for we shall never cease to be amused. -- Scott Ryan ** Cheap memory cards - SD / Memory Stick Pro / MicroSD / USB pen drives / XD cards From SA's leading online memory card store: www.bitsandchips.co.za *
Re: Recursive SQL query?
- Original Message From: Colin Wetherbee [EMAIL PROTECTED] My goal was as a time/work saving measure (from the administration perspective) to allow 'children' elements to have blank entries where the values would get inherited down from parents. That makes sense. I haven't delved into the object-relational properties of databases, but I wonder if that kind of inheritance is easier to achieve than it seems? If the object-relational thing works out, you may not have to worry about recursion. I'd suggest investigating that route. If all else fails and you still want to keep these operations inside the database, stored procedures are great for that sort of thing. Yeah, I actually considered the possibility of creating an accompanying object model in something like perl or the like. perl has a nice capability of 'packing' it's variables, objects are just instances of 'blessed' subroutines and subroutines are stored in hashes. So technically you could pack and store the object instance itself although that would still require a little finess and some recursive lookups at runtime to get the inheritance to work right. But once stored in memory, the parents' info would be availble (but that sorta tosses out the need for a DB other than to initialize the program memory.) As for the plural of syntax, I don't think there is one, but it's likely possible to pluralize etymologically ancestral versions of it. :) Yeah that became quite a joke as I was leaving the office yesterday. I did a quick lookup after writing the email and couldn't find a plural for syntax. I first looked at dictionaries - even foreign ones. I looked through more than a dozen total. I then turned to google in general. Then it hit me that figuring out what the plural of syntax is, is another form of syntax! So I was asking everyone the proper syntax for pluralizing syntax! I received a plethora of responses (there's another interesting one - what's the singular or plethora? plethorum?) from syntax (self-plural), syntaxes, synti ... one person even thought I said 'sin tax' and hid their pack of cigarettes. SW SW Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: Recursive SQL query? - Ah hah!
Someone in the local LUG group put me onto a possible way to accomplish it - not sure if what I took from their message was what they were getting at but it would seem to at least begin to address a possible way to do the inheritance! included response: --- Now there's an interesting way to look at it. Not sure if this iswhat you mean, but at the time an item was inserted, just addadditional links for each of the parents with another column and ainteger designator as to how many 'steps' below that item is. Sosearching for the immediate parent would be a 1, another link to that parents parentwould be a 2 and so forth. Say a column called descendency orrelationship (or rel for short). Then looking for immediate parent linkswould just require a WHERE rel=1, and inherited relationships wouldjust use a ORDER BY rel ASC. That might also be useful for statistics and management. i.e. what's the deepest tree? hmm ok, MAX rel, how many descendants fall under x? SELECT count(*) FROM categoryLinks WHERE ancestorID = x AND rel = 1 (assuming i change parentID to ancestorID of course) Now once again, my understanding of SQL falls short - I know there aresome means for finding unique values returned, would there be any wayfor restricting to the 'first' to have a non-null? I'm sure you couldprobably do it looking up one field at a time, how about the structurefor pulling multiple fields returning the first with a value for each? SW - Original Message From: Tom To: Scott Webster Wood [EMAIL PROTECTED] Sent: Tuesday, April 15, 2008 5:17:09 PM Subject: Re: [WLUG] OT: recursive SQL? I was thinking you would do this with one table with N joins, depending on the depth you wanted to go. ID | p_ID | name | property And outer join on ID to p_ID. Top parent would have p_ID = 0 Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Recursive SQL query?
I'm trying to figure out the best way to build an heirarchial categorystructure kinda like you'd find on yahoo or ebay. Basically I amcreating a number of items and I am going to tie each item via a linktable to another link table that defines the categories and subcategories. Sample: categories: ID = int {autofill/unique/primary key} Name = char(32) Desc = char(128) Property1 = char(64) Property2 = char(64) categoryLinks ID = int {autofill/unique/primary key} catID = int {required} (pointing to an ID from categories) parentID = int (pointing to another ID from categories) Desc = char(128) Property1 = char(64) Property2 = char(64) items ID = int {autofill/unique/primary key} Name = char(64) {required} Desc = char(128) Property1 = char(64) Property2 = char(64) itemLinks itemID = int (pointing to an ID from items) categoryLinkID = int (pointing to an ID from categoryLinks) categoryLinkswill have one entry with parentID = null for the 'top' of anyhierarchical tree. The Desc and other property values may also be null(although I'm going to generally fill in all of them on the top/parententry). I still wrestling with how to deal with identical categoryLinkentries in complex redundant sub-trees but am more interested in anycreative ideas for another delimma. I would like to be able totreat these kind of like object instances and utilize inheritancewhenever a property of a sub-item is empty (null). i.e. if I had alinking of categories like Computers with links to Desktop and Laptop,and under Desktop had links to Windows, Apple and Linux: categories: ++---+ | ID | Desc | Property1 | ++---+---+ | 01 | Computers | technical | | 02 | Desktop | [NULL]| | 03 | Laptop| portable | | 04 | Windows | [NULL]| | 05 | Apple | [NULL]| | 06 | Linux | superior! | ++---+---+ categoryLinks: ++---+--+---+ | ID | catID | parentID | Property1 | ++---+--+---+ | 01 | 01| [NULL] | hightech | (parent - overriding Property1 from categories value) | 02 | 02| 01 | [NULL]| (links Desktop under Computer) | 03 | 03| 01 | [NULL]| (links Laptop under Computer) | 04 | 04| 02 | [NULL]| (links Windows under Desktop) | 05 | 05| 02 | [NULL]| (links Apple under Desktop) | 06 | 06| 02 | [NULL]| (links Linux under Desktop) ++---+--+---+ let'sjust say I left Property1 blank on the link forWindows and also in it's parent Desktop but had it filled in on theDesktop parent Computers (as shown above). If I wanted to find the Property1 for the sub category but found it blank, I'd like to grab thevalue from the next parent(s) above it that did have a value. Is there any way to writethat kind of recursive search right in the SQL itself rather than doingtons of lookups in an 'until' type structure in my scripting languageuntil I find a value that's not null? Ultimately I'd want it tosearch first in the properties for the current item, then the categoryLink then the 'categories' entry for catID from that link, thengo to the parent and continue until either it found a value for agiven property or until parentID was null. I will settle for somethingthat just looks up the categoryLinks tree itself. I know I can do it with aperl or php loop but was just curious if SQL could do anything sofancy. (I'm probably going to be using MySQL but do have access topostgresql also) The other idea I am toying with is just using afile/directory tree but cringe at the number of file reads I will haveto do when building HTML option lists to get all the descriptions! Imay settle on some combination of the two as this ultimately going tobe for a web tool and I will also be having other associated files witheach category or item. (gif icons, etc.) Either way I'm still goingto have to look backwards to handle the desired inheritance. Any ideasare welcome. SW P.S. I'm now playing with another concept of just using keywords for each entry under both categories and items. Basically using a table for the top-level categories, another for individual items and one for keywords. There are then two keyword-link tables, one for category keywords and one for item keywords. I'm also playing with another set of two tables for generic keyword filters that could be assigned to each category. (a filter name pointing to a particular categoryID and a link table of keywords tied to the filterID that I could then use when creating a search for items related to a desired subset of a given category) One of the problems I saw with the complex heirarchy is when thestructure gets too deep, it becomes difficult to select a specificitem when you have to keep clicking through category after category toget to the one
Re: Recursive SQL query?
You shouldn't really need to go recursing through a data tree to come up with all the parts of a single fact. Well that is unless you are wanting to inherit data from linked elements further up a link list without re-posting redundant information. Then, instead of storing property description text separately in your categories and categoryLinks tables, have a foreign key reference the id column in the property table. In addition, I'd get rid of your categoryLinks table altogether. Think like an object oriented programmer for a second. The individual entries in the main Categories table and the individual items tables are 'definitions' of that particular 'object' with some 'default' values filled in. The additional (seemingly redundant) entries on the link table allow the link to 'override' the default value(s) with local, instance specific ones. My goal was as a time/work saving measure (from the administration perspective) to allow 'children' elements to have blank entries where the values would get inherited down from parents. Besides, my keywords are working nicely, I was just curious about SQL and if there was any conditional recursive looping in the various scripting syntax. (what is the plural of syntax? synti?) SW Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: DBD::Oracle - execute_array core dumps intermittently [SOLVED]
On Fri, 2008-03-07 at 16:36 -0600, Scott T. Hildreth wrote: This seems to be a threading error with the linux kernel version. I am running this process on newer kernels (2.6.22.x) and the error never occurs. We also are experiencing a lot the Futex WAIT issues with Oracle and the 2.6.20 kernels. The kernel upgrade didn't solve the problem. Since the process didn't crash on some of our servers and not the others, I narrowed down the difference in the servers. I concluded that all the SuSE Enterprise 10 servers had the problem and the crash only occurred when execute_array() method was used. All of our servers have Oracle 10.2.0.3 so there wasn't a difference there and it didn't seem to matter if DBD::Oracle was 1.19 or 1.20. We basically decided that this was race problem with the threads, especially since it was an intermittent problem. I decided to compile a DBD::Oracle with debugging symbols, hopping I would get better info from the core file and gdb. When I was running perl Makefile.PL a message appeared that I often ignored. WARNING: If you have problems you may need to rebuild perl with threading enabled. I build our own Perl in /usr/local/ and leave the vendor Perl alone. I never compile with threads, since we have not found a need for them, yet. So I used the /usr/bin/perl, which is always compiled with threading, and the process stopped crashing. So the WARNING never applied until now. I guess I will start building a threaded Perl on our SuSE Enterprise servers from now on. This seems to fixed the problem (knocking on wood). I thought would share my findings, just in case someone else runs into this same situation. Save yourself time, read the WARNINGS. :-) Any ideas on why array processing would cause this to occur? Did I just get lucky and hit the right scenario for this to happen? Just curious. Thanks. Thanks for listening. On Fri, 2008-03-07 at 11:25 -0600, Scott T. Hildreth wrote: Should have posted to users not dev. This is really a bizarre problem. I can get it to fail about every fifth iteration otherwise the process works. I ran it from another server connect to the same database and it will intermittently fail. I run it from a third sever and I can't get it to core dump. All 3 servers have the same kernel Perl versions. I've tried recompiling Perl, DBI, DBD::Oracle, still no luck. I created a test case, which uses execute_array and of course I can't get it to core dump. If anyone has any ideas on what might be going on here, I would love to hear them! Thanks STH On Wed, 2008-03-05 at 15:21 -0600, Scott T. Hildreth wrote: I am not sure how to describe this, my co-worker will run his process and get a core dump (I pasted the back trace below) and then run the process again with no core dumps. Sometimes it will core dump several times in a row and then the next run it finishes fine. I ran the process with DBI_TRACE=9 and this is what shows up at the end of the log, 1 - execute_for_fetch for DBD::Oracle::st (DBI::st=HASH(0xN)~INNER CODE(0xN) undef) ora_st_execute_array UPDATE count=10 (ARRAY(0xN) undef undef)... OCIBindByName(112df38,1132188,10a9138,:p1,placeh_len=3,value_p=0,value_sz=-1517274788,dty=1,indp=0,alenp=0,rcodep=0,maxarr_len=0,curelep=0 (*=0),mode=2)=ERROR OCIErrorGet(10a9138,1,NULL,7fff058d684c,ORA-02005: implicit (-1) length not valid for this bind or define datatype ,1024,2)=SUCCESS OCIErrorGet after OCIBindByName (er1:ok): -1, 2005: ORA-02005: implicit (-1) length not valid for this bind or define datatype OCIErrorGet(10a9138,2,NULL,7fff058d684c,ORA-02005: implicit (-1) length not valid for this bind or define datatype ,1024,2)=NO_DATA At first I thought it was a 32bit library with a 64bit Perl problem, but Oracle.so Perl are both linked with the correct 64 bit libs. The Oracle client is 10.2.0.3 and DBI versions are, Perl: 5.008008(x86_64-linux) OS : linux (2.6.20.19) DBI : 1.602 DBD::mysql : 4.005 DBD::Sponge : 12.010002 DBD::SQLite : 1.13 DBD::Proxy : 0.2004 DBD::Oracle : 1.20 DBD::Multiplex : 2.04 DBD::Gofer : 0.010103 DBD::File : 0.35 DBD::ExampleP : 12.010007 DBD::DBM: 0.03 I am going to try to isolate a small test case, but right now I wanted to post what I have found so far. Thanks, STH ## Back Trace # (gdb) bt #0 0x2b66ec7d9b95 in raise () from /lib64/libc.so.6 #1 0x2b66ec7daf90 in abort () from /lib64/libc.so.6
Re: DBD::Oracle - execute_array core dumps intermittently
Should have posted to users not dev. This is really a bizarre problem. I can get it to fail about every fifth iteration otherwise the process works. I ran it from another server connect to the same database and it will intermittently fail. I run it from a third sever and I can't get it to core dump. All 3 servers have the same kernel Perl versions. I've tried recompiling Perl, DBI, DBD::Oracle, still no luck. I created a test case, which uses execute_array and of course I can't get it to core dump. If anyone has any ideas on what might be going on here, I would love to hear them! Thanks STH On Wed, 2008-03-05 at 15:21 -0600, Scott T. Hildreth wrote: I am not sure how to describe this, my co-worker will run his process and get a core dump (I pasted the back trace below) and then run the process again with no core dumps. Sometimes it will core dump several times in a row and then the next run it finishes fine. I ran the process with DBI_TRACE=9 and this is what shows up at the end of the log, 1 - execute_for_fetch for DBD::Oracle::st (DBI::st=HASH(0xN)~INNER CODE(0xN) undef) ora_st_execute_array UPDATE count=10 (ARRAY(0xN) undef undef)... OCIBindByName(112df38,1132188,10a9138,:p1,placeh_len=3,value_p=0,value_sz=-1517274788,dty=1,indp=0,alenp=0,rcodep=0,maxarr_len=0,curelep=0 (*=0),mode=2)=ERROR OCIErrorGet(10a9138,1,NULL,7fff058d684c,ORA-02005: implicit (-1) length not valid for this bind or define datatype ,1024,2)=SUCCESS OCIErrorGet after OCIBindByName (er1:ok): -1, 2005: ORA-02005: implicit (-1) length not valid for this bind or define datatype OCIErrorGet(10a9138,2,NULL,7fff058d684c,ORA-02005: implicit (-1) length not valid for this bind or define datatype ,1024,2)=NO_DATA At first I thought it was a 32bit library with a 64bit Perl problem, but Oracle.so Perl are both linked with the correct 64 bit libs. The Oracle client is 10.2.0.3 and DBI versions are, Perl: 5.008008(x86_64-linux) OS : linux (2.6.20.19) DBI : 1.602 DBD::mysql : 4.005 DBD::Sponge : 12.010002 DBD::SQLite : 1.13 DBD::Proxy : 0.2004 DBD::Oracle : 1.20 DBD::Multiplex : 2.04 DBD::Gofer : 0.010103 DBD::File : 0.35 DBD::ExampleP : 12.010007 DBD::DBM: 0.03 I am going to try to isolate a small test case, but right now I wanted to post what I have found so far. Thanks, STH ## Back Trace # (gdb) bt #0 0x2b66ec7d9b95 in raise () from /lib64/libc.so.6 #1 0x2b66ec7daf90 in abort () from /lib64/libc.so.6 #2 0x2b66ec81035b in __libc_message () from /lib64/libc.so.6 #3 0x2b66ec81534e in malloc_printerr () from /lib64/libc.so.6 #4 0x2b66ec81695c in free () from /lib64/libc.so.6 #5 0x2b66ef0ac102 in ora_st_execute_array () from /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBD/Oracle/Oracle.so #6 0x2b66ef0a62bf in XS_DBD__Oracle__st_ora_execute_array () from /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBD/Oracle/Oracle.so #7 0x0046bc47 in Perl_pp_entersub () #8 0x0046a29e in Perl_runops_standard () #9 0x0041e82d in Perl_call_sv () #10 0x2b66ec9ee038 in XS_DBI_dispatch () from /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBI/DBI.so #11 0x0046bc47 in Perl_pp_entersub () #12 0x0046a29e in Perl_runops_standard () #13 0x0041e82d in Perl_call_sv () #14 0x2b66ec9ee038 in XS_DBI_dispatch () from /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBI/DBI.so #15 0x0046bc47 in Perl_pp_entersub () #16 0x0046a29e in Perl_runops_standard () #17 0x0041f1d1 in perl_run () #18 0x0041ba2c in main () *** glibc detected *** /usr/local/bin/perl: double free or corruption (!prev): 0x01163e10 *** === Backtrace: = /lib64/libc.so.6[0x2ad39584e34e] /lib64/libc.so.6(__libc_free+0x6c)[0x2ad39584f95c] /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBD/Oracle/Oracle.so(ora_st_execute_array+0xfa4)[0x2ad3980e6e94] /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBD/Oracle/Oracle.so(XS_DBD__Oracle__st_ora_execute_array+0xef)[0x2ad3980e0f9f] /usr/local/bin/perl(Perl_pp_entersub+0x6b7)[0x46bae7] /usr/local/bin/perl(Perl_runops_standard+0xe)[0x46a13e] /usr/local/bin/perl(Perl_call_sv+0x49d)[0x41e80d] /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBI/DBI.so(XS_DBI_dispatch+0x7a8)[0x2ad395a27068] /usr/local/bin/perl(Perl_pp_entersub+0x6b7)[0x46bae7] /usr/local/bin/perl(Perl_runops_standard+0xe
Re: DBD::Oracle - execute_array core dumps intermittently
This seems to be a threading error with the linux kernel version. I am running this process on newer kernels (2.6.22.x) and the error never occurs. We also are experiencing a lot the Futex WAIT issues with Oracle and the 2.6.20 kernels. Thanks for listening. On Fri, 2008-03-07 at 11:25 -0600, Scott T. Hildreth wrote: Should have posted to users not dev. This is really a bizarre problem. I can get it to fail about every fifth iteration otherwise the process works. I ran it from another server connect to the same database and it will intermittently fail. I run it from a third sever and I can't get it to core dump. All 3 servers have the same kernel Perl versions. I've tried recompiling Perl, DBI, DBD::Oracle, still no luck. I created a test case, which uses execute_array and of course I can't get it to core dump. If anyone has any ideas on what might be going on here, I would love to hear them! Thanks STH On Wed, 2008-03-05 at 15:21 -0600, Scott T. Hildreth wrote: I am not sure how to describe this, my co-worker will run his process and get a core dump (I pasted the back trace below) and then run the process again with no core dumps. Sometimes it will core dump several times in a row and then the next run it finishes fine. I ran the process with DBI_TRACE=9 and this is what shows up at the end of the log, 1 - execute_for_fetch for DBD::Oracle::st (DBI::st=HASH(0xN)~INNER CODE(0xN) undef) ora_st_execute_array UPDATE count=10 (ARRAY(0xN) undef undef)... OCIBindByName(112df38,1132188,10a9138,:p1,placeh_len=3,value_p=0,value_sz=-1517274788,dty=1,indp=0,alenp=0,rcodep=0,maxarr_len=0,curelep=0 (*=0),mode=2)=ERROR OCIErrorGet(10a9138,1,NULL,7fff058d684c,ORA-02005: implicit (-1) length not valid for this bind or define datatype ,1024,2)=SUCCESS OCIErrorGet after OCIBindByName (er1:ok): -1, 2005: ORA-02005: implicit (-1) length not valid for this bind or define datatype OCIErrorGet(10a9138,2,NULL,7fff058d684c,ORA-02005: implicit (-1) length not valid for this bind or define datatype ,1024,2)=NO_DATA At first I thought it was a 32bit library with a 64bit Perl problem, but Oracle.so Perl are both linked with the correct 64 bit libs. The Oracle client is 10.2.0.3 and DBI versions are, Perl: 5.008008(x86_64-linux) OS : linux (2.6.20.19) DBI : 1.602 DBD::mysql : 4.005 DBD::Sponge : 12.010002 DBD::SQLite : 1.13 DBD::Proxy : 0.2004 DBD::Oracle : 1.20 DBD::Multiplex : 2.04 DBD::Gofer : 0.010103 DBD::File : 0.35 DBD::ExampleP : 12.010007 DBD::DBM: 0.03 I am going to try to isolate a small test case, but right now I wanted to post what I have found so far. Thanks, STH ## Back Trace # (gdb) bt #0 0x2b66ec7d9b95 in raise () from /lib64/libc.so.6 #1 0x2b66ec7daf90 in abort () from /lib64/libc.so.6 #2 0x2b66ec81035b in __libc_message () from /lib64/libc.so.6 #3 0x2b66ec81534e in malloc_printerr () from /lib64/libc.so.6 #4 0x2b66ec81695c in free () from /lib64/libc.so.6 #5 0x2b66ef0ac102 in ora_st_execute_array () from /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBD/Oracle/Oracle.so #6 0x2b66ef0a62bf in XS_DBD__Oracle__st_ora_execute_array () from /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBD/Oracle/Oracle.so #7 0x0046bc47 in Perl_pp_entersub () #8 0x0046a29e in Perl_runops_standard () #9 0x0041e82d in Perl_call_sv () #10 0x2b66ec9ee038 in XS_DBI_dispatch () from /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBI/DBI.so #11 0x0046bc47 in Perl_pp_entersub () #12 0x0046a29e in Perl_runops_standard () #13 0x0041e82d in Perl_call_sv () #14 0x2b66ec9ee038 in XS_DBI_dispatch () from /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBI/DBI.so #15 0x0046bc47 in Perl_pp_entersub () #16 0x0046a29e in Perl_runops_standard () #17 0x0041f1d1 in perl_run () #18 0x0041ba2c in main () *** glibc detected *** /usr/local/bin/perl: double free or corruption (!prev): 0x01163e10 *** === Backtrace: = /lib64/libc.so.6[0x2ad39584e34e] /lib64/libc.so.6(__libc_free+0x6c)[0x2ad39584f95c] /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBD/Oracle/Oracle.so(ora_st_execute_array+0xfa4)[0x2ad3980e6e94] /usr/local/perl-5.8.8/lib/site_perl/5.8.8/x86_64-linux/auto/DBD/Oracle
Re: Oracle procedure raises exception but looks to be successful from DBI
Not that I am offering you a solution, but with Oracle I have found the error messages are sometimes misleading. For example I was helping a co-worker with code. He wanted to call a stored procedure, so I sent him some example code that I had which called a function. The function I was calling returns a number so I use the :4 return in the code below. $cpyh = $self-{_Dbh}-prepare_cached( q{ BEGIN :4 := dots_ems.copy_project(:1, :2, :3); END; }, undef, AllowActive) or $self-__SetError(\nget_new_projnum() - prepare() failed : \n$self-{_Dbh}-errstr\n); $cpyh-bind_param(1, $self-{_Projnum}); $cpyh-bind_param(2, 'NEWPRO'); $cpyh-bind_param(3, ''); $cpyh-bind_param_inout(4, \$proj_num, 10); $cpyh-execute; return $proj_num; My co-worker left the :4 param in thinking it would return a status. When he ran the code Oracle would return a error message indicating that there was not a function named (what ever he named it). I kept glazing over the error message, ran his code in debugger, and couldn't figure out why it wouldn't work. Then it slapped me in the head, he is calling a procedure not a function, there are returns from procedures. As soon as the placeholder :4 was taken out it worked. I guess my point is Oracle assumed it was function, since there was out bind variable. I think Oracle is making this assumption. The error should have been blah is a procedure and any idiot knows procedures don't return values. ...or something like that and I would have known right away why the prepare was failing. On Fri, 2008-01-25 at 17:47 +, Martin Evans wrote: John Scoles wrote: I sort if expected that for the exec it is usualy only used withing SP perhaps begin; exec(user.package.proctest(?)); end; ?? who knows same problem as without exec: PLS-00302: component 'PACKAGE' must be declared The next error is usually a permission problem on the Oracle side. Either the use who is calling the SP dose not have execute permission for the package or something in the package (hard to debug that) or the present state of the package is stopping you from executing it. you might want to try GRANT execute to the package The fact that DBD is returning the error from Oracle usually means that DBD is running correctly. Cheers It is not a permission issue. call user.package.proctest(?) works and begin user.package.proctest(?); end; fails with the error above. Thanks for the help though - it almost got me there. I'll keep investigating. Martin
Question that may not have an answer
I'm working on a project where we have data stored in arrays that we need to put into a database. We'd started with CSV (it was easiest), but it's become unmanagable. However, I don't want to go through the pain of getting a mysql database or other database server set up to put the data into. I recall talking to someone about perl having an internal database file where you could store the data in a file, and access it relatively easily, without having to set up an interface to an external database server. Or am I completely wrong, and there isn't such a thing? Scott Mohnkern
Looking for a good explanation of select function in perl dbi
Well, I've figured out how to put data into a sqlite database. I can extract data from the command line, however, for the life of me, I just can't find any good documentation on using Select. What I'm trying to do: SELECT name, size FROM filelist where uid=given value This works from the command line: sqlite3 data.dbl SELECT name, uid from filelist where UID=\1000\ I'd like to pop this into an array, where I could manipulate it, where each element of the array would contain name,size. Are there any good web pages on using the SELECT function? I took a look at: http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html But it kind of lost me. Scott Mohnkern
Bundle::DBI Failure
When I run 'cpan' and try to install Bundle::DBI, DBI::Shell fails...but more importantly PlRPC-0.2020 fails with, Writing Makefile for RPC::PlServer perldoc -t lib/RPC/PlServer.pm README No documentation found for lib/RPC/PlServer.pm. make: *** [README] Error 1 MNOONING/PlRPC/PlRPC-0.2020.tar.gz /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: MNOONING/PlRPC/PlRPC-0.2020.tar.gz : make NO ...if I quit cpan, cd into the build directory, rerun perl Makefile.PL make make test, everything is okay. Has anyone else had this occur? Thanks. -- Scott T. Hildreth [EMAIL PROTECTED]
Re: float bug? perl 5.8, DBI and oracle 10.2.0
On Thu, 2007-07-19 at 09:42 +0200, Erwan Lemonnier wrote: Hi Tim! Ah, now it's getting interesting! :) So I thought :) Are the two versions of DBD::Oracle built against the same Oracle version/installation? No. The one used by perl 5.6.2 was built against an oracle 9.2.1.0 (unsure of the exact version, but it was a 9.*). The one used by perl 5.8.5 and perl 5.8.8 was built against an oracle 10.2.0. What differences are there in the configuration of the two perl versions? a diff between perl -V for my perl 5.6.2 and perl 5.8.8 shows the following differences (the other options are in the 'perl -V' I included in my very first post): * 5.6.2: osvers=2.6.9-42.0.2.elsmp config_args='-Dprefix=/opt/perl-5.6.2' useperlio=undef ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' cppflags='-fno-strict-aliasing' libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil ccdlflags='-rdynamic' Compile-time options: USE_LARGE_FILES * 5.8.8: osvers=2.6.9-55.elsmp config_args='' useperlio=define bincompat5005=undef ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include' libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc gnulibc_version='2.3.4' ccdlflags='-Wl,-E' Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Take a look at the source for the Perl_sv_2nv() function in sv.c in the two distributions. Also check for differences in the perl config items that impact that code. Damn. I had a bad feeling I would end up there. Ok, I'll put on my deep dive googles and switch on the tolkien translator. If you don't hear from me within a week, call the asylum to fetch me ;) Try it with: my $v1 = 1.73696; showbin($v1); require DBD::Oracle; my $v2 = 1.73696; showbin($v2); I get: [HEAD] ~/HEAD/test/t/ !1030$ /opt/perl-5.6.2/bin/perl 02_test_require_dbd_oracle.t 0011100010101001011010010001101001110101110011010001 requiring 0011100010101001011010010001101001110101110011010001 [HEAD] ~/HEAD/test/t/ !1031$ /opt/perl-5.8.8/bin/perl 02_test_require_dbd_oracle.t 0011100010101001011010010001101001110101110011010001 requiring 0011100010101001011010010001101001110101110011010001 No difference. What triggered the problem happened during the connect, but not during 'require DBD::Oracle'. I know that on Solaris the act of loading the Oracle library (e.g. libclntsh.so) could suck in other libraries which would cause subtle side effects. The particular case I (vagely) recall related to alarm(). Loading the Oracle library caused the threaded version of alarm() to be loaded and take precedence. So alarm(0) after loading DBD::Oracle wouldn't cancel the alarm($timeout) set before loading it. Fun. I don't recall now if/how that got resolved. Anyway, I mention it because it seems like this is a similar issue. Agggh. This example gives me goose flesh. I just hope I am not facing something like that... Is there anyone around with access to an oracle database 10.* and running perl 5.8.* who could run the test code I provided earlier? The one that just connects? It would be interesting to know how strongly dependent it is to just my specific setup... I know you asked for Oracle 10, but here is the result of Perl: 5.008006(i686-linux) OS : linux (8.0) DBI : 1.54 DBD::Sponge : 12.008696 DBD::Proxy : 0.2004 DBD::Oracle : 1.19 Oracle 9.2.0.1.0 bin: 0011100010101001011010010001101001110101110011010001 connecting bin: 0011100010101001011010010001101001110101110011010001 -- Scott T. Hildreth [EMAIL PROTECTED]
Re: float bug? perl 5.8, DBI and oracle 10.2.0
On Thu, 2007-07-19 at 09:36 -0500, Scott T. Hildreth wrote: On Thu, 2007-07-19 at 09:42 +0200, Erwan Lemonnier wrote: Hi Tim! Ah, now it's getting interesting! :) So I thought :) Are the two versions of DBD::Oracle built against the same Oracle version/installation? No. The one used by perl 5.6.2 was built against an oracle 9.2.1.0 (unsure of the exact version, but it was a 9.*). The one used by perl 5.8.5 and perl 5.8.8 was built against an oracle 10.2.0. What differences are there in the configuration of the two perl versions? a diff between perl -V for my perl 5.6.2 and perl 5.8.8 shows the following differences (the other options are in the 'perl -V' I included in my very first post): * 5.6.2: osvers=2.6.9-42.0.2.elsmp config_args='-Dprefix=/opt/perl-5.6.2' useperlio=undef ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' cppflags='-fno-strict-aliasing' libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil ccdlflags='-rdynamic' Compile-time options: USE_LARGE_FILES * 5.8.8: osvers=2.6.9-55.elsmp config_args='' useperlio=define bincompat5005=undef ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include' libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc gnulibc_version='2.3.4' ccdlflags='-Wl,-E' Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Take a look at the source for the Perl_sv_2nv() function in sv.c in the two distributions. Also check for differences in the perl config items that impact that code. Damn. I had a bad feeling I would end up there. Ok, I'll put on my deep dive googles and switch on the tolkien translator. If you don't hear from me within a week, call the asylum to fetch me ;) Try it with: my $v1 = 1.73696; showbin($v1); require DBD::Oracle; my $v2 = 1.73696; showbin($v2); I get: [HEAD] ~/HEAD/test/t/ !1030$ /opt/perl-5.6.2/bin/perl 02_test_require_dbd_oracle.t 0011100010101001011010010001101001110101110011010001 requiring 0011100010101001011010010001101001110101110011010001 [HEAD] ~/HEAD/test/t/ !1031$ /opt/perl-5.8.8/bin/perl 02_test_require_dbd_oracle.t 0011100010101001011010010001101001110101110011010001 requiring 0011100010101001011010010001101001110101110011010001 No difference. What triggered the problem happened during the connect, but not during 'require DBD::Oracle'. I know that on Solaris the act of loading the Oracle library (e.g. libclntsh.so) could suck in other libraries which would cause subtle side effects. The particular case I (vagely) recall related to alarm(). Loading the Oracle library caused the threaded version of alarm() to be loaded and take precedence. So alarm(0) after loading DBD::Oracle wouldn't cancel the alarm($timeout) set before loading it. Fun. I don't recall now if/how that got resolved. Anyway, I mention it because it seems like this is a similar issue. Agggh. This example gives me goose flesh. I just hope I am not facing something like that... Is there anyone around with access to an oracle database 10.* and running perl 5.8.* who could run the test code I provided earlier? The one that just connects? It would be interesting to know how strongly dependent it is to just my specific setup... I know you asked for Oracle 10, but here is the result of Perl: 5.008006(i686-linux) OS : linux (8.0) DBI : 1.54 DBD::Sponge : 12.008696 DBD::Proxy : 0.2004 DBD::Oracle : 1.19 Oracle 9.2.0.1.0 bin: 0011100010101001011010010001101001110101110011010001 connecting bin: 0011100010101001011010010001101001110101110011010001 ... and bin: 0011100010101001011010010001101001110101110011010001 connecting bin: 001110001010100101101001000110100111010111001101 with Perl: 5.008008(i686-linux) OS : linux (2.6.14.6) DBI : 1.54 DBD::mysql : 3.0002 DBD::Sponge : 12.008696 DBD::SQLite : 1.11 DBD::Proxy : 0.2004 DBD::Oracle : 1.19 connecting to 10.2.0.3.0 or 9.2.0.1.0 It seems to be the DBD::Oracle built against Oracle 10.x. -- Scott T. Hildreth [EMAIL PROTECTED]
Error building DBD-ODBC on HPUX
I'm having trouble building the DBD-ODBC driver on our HPUX server. Below is the log of me running: make realclean perl Makefile.PL make Note: unixODBC is version 2.2.12 that I just built today. I have successfully created a connection with isql. /home/x703299/downloads/extracted/DBD-ODBC-1.13 make realclean rm -rf ODBC.c ODBC.xsi dbdodbc.h ./blib Makefile.aperl blib/arch/auto/DBD/ODBC/extralibs.all blib/arch/auto/DBD/ODBC/extralibs.ld perlmain.c tmon.out mon.out so_locations pm_to_blib *.o *.a perl.exe perl perl ODBC.bs ODBC.bso ODBC.def libODBC.def ODBC.exp ODBC.x core core.*perl.*.? *perl.core core.[0-9] core.[0-9][0-9] core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9][0-9] mv Makefile Makefile.old /dev/null 21 rm -rf blib/lib/auto/DBD/ODBC blib/arch/auto/DBD/ODBC rm -rf DBD-ODBC-1.13 rm -f blib/arch/auto/DBD/ODBC/ODBC.sl blib/arch/auto/DBD/ODBC/ODBC.bs rm -f blib/arch/auto/DBD/ODBC/ODBC.a rm -f blib/lib/DBD/ODBC.pm Makefile.old Makefile /home/x703299/downloads/extracted/DBD-ODBC-1.13 ODBCHOME=/home/x703299/unixODBC perl Makefile.PL Useless use of private variable in void context at Makefile.PL line 431. Configuring DBD::ODBC ... Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.50 (for perl 5.008007 on PA-RISC2.0-LP64) installed in /opt/perl587/lib/site_perl/5.8.7/PA-RISC2.0-LP64/auto/DBI/ Using ODBC in /home/x703299/unixODBC 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 /home/x703299/unixODBC/lib/libodbc.sl library. in $ODBCHOME/lib Warning: LD_LIBRARY_PATH doesn't include /home/x703299/unixODBC Checking if your kit is complete... Looks good Injecting selected odbc driver into cc command Injecting selected odbc driver into cc command Using DBI 1.50 (for perl 5.008007 on PA-RISC2.0-LP64) installed in /opt/perl587/lib/site_perl/5.8.7/PA-RISC2.0-LP64/auto/DBI/ Writing Makefile for DBD::ODBC The DBD::ODBC tests will use these values for the database connection: DBI_DSN=e.g. dbi:ODBC:demo DBI_USER= DBI_PASS= Warning: not all required environment variables are set. /home/x703299/downloads/extracted/DBD-ODBC-1.13 make cp Changes blib/lib/DBD/ODBC/Changes.pm cp ODBC.pm blib/lib/DBD/ODBC.pm /usr/bin/perl -p -e s/~DRIVER~/ODBC/g /opt/perl587/lib/site_perl/5.8.7/PA-RISC2.0-LP64/auto/DBI//Driver.xst ODBC.xsi /usr/bin/perl /opt/perl587/lib/5.8.7/ExtUtils/xsubpp -typemap /opt/perl587/lib/5.8.7/ExtUtils/typemap ODBC.xs ODBC.xsc mv ODBC.xsc ODBC.c Warning: duplicate function definition 'data_sources' detected in ODBC.xs, line 202 cc -c -I/home/x703299/unixODBC/include -I. -I/opt/perl587/lib/site_perl/5.8.7/PA-RISC2.0-LP64/auto/DBI/ -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 +z -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit -DVERSION=\1.13\ -DXS_VERSION=\1.13\ +Z -I/opt/perl587/lib/5.8.7/PA-RISC2.0-LP64/CORE -I/home/x703299/unixODBC/include ODBC.c cpp: dbdimp.h, line 41: warning 2028: Found comment inside comment started on line 40. cpp: dbdimp.h, line 42: warning 2028: Found comment inside comment started on line 40. cpp: dbdimp.h, line 90: warning 2028: Found comment inside comment started on line 89. cpp: dbdimp.h, line 91: warning 2028: Found comment inside comment started on line 89. cc: ODBC.xs, line 231: warning 604: Pointers are not assignment-compatible. cc: ODBC.xs, line 231: warning 563: Argument #1 is not the correct type. cc: ODBC.xs, line 251: warning 604: Pointers are not assignment-compatible. cc: ODBC.xs, line 251: warning 563: Argument #1 is not the correct type. cc -c -I/home/x703299/unixODBC/include -I. -I/opt/perl587/lib/site_perl/5.8.7/PA-RISC2.0-LP64/auto/DBI/ -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 +z -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit -DVERSION=\1.13\ -DXS_VERSION=\1.13\ +Z -I/opt/perl587/lib/5.8.7/PA-RISC2.0-LP64/CORE -I/home/x703299/unixODBC/include dbdimp.c cpp: dbdimp.h, line 41: warning 2028: Found comment inside comment started on line 40. cpp: dbdimp.h, line 42: warning 2028: Found comment inside comment started on line 40. cpp: dbdimp.h, line 90: warning 2028: Found comment inside comment started on line 89. cpp: dbdimp.h, line 91: warning 2028: Found comment inside comment started on line 89. cpp: dbdimp.c, line 2909: warning 2028: Found comment inside comment started on line 2909. cc: dbdimp.c, line 587: warning 604: Pointers are not assignment-compatible. cc: dbdimp.c, line 587: warning 563: Argument #3 is not the correct type. cc: dbdimp.c, line 587: warning 604: Pointers are not assignment-compatible. cc: dbdimp.c, line 587: warning 563: Argument #5 is not the correct type. cc: dbdimp.c, line 654: warning 604: Pointers are not
Re: perl pad.c Assertion !((sv)-sv_flags 0x00010000) failed
On Thu, 21 Jun 2007 22:33:03 +0100, Tim Bunce wrote: On Thu, Jun 21, 2007 at 06:47:11PM +0200, Rafael Garcia-Suarez wrote: On 21/06/07, Steve Hay [EMAIL PROTECTED] wrote: I remember lots of discussion a while ago about constructions like my $x = 1 if $y;. I don't remember what the conclusion of it all was, except that it's probably best avoided. Is that right? Yes, that's right, because that could bypass initialisation of $x if $y is false, leaving the previous value in it, like in state vars. I thought that issue only related to a compile-time constant false (such as the one in your example) and not to a runtime expression that happened to be false sometimes. Looking at it another way, are you saying that (ignoring closures) subroutine scoped lexicals are not cleared when the subroutine exits, but persist (consuming memory) until the subroutine is reentered? $ ./perl -wle '$q = shift; sub foo { my $x if $q; print $x // $]; \ $x = 42 } foo; $q++; foo' 0 5.009005 42 It looks like it, no? -- Peter Scott
Re: Duplicate table structure
On Thu, 07 Jun 2007 08:47:00 +0200, Dr.Ruud wrote: Peter Scott schreef: Is there a simple way to create a new table with the same structure as a given one in a *different* database? That means the CREATE TABLE foo AS SELECT * FROM bar WHERE 1=2 method won't work. I'd need to have two database handles open. They're both Oracle I suppose the DBD can give you enough information on the table to generate a CREATE statement from that. Yes, it does. I ended up taking the output of DESCRIBE and tweaking it a little. I was just using the opportunity to wonder if there was an even lazier way. The suggestion of another poster to use dbms_metadata (see, e.g. http://builder.com.com/5100-6388-5054021.html) was a good one; I'd not heard of it before. If I have to do more than just column type definitions, or multiple tables, in the future, I'll definitely check it out. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/
Re: Proposal for new $h-{ReadOnly} attribute
Doing set transaction read only on Oracle has additional side-effects besides making the connection unable to write: it switches the read consistency level from per-statement (the default) to per-transaction. This effectively freezing the connection in time, allowing multiple queries to be executed against changing data to match up. It might surprise someone who thought they were just getting a read-only connection, especially if they're polling the database for changes and wanted to be lighter weight. It consumes more resources, not less, since Oracle must reverse out all changes since your set trans.. statement with each query, and might result in a snapshot too old error. I don't know if/how other databases implement this feature, and give it such a possibly misleading name. Does anyone else? Scott Smith Tim Bunce wrote: I've just added this to the DBI docs: =item CReadOnly (boolean, inherited) An application can set the CReadOnly attribute of a handle to a true value to indicate that it will not be attempting to make any changes (insert, delete, update etc) using that handle or any children of it. If the driver can make the handle truely read-only (by issing a statement like Cset transaction read only as needed, for example) then it should. Otherwise the attribute is simply advisory. A driver can set the CReadOnly attribute itself to indicate that the data it is connected to cannot be changed for some reason. Library modules and proxy drivers can use the attribute to influence their behavior. For example, the DBD::Gofer driver considers the CReadOnly attribute when making a decison about whether to retry an operation that failed. =cut Any thoughts? Tim.
Re: Proposal for new $h-{ReadOnly} attribute
Tim Bunce wrote: On Fri, May 04, 2007 at 08:15:53AM -0500, Scott Smith wrote: Doing set transaction read only on Oracle has additional side-effects besides making the connection unable to write: it switches the read consistency level from per-statement (the default) to per-transaction. This effectively freezing the connection in time, allowing multiple queries to be executed against changing data to match up. s/freezing the connection in time/freezing the transaction in time/ ? Good point, speaking of small differences which make a difference. So effectively no change if AutoCommit is on? If AutoCommit is off, then the effect lasts until the next commit/rollback, but an app that's read only might not be doing any commits. Wow. I hadn't thought of using commit/rollback to intentionally select when to bump the time point forward. I agree that's an issue. It might surprise someone who thought they were just getting a read-only connection, especially if they're polling the database for changes and wanted to be lighter weight. It consumes more resources, not less, since Oracle must reverse out all changes since your set trans.. statement with each query, and might result in a snapshot too old error. That's certainly a good argument for the ReadOnly attribute not doing a set transaction read only on Oracle. I'll tweak the docs. It's also an argument in favor of ReadOnly not being a simple boolean. Thanks. Tim. p.s. You're *just* in time for 1.55. Yeah. Sorry to reply four days late... Scott I don't know if/how other databases implement this feature, and give it such a possibly misleading name. Does anyone else? Scott Smith Tim Bunce wrote: I've just added this to the DBI docs: =item CReadOnly (boolean, inherited) An application can set the CReadOnly attribute of a handle to a true value to indicate that it will not be attempting to make any changes (insert, delete, update etc) using that handle or any children of it. If the driver can make the handle truely read-only (by issing a statement like Cset transaction read only as needed, for example) then it should. Otherwise the attribute is simply advisory. A driver can set the CReadOnly attribute itself to indicate that the data it is connected to cannot be changed for some reason. Library modules and proxy drivers can use the attribute to influence their behavior. For example, the DBD::Gofer driver considers the CReadOnly attribute when making a decison about whether to retry an operation that failed. =cut Any thoughts? Tim.
Re: environment variable
Reidy, Ron wrote: Oscar, Short answer - you cannot (sort of). This is because your shell script will execute in a sub shell of your perl program. However, you can do something like this: # untested system(export VAR=val; /path/to/your/shell/script.sh); The shell also takes a series of zero or more key-value pairs at the start of any command: system(VAR=val VAR2=anotherval /path/to/any/program); This has the same effect as exporting when you're doing it with Perl's system call, but it's good to keep in mind when you don't want to keep the variable setting or override in your general shell session. i.e. LD_PRELOAD=/usr/lib/special_old_library.so /usr/bin/oldprogram Scott Smith Genome Sequencing Center
Just In case you missed it...
Josh Mcadams of PerlCast has posted the podcast of his interview with Tim at last summer's Oscon. http://www.perlcast.com/audio/Perlcast_Interview_038.mp3
DBD::Proxy - getting unitialized error for $numFields
### Perl: 5.008008(i386-freebsd) OS : freebsd (6.1-stable) DBI : 1.53 DBD::mysql : 3.0004 DBD::Sponge : 11.10 DBD::SQLite : 1.12 DBD::Proxy : 0.2004 DBD::Multiplex : 2.00 DBD::File : 0.35 DBD::ExampleP : 11.12 DBD::DBM: 0.03 DBD::CSV: 0.22 DBD::AnyData: 0.08 ## For every database call, do, execute, ...etc I get the warning, Use of uninitialized value in subroutine entry at /usr/local/perl-5.8.8/lib/site_perl/5.8.8/i386-freebsd/DBD/Proxy.pm line 567. Which is 'NUM_OF_FIELDS' = $numFields, . I don't think this matters but, the proxy is connecting to DBD::Oracle, the connect is in another module that is inherited by the module I am testing. I am also getting disconnect errors on the DESTROY, (in cleanup) DBD::Proxy::db disconnect failed: Can't call method disconnect on an undefined value at /usr/local/perl-5.8.8/lib/site_perl/5.8.8/i386-freebsd/DBD/Proxy.pm line 311 during global destruction. (in cleanup) DBD::Proxy::db DESTROY failed: Can't call method disconnect on an undefined value at /usr/local/perl-5.8.8/lib/site_perl/5.8.8/i386-freebsd/DBD/Proxy.pm line 311 during global destruction. My eyes are glazing over, so any help would be appreciated. I'm sure it is something simple I am missing here... Thanks. -- Scott T. Hildreth [EMAIL PROTECTED]
MySQL upgrade caused Perl coredumps...
I recently upgraded MySQL to version 5.0.4. After the upgrade, several of my Perl scripts that access the MySQL database began to fail with Memory fault coredump messages. Anyone have any suggestions? I'm hoping a simple DBI::MySQL upgrade will fix this issue. Here is the Perl information... Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Platform: osname=hpux, osvers=11.11, archname=PA-RISC2.0 uname='hp-ux r3 b.11.11 u 9000800 1909236376 unlimited-user license ' config_args='-Dusedevel -Dcc=gcc -Uversiononly -Dinc_version_list=none -des' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-mpa-risc-2-0 -D_HPUX_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g -O', cppflags='-mpa-risc-2-0 -D_HPUX_SOURCE -mpa-risc-2-0 -D_HPUX_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/pro/local/include' ccversion='', gccversion='3.4.4', gccosandvers='hpux11.11' 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, prototype=define Linker and Libraries: ld='/usr/bin/ld', ldflags ='-L/pro/local/lib' libpth=/pro/local/lib /lib /usr/lib /usr/ccs/lib /usr/local/lib libs=-lcl -lpthread -lnsl -lnm -lndbm -lgdbm -ldb -lmalloc -ldld -lm -lcrypt -lsec -lc perllibs=-lcl -lpthread -lnsl -lnm -lmalloc -ldld -lm -lcrypt -lsec -lc libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='-fPIC', lddlflags='-b -L/pro/local/lib' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING USE_LARGE_FILES Locally applied patches: defined-or Built under hpux Compiled at Jun 1 2005 13:42:32 @INC: /opt/perl/lib/5.8.7/PA-RISC2.0 /opt/perl/lib/5.8.7 /opt/perl/lib/site_perl/5.8.7/PA-RISC2.0 /opt/perl/lib/site_perl/5.8.7 /opt/perl/lib/site_perl . Scott Nipp Sr. Systems Analyst ATT Unix Administration (214) 858-1289 For non-emergency HP UNIX work /support requests please open an RM ticket online at: http://euss.sbc.com http://euss.sbc.com%20/ or by sending an email to: unix sss email mailto:unix%20sss%20email For outage or emergency HP UNIX issues, please refer to the oncall list at: http://unixsss.sbc.com/oncall/mtsshpwest_oncall.html
RE: MySQL upgrade caused Perl coredumps...
I'm kind of stuck with the MySQL version here. This is the pre-built HP version that we are required to use. This is the latest version available compiled by HP. I am now attempting to build DBD::MySQL-3.0008 and running into some make test errors. Here is a sample of the errors. t/40nulls/usr/lib/dld.sl: Unresolved symbol: __udivdi3 (code) from /home/sadmin/sn4265/perl/DBD-mysql-3.0008/blib/arch/auto/DBD/mysql/mysql .sl /usr/lib/dld.sl: Unresolved symbol: __umoddi3 (code) from /home/sadmin/sn4265/perl/DBD-mysql-3.0008/blib/arch/auto/DBD/mysql/mysql .sl install_driver(mysql) failed: Can't load '/home/sadmin/sn4265/perl/DBD-mysql-3.0008/blib/arch/auto/DBD/mysql/mysq l.sl' for module DBD::mysql: Unresolved external at /opt/perl/lib/5.8.7/PA-RISC2.0/DynaLoader.pm line 230. 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/40nulls.t line 50 t/40nullsdubious Test returned status 215 (wstat 55040, 0xd700) DIED. FAILED tests 1-11 Failed 11/11 tests, 0.00% okay I got a lot of these, in fact for just about every test. The DBD::MySQL module is the only one I am attempting to upgrade. I'm not sure if I need to update my DBI module or now. One question I have is how do I check the module versions? Thanks in advance for any assistance. -Original Message- From: Darren Duncan [mailto:[EMAIL PROTECTED] Sent: Saturday, November 04, 2006 3:54 AM To: dbi-users@perl.org Subject: Re: MySQL upgrade caused Perl coredumps... At 10:35 PM -0600 11/3/06, NIPP, SCOTT V \(SBCSI\) wrote: I recently upgraded MySQL to version 5.0.4. After the upgrade, several of my Perl scripts that access the MySQL database began to fail with Memory fault coredump messages. Anyone have any suggestions? I'm hoping a simple DBI::MySQL upgrade will fix this issue. Here is the Perl information... Before you go about with that, you should move up to a production release of MySQL, such as 5.0.2x ... MySQL 5.0.4 was an alpha or beta release, and is well over a year old already. Unless you mistyped and meant to say 5.0.24. Also, if you're using MySQL v4.1 or higher, you should be using the DBD::mysql v3.x series of drivers. If nothing else, because the 2.9x series will fail to connect due to MySQL user password hashes having changed in length between 4.0 and 4.1, which affects database users created after the switch. -- Darren Duncan
RE: MySQL upgrade caused Perl coredumps...
I just stumbled across something providing a little more information and not making anything any clearer. Here is the database related module information... perl -MDBI -e 'DBI-installed_versions' Perl: 5.008007(PA-RISC2.0) OS : hpux(11.11) DBI : 1.48 DBD::mysql : 3.0008 DBD::Sponge : 11.10 DBD::Proxy : install_driver(Proxy) failed: Can't locate RPC/PlClient.pm in @INC DBD::Oracle : 1.16 DBD::File : 0.33 DBD::ExampleP : 11.12 DBD::DBM: 0.02 DBD::CSV: 0.22 Judging by this I am already running the latest DBD::MySQL, though I am about 5 versions behind on the DBI module. I hope all of this helps. -Original Message- From: NIPP, SCOTT V (SBCSI) Sent: Saturday, November 04, 2006 12:02 PM To: 'Darren Duncan'; dbi-users@perl.org Subject: RE: MySQL upgrade caused Perl coredumps... I'm kind of stuck with the MySQL version here. This is the pre-built HP version that we are required to use. This is the latest version available compiled by HP. I am now attempting to build DBD::MySQL-3.0008 and running into some make test errors. Here is a sample of the errors. t/40nulls/usr/lib/dld.sl: Unresolved symbol: __udivdi3 (code) from /home/sadmin/sn4265/perl/DBD-mysql-3.0008/blib/arch/auto/DBD/mysql/mysql .sl /usr/lib/dld.sl: Unresolved symbol: __umoddi3 (code) from /home/sadmin/sn4265/perl/DBD-mysql-3.0008/blib/arch/auto/DBD/mysql/mysql .sl install_driver(mysql) failed: Can't load '/home/sadmin/sn4265/perl/DBD-mysql-3.0008/blib/arch/auto/DBD/mysql/mysq l.sl' for module DBD::mysql: Unresolved external at /opt/perl/lib/5.8.7/PA-RISC2.0/DynaLoader.pm line 230. 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/40nulls.t line 50 t/40nullsdubious Test returned status 215 (wstat 55040, 0xd700) DIED. FAILED tests 1-11 Failed 11/11 tests, 0.00% okay I got a lot of these, in fact for just about every test. The DBD::MySQL module is the only one I am attempting to upgrade. I'm not sure if I need to update my DBI module or now. One question I have is how do I check the module versions? Thanks in advance for any assistance. -Original Message- From: Darren Duncan [mailto:[EMAIL PROTECTED] Sent: Saturday, November 04, 2006 3:54 AM To: dbi-users@perl.org Subject: Re: MySQL upgrade caused Perl coredumps... At 10:35 PM -0600 11/3/06, NIPP, SCOTT V \(SBCSI\) wrote: I recently upgraded MySQL to version 5.0.4. After the upgrade, several of my Perl scripts that access the MySQL database began to fail with Memory fault coredump messages. Anyone have any suggestions? I'm hoping a simple DBI::MySQL upgrade will fix this issue. Here is the Perl information... Before you go about with that, you should move up to a production release of MySQL, such as 5.0.2x ... MySQL 5.0.4 was an alpha or beta release, and is well over a year old already. Unless you mistyped and meant to say 5.0.24. Also, if you're using MySQL v4.1 or higher, you should be using the DBD::mysql v3.x series of drivers. If nothing else, because the 2.9x series will fail to connect due to MySQL user password hashes having changed in length between 4.0 and 4.1, which affects database users created after the switch. -- Darren Duncan
List tables in MS Access
How can I list all of the table names in an access database? Thanks, Scott Berthold
RE: switching perl version
I would definitely look to Oracle rather than Perl as your culprit. I don't have anything to back this up, just a suspicion. -Original Message- From: Oscar Gomez [mailto:[EMAIL PROTECTED] Sent: Friday, September 08, 2006 10:04 AM To: dbi-users@perl.org Subject: switching perl version A perl program executing in linux Redhat 7.0, perl version 5.6, oracle 8i was using 30% cpu approx. Now I'm running the same program in linux enterprise ES 4, perl v. 5.8.5, Oracle 10g. uses 60% cpu. I'd like to know what's happening because the performance is slower and the difference is wide big. Do you think this perl new version (5.8.5) takes more cpu ? I appreciate any idea you could give me to improve my performance. -- Open WebMail Project (http://openwebmail.org)
Re: code needed
Since this is not a dbi problem, can DBI-Users be taken off the cc list. On Mon, 2006-09-04 at 08:07 -0400, Eric Krause wrote: Check out this web page, http://www.developer.com/lang/other/article.php/3454041. It has examples that return link and tags using WWW::Mechanize, which is a subset of LWP. -Eric Hal Wigoda wrote: anyone have any code that will return the links and tags from web document downloaded using LWP? hal chicago --To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Scott T. Hildreth [EMAIL PROTECTED]
Re: DBI/DBD::DB2
On 24/06/06, Jonathan Leffler [EMAIL PROTECTED] wrote: On 6/23/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: snip If you have a pre-compiled module, then I think your problem is the absence of DB2 Connect (IIRC) or its equivalent. snip The basic connectivity requirement for DBD::DB2 on all platforms is the DB2 Runtime Client. If you're compiling DBD::DB2 yourself, then you need the DB2 Application Development Client instead (to get the headers required for the compile). Both of these are a free download from http://ibm.com/db2/udb/support/downloadv8.html. DB2 Connect (which isn't free) is only required if you are connecting to zSeries or iSeries servers. Dan
Re: DBD::DB2 execute and finish problem
WAG here: will the DBD::DB2 driver implicitly finish the resources if you try calling $sth-fetchrow_array() again? I don't know if DBD::DB2 can know whether there are more rows left in the result set until you try fetching the next row, ergo it keeps the statement handle active. Dan On 09/06/06, Martin J. Evans [EMAIL PROTECTED] wrote: Hi, I'm using DBD::DB2 0.78 and DBI 1.51. I am finding that code which is working to DBD::ODBC and DBD::mysql fails with invalid cursor state but inserting a call to finish makes it work. Up until now, I've never used finish because the docs say: If execute() is called on a statement handle that's still active ($sth-{Active} is true) then it should effectively call finish() to tidy up the previous execution results before starting this new execution. and The finish method is rarely needed, and frequently overused, but can sometimes be helpful in a few very specific situations to allow the server to free up resources (such as sort buffers). When all the data has been fetched from a SELECT statement, the driver should automatically call finish for you. So you should not normally need to call it explicitly except when you know that you've not fetched all the data from a statement handle. The most common example is when you only want to fetch one row, but in that case the selectrow_* methods are usually better anyway. Adding calls to finish after each fetch loop is a common mistake, don't do it, it can mask genuine problems like uncaught fetch errors. An example is: create table fred (a int not null primary key) insert into fred values (1) insert into fred values (2) insert into fred values (3) perl -w -e 'use DBI; my $dbh = DBI-connect(dbi:DB2:mydsn, xxx, yyy); my @a = (1,2,3); $sth = $dbh-prepare(q/select * from fred where a = ?/); foreach my $a (@a) {$sth-execute($a); my @row = $sth-fetchrow_array;}' which returns: DBD::DB2::st execute failed: [IBM][CLI Driver] CLI0115E Invalid cursor state. SQLSTATE=24000 at -e line 1. This seems to fall into the category of the first quote from the docs which suggest finish should be called for you. I don't want to add the finish if it should not be required and this is a huge amount of code to work through anyway. I know I could possible avoid the issue if I used selectall_* but here again, I'd have to check a lot of code to make this change. Is this a bug in DBD::DB2? Martin -- Martin J. Evans Easysoft Ltd, UK http://www.easysoft.com
Re: DBD::DB2 where to get a client library
Hi Martin: You'll need the Application Development Client, which is a free download from http://ibm.com/db2/udb/support/downloadv8.html. The clients are installed as RPMs on Linux using the db2setup program (part of the client); you might want to check out the DB2 HOWTO (http://tldp.org/HOWTO/DB2-HOWTO/index.html) for a general understanding of the underlying dependencies. Or post here on what your system is and what problems you're encountering. Dan On 01/06/06, Martin J. Evans [EMAIL PROTECTED] wrote: I'm posting this on behalf of a colleague who is struggling to get DBD::DB2 working on a machine remote to the DB2 database. We have DB2 installed and DBD::DB2 working on that machine but where can we download only the DB2 client (or whatever DBD::DB2 needs) to use DBD::DB2 to connect to a remote DB2 database on Linux? So far all we've found is an RPM with some dependency-hell and this is not a redhat system. Thanks. Martin
RE: Oracle connect hangs forever
On Tue, 2006-04-25 at 15:19 -0600, Reidy, Ron wrote: Get a 10046 trace of the process. This will tell you exactly what the DB is waiting for. What makes it worse or harder to track down is it seems to be momentary problem. While this process hangs, others are connecting no problem. It's almost as the Listener drops a packet or something to that effect and the DBI connect is still waiting for it to return. This is a high traffic DB so it may be easier to work around, unless the problem worsens. Trace files would be huge. I have had no issues with the TNS listener to date.l -- Ron Reidy Lead DBA Array BioPharma, Inc. -Original Message- From: Scott T. Hildreth [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 25, 2006 2:28 PM To: dbi-users@perl.org Subject: Oracle connect hangs forever I plan on using Sys::SigAction to wrap an alarm around the connect, but I thought I would post to see if anyone else has seen this problem. I have a process that runs in cron every 2 minutes, it processes files that are ftp'd into our site. I set a lock file so that if the previous run is still running it will not start up and send an email indicating that a previous process is still running. Well we moved to this processing was moved to a new server which is running Oracle version 10.2.0.1.0. I've been having a problem where this process is hanging for serveral hours (occurs over night) until it is killed. I run an strace on the pid and it is hanging on a read of fd 6, which is the Oracle tns listener. I don't believe any thing has processed, because there are no raised errors. I think that it has to be hanging on the connect, since I believe the tns listener accepts a connection and then gives the connect process a direct socket to Oracle. As I stated earlier, I was wondering if anyone else on the list has problems with 10g tns listener? Perl: 5.008008(i686-linux) OS : linux (2.6.14.6) DBI : 1.50 DBD::mysql : 3.0002 DBD::Sponge : 11.10 DBD::SQLite : 1.11 DBD::Proxy : 0.2004 DBD::Oracle : 1.16 DBD::Multiplex : 1.98 DBD::File : 0.33 DBD::ExampleP : 11.12 DBD::DBM: 0.03 LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-APR-2006 15:27:25 Thanks, STH -- Scott T. Hildreth [EMAIL PROTECTED]
Re: DBD:Oracle
On Tue, 2006-04-11 at 11:09 -0500, Maniace Libi - lmania wrote: I have a developer who wants DBD::ORACLE installed on a Solaris server. There is not an instance of Oracle installed on this server. He is certain that it can be installed, but I can't find information supporting this. It always errors out with wanting Oracle_home. Is there a way to install DBD without oracle You would need an Oracle Client installed, otherwise your developer could use DBD::Proxy. Setting up the Proxy server on the machine with the Oracle Server. installed. Thanks Libi *** The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please resend this communication to the sender and delete the original message or any copy of it from your computer system. Thank You. -- Scott T. Hildreth [EMAIL PROTECTED]
Re: DB2.pm for Perl 5.8 needed
This is a nice thought, but the latest release of DBD::DB2 is actually 0.78 (released a long time ago), but ActiveState wasn't interested in updating their version of the package because DBD::DB2 prereqs the DB2 Runtime Client. Apparently ActiveState has made it a policy to avoid offering packages which are not entirely self-contained (because they don't want to be inundated with support calls complaining about a problem due to a missing third-party library). So until IBM can figure out how to avoid the dependency on the DB2 Runtime Client, ActiveState is apparently going to continue to offer a decrepit version of DBD::DB2. The last time esoftmatic.com disappeared from the Web was due to some DNS problems; more than likely this problem will clear up in a day or two. Dan On 3/31/06, John Scoles [EMAIL PROTECTED] wrote: Since you are in windows you might want to just to use Activeperl and ppm to get the latest version which I think is ' DBD-DB2 [0.76] DBD-DB2' - Original Message - From: Bergners, Andrei [EMAIL PROTECTED] To: dbi-users@perl.org Sent: Friday, March 31, 2006 10:01 AM Subject: DB2.pm for Perl 5.8 needed Hi, I am looking to install the Win32 DB2.pm library for perl 5.8.7 or 5.8.8. The previously recommended site of http://ftp.esoftmatic.com/DBI/ http://ftp.esoftmatic.com/DBI/ no longer seems to contain the necessary ppds. Can someone recommend another location? thanks andrei
Re: Upgrade.. DBI
On Wed, 2006-03-29 at 05:34 -0800, Paresh Rathod wrote: Sir, Please provide me the help to upgrade the latest of DBI. I am using Oracle 9 It shows error: Can't locate Test/More.pm You need to install Test::More. in @INC (@INC contains: lib C:/paresh/Perl/lib C:/pare sh/Perl/site/lib .) at makefile.pl line 36. BEGIN failed--compilation aborted at makefile.pl line 36. Waiting for ur response... Regards Paresh - Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less. -- Scott T. Hildreth [EMAIL PROTECTED]
Re: Re: Upgrade.. DBI
On Wed, 2006-03-29 at 17:57 +0300, [EMAIL PROTECTED] wrote: Please use [EMAIL PROTECTED] instead of [EMAIL PROTECTED] I didn't use either, I replied to a post on dbi-users list. If you're email has changed then correct it with the dbi-user list, don't send replies like this when some posts to dbi-users. -- Scott T. Hildreth [EMAIL PROTECTED]
Zip Codes, Long/Lat and LAMP?
OK, I think I asked something along these lines before, but I am actually starting to code so I wanted to revise the question(s) a bit. I am looking for a good way to keep an up-to-date database (or perhaps use an XML-RPC/SOAP based service) to translate back-and-forth between information such as city/state/county, zip-code, and longitude/latitude. I am currently writing most of my administrative tools in PHP but will likely build most of my content delivery items in PERL. I am going to be dealing with geocaching on the initial project and thus the locations might be specified by the name of a nearby city, a zipcode, possibly even crossroads (I'll have to work that one out later) or more often by use of GPS or similar Longitude and Latitude coordinates. My desire is to be as thorough as possible with what is actually stored and 'fill in the blanks' for the user only requiring them to fill in an 'either/or' type scenario. (use of an address OR long/lat coordinates) Thus I am looking for some way to translate one to the other and back again. (address/zip/city to long/lat, or long/lat to zip/city/county/state/etc.) Ultimately I want to include at least canada and possibly international locations (although I will likely use different tools for handling those). I've started looking at some of the services available at USPS and zip-codes.com. I'll start looking at map-services next as I would also like to be able to generate maps for people as well as possibly have them select locations on a map rather than enter the specific data. (ugh - I have a feeling that might be a nightmare) Finally, I'm sure if I can get something to work for the above mentioned translations (so I can store at least an approximate long/lat for all locations) then I can find the math myself to calculate distances, but I would be curious to know if any packages for such already exist. I did a quick search of perl but only found one CPAN tool that appeared to do Long/Lat calculations and it's not one included in the standard CPAN supported downloads. All help is appreciated. SW __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Spreadsheet::WriteExcel
On Fri, 2006-02-24 at 05:56 -0800, Robert wrote: Hi list, I have installed Spreadsheet::WriteExcel and Parse::RecDescent without any issues, compilation and installation went went but they are not working. bash-2.05# perl -MSpreadsheet::WriteExcel Spreadsheet/WriteExcel.pm did not return a true value. bash-2.05# perl -MParse::RecDescent Parse/RecDescent.pm did not return a true value. BEGIN failed--compilation aborted. Anyone has same issue? Nope. Thanks in advance This really is the right list to post such a question. Look at this page for all kinds of perl lists, http://lists.cpan.org/ ...I would also suggest using www.perlmonks.org , that is a good place to get help. - Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -- Scott T. Hildreth [EMAIL PROTECTED]
Re: Strange error when doing insert into DB
On Mon, 2006-02-20 at 21:08 +0530, Hemlata Lalwani wrote: Hi, Please give a look at below source code if this can help you: This is Oracle.pm code, which is not your code that is in error. I'm sorry if you cannot send your actual code, I can't show where to fix your code. package DBD::Oracle::db; # == DATABASE == use strict; sub prepare { my($dbh, $statement, @attribs)= @_; # create a 'blank' sth my $sth = DBI::_new_sth($dbh, { 'Statement' = $statement, }); # Call Oracle OCI parse func in Oracle.xs file. # and populate internal handle data. DBD::Oracle::st::_prepare($sth, $statement, @attribs) or return undef; $sth; Waiting for your help..Also wud like to know how i can add myself in this Go to the link below, http://lists.cpan.org/showlist.cgi?name=dbi-users list .. Regards, -Hemlata Lalwani - Original Message - From: Scott T. Hildreth [EMAIL PROTECTED] To: Hemlata Lalwani [EMAIL PROTECTED] Cc: dbi-users@perl.org Sent: Monday, February 20, 2006 8:59 PM Subject: RE: Strange error when doing insert into DB On Mon, 2006-02-20 at 20:05 +0530, Hemlata Lalwani wrote: Hi, Iam also having the same problem..the piece of code is as below: I'm sorry I don't know what this is referring to? DBD::Oracle::st::_prepare($sth, $statement, @attribs) or return undef; Are you coding it this way or is this coming from a trace? Can you post some code? would really appreciate if you help me.. I would like to help, but I need more info or code to look at. Also I am cc the dbi-users list, this is where these questions should be asked. Also The error i got in my qmail logs is Can't mix placeholder styles (:foo/:1) at Well you can't, I would need to see the $statemnet in order to help. /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD/Oracle.pm line 293. Which i got when i insert the mail into databse..this mail actually bouced back... Regards, -Hemlata Lalwani Hemlata Lalwani | Linux Administrator ( Systems ) I Webdunia.Com (India) Pvt Ltd | 582 MG Road Indore MP | Work +91-731-398-3426 | Mobile +91-930-079-7948 I Fax +91-731-243-6615 | www.webdunia.net -- Scott T. Hildreth [EMAIL PROTECTED] -- Scott T. Hildreth [EMAIL PROTECTED]
Re: need DBD-DB2.ppd, DBI.ppd from www.esoftmatic.com, but server is unreachable.
Seems to be working now for me: http://ftp.esoftmatic.com/outgoing/DBI/ Dan On 31-Jan-2006 10:09:34 CET, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, I need DBI and DBD-DB2 packages for Activeperl, but esoftmatic server is unreachable. Can anybody help me with this problem or send me this files? Thanks for any help. Kind Regards Denis Baumgaertner System and Network Consultant __ SPIRIT/21 AG Otto-Lilienthal-Strasse 36 71034 Böblingen phone: +49 7031 / 714 96 00 fax: +49 7031 / 714 96 99 mailto: [EMAIL PROTECTED] internet: http://www.spirit21.de
Re: [Fwd: DBD::AnyData dbish]
On Fri, 2006-01-06 at 10:17 -0800, Jeff Zucker wrote: Scott T. Hildreth wrote: I am missing something here (probably a few brain cells), how do I set up the dsn for DBD::AnyData (fixed format) when using dbish? Well, it's rather messy because dbish's execution of perl is a bit messy. But it works fine. Try this: 1) start dbish like this: dbish dbi:AnyData:f_dir=./mydb 2) within dbish, issue a perl command to set the catalog for a table: $sh-{dbh}-ad_catalog('foo','Fixed','foo.db',{pattern='A1 A7'}) /perl Then you should be able to access foo.db as a Fixed file as the table foo with the specified pattern. $sh is the DBI::Shell object that holds the current $dbh in an attribute. dbish does a string eval on everything in the command buffer preceding /perl. Let me know if this works for you. Jeff, I meant to reply to you on Friday. This worked. Thanks, STH -- Scott T. Hildreth [EMAIL PROTECTED]
Re: Connect to DB2
Hi Vincent: You just need to install the DB2 development headers and libraries (available with the free to download and use DB2 Application Development Client) on your Linux box and set DB2_HOME before compiling DBD::DB2; that will enable you to connect from your Linux box to a DB2 server running on a Windows box. For more information: * http://ibm.com/db2/perl/ * http://www.db2mag.com/showArticle.jhtml?articleID=59301551 * http://www.db2mag.com/story/showArticle.jhtml?articleID=60400732 (Note that Red Hat 9.0 is not officially supported by DB2, so you might run into some troubles with that part of the equation. If it doesn't work out, and you're willing to install a new flavour of Linux, check out http://ibm.com/db2/linux/validate for a list of Linux distros supported by DB2) Dan On 1/5/06, Vincent Deng [EMAIL PROTECTED] wrote: Dear dbi-helpers, My environment is RedHat 9.0. I got the following message while installing DBD::DB2 module. DB2_HOME environment variable must be set to installed location of DB2. Did this message indicate that I have to install DB2 in the same machine and set DB2_HOME environment variable for DBD installation? If I want not to install DB2 on the same machine but connect to the DB2 server installed on another windows machine, what should I do? Thanks in advance
Re: Connect to DB2
Let's keep this discussion on-list in case someone else has the same question in the future. http://ibm.com/db2/perl/ says that if you are compiling DBD::DB2 on Linux, you set DB2_HOME to the location of your DB2 instance--for example, /home/db2inst1/sqllib/ -- because DBD::DB2 needs the DB2 headers and libraries to compile successfully. When you run a Perl program, DBD::DB2 then uses those libraries to connect to your DB2 server running on Windows. Dan On 1/5/06, Vincent Deng [EMAIL PROTECTED] wrote: Dear Dan, So what value I should assign to DB_HOME? The DB2 home directory on windows box or? Thanks in advance On 1/5/06, Dan Scott [EMAIL PROTECTED] wrote: Hi Vincent: You just need to install the DB2 development headers and libraries (available with the free to download and use DB2 Application Development Client) on your Linux box and set DB2_HOME before compiling DBD::DB2; that will enable you to connect from your Linux box to a DB2 server running on a Windows box. For more information: * http://ibm.com/db2/perl/ * http://www.db2mag.com/showArticle.jhtml?articleID=59301551 * http://www.db2mag.com/story/showArticle.jhtml?articleID=60400732 (Note that Red Hat 9.0 is not officially supported by DB2, so you might run into some troubles with that part of the equation. If it doesn't work out, and you're willing to install a new flavour of Linux, check out http://ibm.com/db2/linux/validate for a list of Linux distros supported by DB2) Dan On 1/5/06, Vincent Deng [EMAIL PROTECTED] wrote: Dear dbi-helpers, My environment is RedHat 9.0. I got the following message while installing DBD::DB2 module. DB2_HOME environment variable must be set to installed location of DB2. Did this message indicate that I have to install DB2 in the same machine and set DB2_HOME environment variable for DBD installation? If I want not to install DB2 on the same machine but connect to the DB2 server installed on another windows machine, what should I do? Thanks in advance
Re: Bareword DBI::SQL_INTEGER not allowed while strict subs
If you are using DBI::SQL_INTEGER, ':sql_types' needs to be imported, i.e. use DBI qw(:sql_types); On Sun, 2005-12-11 at 18:45 -0500, Patrick Danley wrote: I am new to DBI, Perl, and SQL and I am currently trying to piece together a group of bioinformatic programs. In running the database element of the package, I recieve a number of : Bareword DBI::SQL_INTEGER not allowed while strict subs in use errors (a full listing of the error is pasted below). Does anyone have experience with this error and/or suggestions on how i might resolve it? I am truly a novice, 3 days in, so simple explanations would be especially appreciated. I'm running : Perl 5.8.6 dbi-pm 5.8.6 PostgreSQL -perl-586 Mac OS 10.4.2 Bareword DBI::SQL_INTEGER not allowed while strict subs in use at /sw/lib/perl5/5.8.6/darwin-thread-multi-2level/DBD/Pg.pm line 1168. Bareword DBI::SQL_SMALLINT not allowed while strict subs in use at /sw/lib/perl5/5.8.6/darwin-thread-multi-2level/DBD/Pg.pm line 1168. Bareword DBI::SQL_DECIMAL not allowed while strict subs in use at /sw/lib/perl5/5.8.6/darwin-thread-multi-2level/DBD/Pg.pm line 1168. Bareword DBI::SQL_FLOAT not allowed while strict subs in use at / sw/lib/perl5/5.8.6/darwin-thread-multi-2level/DBD/Pg.pm line 1168. Bareword DBI::SQL_REAL not allowed while strict subs in use at / sw/lib/perl5/5.8.6/darwin-thread-multi-2level/DBD/Pg.pm line 1168. Bareword DBI::SQL_DOUBLE not allowed while strict subs in use at / sw/lib/perl5/5.8.6/darwin-thread-multi-2level/DBD/Pg.pm line 1168. Bareword DBI::SQL_NUMERIC not allowed while strict subs in use at /sw/lib/perl5/5.8.6/darwin-thread-multi-2level/DBD/Pg.pm line 1168. Compilation failed in require at /Users/TheBucket/lib/Perl/PartiGene/ PG_db.pm line 6. BEGIN failed--compilation aborted at /Users/TheBucket/lib/Perl/ PartiGene/PG_db.pm line 6. Compilation failed in require at /Users/TheBucket/genome/bin/ PartiGene_db.pl line 4. BEGIN failed--compilation aborted at /Users/TheBucket/genome/bin/ PartiGene_db.pl line 4. Patrick Danley, Ph.D. Postdoctoral Researcher Department of Biology University of Maryland phone 301.405.8303 fax 301.314.9358 email [EMAIL PROTECTED] http://www.life.umd.edu/biology/shawlab/patrickdanley -- Scott T. Hildreth [EMAIL PROTECTED]
Re: problems using DBI:Proxy
On Thu, 2005-12-08 at 14:25 +0200, Claude wrote: I have problems using DBI:Proxy / DBI:Proxyserver with an Oracle database. In fact, I am not sure that I start the proxy properly. I'd like to connect to a remote Oracle database (called 'abc') running on machine A (ip=1.2.3.4), port 1521. Port 1521 is used by Oracle (if setup that way) for tnslistener. You can't bind to that port since it is already in use. As the error message indicated. On the server that has Oracle use the dbiproxy command that is installed when DBI is is installed. something like dbiproxy --port ...then you can connect to this proxy server from other servers. i.e. $ENV{DBI_AUTOPROXY} = 'hostname=srvA;port='; my $dbh = DBI-connect('dbi:Oracle:sid', 'user', 'passwsd'); ...etc. Do some reading :-) perldoc dbiproxy First, on A, I created a proxy startup file: - $ cat ./testProxy0.pl #!/usr/bin/perl -- # -*-Perl-*- use DBI::ProxyServer; use strict; use diagnostics; DBI::ProxyServer::main(@ARGV); - Then I run it, and... get an error: - $ ./testProxy0.pl -localaddr 1.2.3.4 --localport 1521 running... Uncaught exception from user code: Cannot create socket: Address already in use at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon.pm line 548. at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon/Log.pm line 136. Net::Daemon::Log::Fatal('DBI::ProxyServer=HASH(0x8275980)','Cannot create socket: Address already in use') called at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon.pm line 548 Net::Daemon::Bind('DBI::ProxyServer=HASH(0x8275980)') called at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/DBI/ProxyServer.pm line 234 DBI::ProxyServer::main('-localaddr',1.2.3.4,'--localport',1521) called at ./testProxy0.pl line 5 - Now, changing the port to a free value (1521 is used by Oracle) gets rid of the error. Is this the way to go? Is this 'free' port the value that the DBI:Proxy should send a request to? But then, I don't understand how to tell the proxy what port is the database running at. Can you help? Thanks for your time. -- Scott T. Hildreth [EMAIL PROTECTED]
Re: [cgiapp] Best free DB for a web-based Perl app response results...
Aaron Dancygier [EMAIL PROTECTED] wrote: Just look at the list of companies that use mysql. Would google and yahoo use it if it werent up to par? Corporate entities (i.e. corporate managers) make decisions that are not always generated from the same motivations as the rest of us. Google and Yahoo using mysql does make a great endorsement, yes. But that's all it is. As a fan of philosophy and deductive reasoning, I have been getting great joy over the past year or so in noticing and pointing out 'deductive fallacies' whenever they are made in public. Politics is ripe with them as are internet SIGs. For those unfamiliar, this leap in reasoning is known as Argumentum ad Verecundiam fallacy (Argument from respect/modesty, Latin - a.k.a. Appeal to Authority) or perhaps it might even fall under Ipse Dixit (He, himself, said it, Latin) fallacy. Similarly, to point out MySQL as being a better choice simply because more people use it (dare I remind you of the popularity of windows xp or internet explorer?) is an Ad Populum fallacy. How's about because it has been around longer? (I don't know if it has or not, but that would be Ad Antiquatum fallacy) In summation, a fallacy is something that inspires an unjustified leap in drawing a conclusion based on something that is not logically deduced based on the premises. In short, I prefer to stick to the facts - not popularity contests or the like. SW - Yahoo! Personals Single? There's someone we'd like you to meet. Lots of someones, actually. Yahoo! Personals
Re: Proxy question?
On Tue, 2005-11-29 at 11:55 -0600, Scott T. Hildreth wrote: Whoops, trace file was to big... attached is the first 200 lines. On Tue, 2005-11-29 at 11:39 -0600, Scott T. Hildreth wrote: Perl: 5.008003(i686-linux) OS : linux (2.4.24-abi) DBI : 1.48 DBD::mysql : 2.9008 DBD::Sponge : 11.10 DBD::Proxy : 0.2004 Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm line 533. Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm line 533. Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm line 533. Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm line 533. ...this is a grep from the trace log, why are the NUM_OF_FIELDS 'undef' and not 0? Not sure what is going on here, I upgraded to 1.49 and still no luck. Running in the debugger, I see the NUM_OF_FIELDS value is set to '0' and from other servers I get the 'undef'. Will have to investigate more, for now I wrap an eval around the process and capture the uninitialized warnings. Just thought I would give an update, in case this problem was keeping somebody up at night. :-) STORE DBI::st=HASH(0x85a8bc8) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x85a8e98) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x85ae1d4) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x8397b18) 'NUM_OF_FIELDS' = undef STORE DBI::st=HASH(0x8482598) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x8488e6c) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x8482838) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x8482658) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x848141c) 'NUM_OF_FIELDS' = undef STORE DBI::st=HASH(0x8488f44) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x848ead4) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x848d7e8) 'NUM_OF_FIELDS' = undef STORE DBI::st=HASH(0x848cb90) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x848762c) 'NUM_OF_FIELDS' = undef DBI Trace Level 9 attached, Thanks, STH -- Scott T. Hildreth [EMAIL PROTECTED]
Re: DBD::Oracle
Correct. On Tue, 2005-11-29 at 08:33 -0700, Ian Harisay wrote: Hi, I am upgrading my Oracle client. This probably means I need to recompile DBD::Oracle. Correct? Thanks, Ian -- Scott T. Hildreth [EMAIL PROTECTED]
Re: Proxy question?
Whoops, trace file was to big... attached is the first 200 lines. On Tue, 2005-11-29 at 11:39 -0600, Scott T. Hildreth wrote: Perl: 5.008003(i686-linux) OS : linux (2.4.24-abi) DBI : 1.48 DBD::mysql : 2.9008 DBD::Sponge : 11.10 DBD::Proxy : 0.2004 Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm line 533. Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm line 533. Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm line 533. Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm line 533. ...this is a grep from the trace log, why are the NUM_OF_FIELDS 'undef' and not 0? STORE DBI::st=HASH(0x85a8bc8) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x85a8e98) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x85ae1d4) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x8397b18) 'NUM_OF_FIELDS' = undef STORE DBI::st=HASH(0x8482598) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x8488e6c) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x8482838) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x8482658) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x848141c) 'NUM_OF_FIELDS' = undef STORE DBI::st=HASH(0x8488f44) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x848ead4) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x848d7e8) 'NUM_OF_FIELDS' = undef STORE DBI::st=HASH(0x848cb90) 'NUM_OF_FIELDS' = '1' STORE DBI::st=HASH(0x848762c) 'NUM_OF_FIELDS' = undef DBI Trace Level 9 attached, Thanks, STH -- Scott T. Hildreth [EMAIL PROTECTED] DBI 1.48-nothread default trace level set to 0x0/5 (pid 14499) - DBI-connect(dbi:Oracle:sth, foo, , HASH(0x84e9a18)) DBI_AUTOPROXY: dbi:Proxy():hostname=scotth;port=;dsn=dbi:Oracle:sth - DBI-install_driver(Proxy) for linux perl=5.008003 pid=14499 ruid=1013 euid=1013 install_driver: DBD::Proxy version 0.2004 loaded from /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBD/Proxy.pm New DBI::dr (for DBD::Proxy::dr, parent=, id=) dbih_setup_handle(DBI::dr=HASH(0x832f784)=DBI::dr=HASH(0x8582910), DBD::Proxy::dr, 0, Null!) dbih_make_com(Null!, 0, DBD::Proxy::dr, 112, 0) thr#0 dbih_setup_attrib(DBI::dr=HASH(0x8582910), Err, Null!) SCALAR(0x833220c) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x8582910), State, Null!) SCALAR(0x83321f4) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x8582910), Errstr, Null!) SCALAR(0x8332224) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x8582910), TraceLevel, Null!) 0 (already defined) dbih_setup_attrib(DBI::dr=HASH(0x8582910), FetchHashKeyName, Null!) 'NAME' (already defined) - install_driver= DBI::dr=HASH(0x832f784) !! warn: 0 CLEARED by call to connect method - connect for DBD::Proxy::dr (DBI::dr=HASH(0x832f784)~0x8582910 'hostname=scotth;port=;dsn=dbi:Oracle:sth' 'foo' HASH(0x84edb98)) New DBI::db (for DBD::Proxy::db, parent=DBI::dr=HASH(0x8582910), id=) dbih_setup_handle(DBI::db=HASH(0x85828f8)=DBI::db=HASH(0x85a23b4), DBD::Proxy::db, 832f4d8, Null!) dbih_make_com(DBI::dr=HASH(0x8582910), 84eb5f8, DBD::Proxy::db, 112, 0) thr#0 dbih_setup_attrib(DBI::db=HASH(0x85a23b4), Err, DBI::dr=HASH(0x8582910)) SCALAR(0x8334840) (already defined) dbih_setup_attrib(DBI::db=HASH(0x85a23b4), State, DBI::dr=HASH(0x8582910)) SCALAR(0x83348a0) (already defined) dbih_setup_attrib(DBI::db=HASH(0x85a23b4), Errstr, DBI::dr=HASH(0x8582910)) SCALAR(0x8334870) (already defined) dbih_setup_attrib(DBI::db=HASH(0x85a23b4), TraceLevel, DBI::dr=HASH(0x8582910)) 0 (already defined) dbih_setup_attrib(DBI::db=HASH(0x85a23b4), FetchHashKeyName, DBI::dr=HASH(0x8582910)) 'NAME' (already defined) dbih_setup_attrib(DBI::db=HASH(0x85a23b4), HandleSetErr, DBI::dr=HASH(0x8582910)) undef (not defined) dbih_setup_attrib(DBI::db=HASH(0x85a23b4), HandleError, DBI::dr=HASH(0x8582910)) undef (not defined) STORE DBI::db=HASH(0x85828f8) 'Active' = 1 - connect= DBI::db=HASH(0x85828f8) at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBI.pm line 598 via /home/me/src/Tools/local/match2/blib/lib/Allant/Tools/DNC.pm line 173 - STORE for DBD::Proxy::db (DBI::db=HASH(0x85a23b4)~INNER 'PrintError' 0) STORE DBI::db=HASH(0x85a23b4) 'PrintError' = 0 - STORE= 1 at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBI.pm line 645 via /home/me/src/Tools/local/match2/blib/lib/Allant/Tools/DNC.pm line 173 - STORE for DBD::Proxy::db (DBI::db=HASH(0x85a23b4)~INNER 'AutoCommit' 0) - STORE= '1' at /usr/local/lib/perl5/site_perl/5.8.3/i686-linux/DBI.pm line 645 via /home/me/src/Tools/local/match2/blib
Re: anyway to determine # rows before fetch loop ends and without seperate count(*)
On 11/16/05, Rob Craig [EMAIL PROTECTED] wrote: I am using DBD::mysql and I can get the number of rows by assigning the result of the execute to a scalar: my $rows = $sth-execute or die Couldn't execute statement: . DBI-errstr; maybe this doesn't work with DBD::Oracle? Rob When you execute a SELECT statement in MySQL, it (by default) immediately returns all of the rows back to you under the covers, which is why it is able to give you a row count. Woe betide you if your SELECT statement returns a million rows. [EMAIL PROTECTED] wrote: #Here's an example which shows what I am trying to accomplish. If I can determine the number of rows before pushing the data, this can simply things for #me when processing the data throught my scripts. # use warnings; use strict; use DBI; use DBD::Oracle; my $sql=q{ select name, location from mytable }; my $dbh; eval { $dbh = DBI-connect(dbi:Oracle:MYDB, 'dbuser', 'dbpass', { RaiseError = 1, AutoCommit = 0, ora_session_mode = 0 } ); }; if ( $@ ) { outprint('end',$DBI::errstr\n); } my $sth=$dbh-prepare($sql) or die Couldn't prepare statement: . DBI- errstr; $sth-execute or die Couldn't execute statement: . DBI-errstr; my $ary; while ($ary = $sth-fetchrow_array()) { #I need to determine number of rows as this will affect whether a matrix is used or not #a boolean variable $matrix could be returned or a ref check done so that the data #processing code can act accordingly #$sth-rows only shows total rows after the while loop is processed #Can I accomplish this without a seperate count(*) statement? # #push @newary,[ @{$ary} ]; # if more than one row #or #push @newary, @{$ary} ; # single row } $sth-finish; $dbh-disconnect; # #ActivePerl 5.8.7 813 #ppm #-DBD-Oracle 1.16 #-DBI 1.48 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.3/173 - Release Date: 11/16/2005
Re: error while trying to install DBI
Strange -- just tried the exact same commands here and they worked as expected. Maybe there was a temporary FTP server glitch. Are you able to see the ftp.esoftmatic.com site? Dan On 11/3/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello. I just installed perl 5.8.7 from active state. (I need to write perl scripts that run against DB2 databases on Windows platform). I then tried to run: ppm install ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBI.ppd but I get the following back: C:\Perl\binppm install ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBI.ppd Error: No valid repositories: Error: 500 Server closed connection without sending any data back Error: 500 Server closed connection without sending any data back I was going to run that and then run: ppm install ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-DB2.ppd ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-DB2.ppd but don't understand what the error means? Can someone please help? Thanks, Bob
Re: ANNOUNCE: MySQL 5.0 now final/stable/GA
Hi Darren: I think an update about the recommended minimum database version levels for your access modules is on-topic for this mailing list, but suspect that product advertisements are probably off-topic -- personal opinion, maybe, but I don't want to see this list become a dumping ground for the latest releases and associated features of Oracle, Postgres, Informix IDS, DB2, SQL Server, etc. Dan On 10/24/05, Darren Duncan [EMAIL PROTECTED] wrote: For those of you that use MySQL, this should be welcome news, that version 5.0.x is now officially stable, at 5.0.15. Speaking just personally, the recommended minimum versions of certain database products to use with my upcoming rewritten database access modules are the following; they are all stable, and what I will be testing with: - SQLite 3.x (3.2.7+) - MySQL 5.x (5.0.15+) - PostgreSQL 8.x (8.0.4+) I will also support several previous major versions of all 3, but at lower priority, based on user demand, partly to assist with upwards migrations. -- Darren Duncan --- Date: Mon, 24 Oct 2005 15:40:43 +0300 From: Kaj Arnö [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Announcing MySQL 5.0 Dear user of MySQL, It is my pleasure to announce the production release of MySQL 5.0, which is hereby GA (Generally Available). Since my announcement of the Release Candidate less than a month ago, no bugs have been reported that require a second Release Candidate. This, combined with the feedback from over two million downloads of MySQL 5.0 during its beta phase, give us the confidence to give MySQL 5.0 the status of Current Production Release, or GA. In the Release Candidate announcement less than a month ago, I described MySQL 5.0 as the most important release in MySQL's history, and that is certainly the case. Thus, I encourage you all to: - get your own copy at http://dev.mysql.com/downloads/mysql/5.0.html - do all of your new database development using MySQL 5.0 - upgrade your current MySQL environments to MySQL 5.0, as soon as you've properly verified your production applications against it (be sure to take a full backup of your data before upgrading, study the relevant documentation, and if you have a MySQL Network support contract, consult first with the MySQL Support Team) Let me also underline that we continue to offer some earlier versions of MySQL Server for download. However, you should expect maintenance releases for earlier versions only in limited form: - for MySQL 4.1, only when serious bugs affecting significant user groups are reported - for MySQL 4.0, only when security bugs are reported MySQL 5.0 is the most ambitious release to date for MySQL AB. We have added functionality that our users have requested from us over many years. However, everything we do at MySQL centers around our three priorities of Performance, Reliability, and Ease of Use. MySQL 5.0 is certainly true to these company-wide values. Key new features of MySQL 5.0 come in three groups: a) ANSI SQL standard features formerly unknown to MySQL b) ANSI SQL standard compliance of existing MySQL features c) New MySQL Storage Engines, Tools and Extensions The new ANSI SQL features include: - Views (both read-only and updatable views) - Stored Procedures and Stored Functions, using the SQL:2003 syntax, which is also used by IBM's DB2 - Triggers (row-level) - Server-side cursors (read-only, non-scrolling) Implementing ANSI SQL standard ways of using existing MySQL features means there will be fewer unpleasant surprises (gotchas) for those migrating to MySQL from other database systems: - Strict Mode: MySQL 5.0 adds a mode that complies with standard SQL in a number of areas in which earlier versions did not; we now do strict data type checking and issue errors for all invalid dates, numbers and strings as expected - INFORMATION_SCHEMA: An ANSI SQL-compliant set of tables that provide database metadata, in parallel with the MySQL-specific SHOW commands - Precision Math: A new library for fixed-point arithmetic, giving high accuracy for financial and mathematical operations - VARCHAR Data Type: The maximum effective length of a VARCHAR column has increased to 65,532 bytes; also, stripping of trailing whitespace no longer occurs New MySQL Storage Engines, Tools and Extensions are: - XA Distributed Transactions - ARCHIVE Storage Engine for storing large amounts of data without indexes in a very small footprint, intended for historical data that may be needed for future audit compliance (Sarbanes Oxley or otherwise) - FEDERATED Storage Engine for accessing data ín tables of remote databases rather than in local tables (only in MAX version) - Instance Manager: a tool to start and stop MySQL Server, even remotely To find out more details on what's new in MySQL 5.0, follow the pointers from
Re: DBD::Oracle 10.1 client
On Fri, 2005-10-21 at 20:47 +0100, Tim Bunce wrote: Ah, I didn't spot the attached trace. Sorry. OCIStmtExecute(831e534,8323594,831e5a8,0,0,0,0,0)=SUCCESS OCIAttrGet(8323594,OCI_HTYPE_STMT,bfffe906,0,10,831e5a8)=SUCCESS dbd_st_execute SELECT returned (SUCCESS, rpc0, fn4, out0) dbd_st_fetch 2 fields... OCIStmtFetch(8323594,831e5a8,1,2,0)=SUCCESS dbih_setup_fbav for 2 fields = 0x829bfac dbd_st_fetch 2 fields SUCCESS 0 (rc=0): '?.' 1 (rc=0): '51' Sure looks like an Oracle problem. Tim. Just to follow up, it was an Oracle problem, what problem I am not sure. We ended up putting a 9i client on the server, which works. The funny thing is that the 10g client that was on that server would work with another 10g Db. The only difference is the one db was on an Alpha and the other one (the one that worked) was on a Linux server. -- Scott T. Hildreth [EMAIL PROTECTED]
DBD::Oracle 10.1 client
I am going to investigate more, but I thought I would post the question to see if anyone has run into this problem. I have co-workers that connecting to a remote Oracle DB (10.1), I compiled DBD::Oracle 1.16 with the 10.1 client libraries. The data returned from a selectall_arrayref is 2 fields a filename and a quantity. Here is the isolated code, 286:my $load_file_ar = $dbh-selectall_arrayref(q{ 287 select FILENAME, NUM_RECORDS 288 from LOAD_DATA_SRC_FILE 289 where LOAD_ID = ? 290and DATA_UPDATE_ID = ? 291 order by FILE_ID 292 }, undef, $load_id, $update_id); $load_id = 19 $update_id = 51. ...here is the data returned. DB4 x $files_ar 0 ARRAY(0x8536328) 0 ARRAY(0x85e40e0) 0 (binary data) 1 51 what ever $update_id's value is, this is always returned in the [1] position of the the arrayref and the filename is always binary data. This works fine with sqlplus. I have tried it with Perl 5.8.[167] always the same results. The database resides on an Alpha and the clients are on Linux. Trace doesn't show anything unusual. I don't know if this is an NLS-utf8 issue. Any ideas? Thanks, STH Trace- level 9 is attached. -- Scott T. Hildreth [EMAIL PROTECTED] DBI::db=HASH(0x829bca0) trace level set to 9 in DBI 1.39-nothread (pid 25442) - selectall_arrayref for DBD::Oracle::db (DBI::db=HASH(0x82fec14)~0x829bca0 ' select FILENAME, NUM_RECORDS from LOAD_DATA_SRC_FILE where LOAD_ID = ? and DATA_UPDATE_ID = ? order by FILE_ID ' undef 19 51) prepare DISPATCH (DBI::db=HASH(0x829bca0) rc1/1 @3 g0 ima201 pid#25442) at /home/demosrc/pmod/DBcommon.pm line 286 via tst_demosrc.pl line 19 1 - prepare for DBD::Oracle::db (DBI::db=HASH(0x829bca0)~INNER ' select FILENAME, NUM_RECORDS from LOAD_DATA_SRC_FILE where LOAD_ID = ? and DATA_UPDATE_ID = ? order by FILE_ID ' undef) dbih_setup_handle(DBI::st=HASH(0x829bee0)=DBI::st=HASH(0x829bec8), DBD::Oracle::st, 829beec, Null!) dbih_make_com(DBI::db=HASH(0x829bca0), 829d568, DBD::Oracle::st, 208, 0) thr#0 dbih_setup_attrib(DBI::st=HASH(0x829bec8), Err, DBI::db=HASH(0x829bca0)) SCALAR(0x81f9860) (already defined) dbih_setup_attrib(DBI::st=HASH(0x829bec8), State, DBI::db=HASH(0x829bca0)) SCALAR(0x81f98c0) (already defined) dbih_setup_attrib(DBI::st=HASH(0x829bec8), Errstr, DBI::db=HASH(0x829bca0)) SCALAR(0x81f9890) (already defined) dbih_setup_attrib(DBI::st=HASH(0x829bec8), TraceLevel, DBI::db=HASH(0x829bca0)) 9 (already defined) dbih_setup_attrib(DBI::st=HASH(0x829bec8), FetchHashKeyName, DBI::db=HASH(0x829bca0)) 'NAME' (already defined) dbih_setup_attrib(DBI::st=HASH(0x829bec8), HandleError, DBI::db=HASH(0x829bca0)) undef (not defined) dbd_preparse scanned 2 distinct placeholders OCIHandleAlloc(83092d8,8363608,OCI_HTYPE_STMT,0,0)=SUCCESS OCIStmtPrepare(8323594,831e5a8,' select FILENAME, NUM_RECORDS from LOAD_DATA_SRC_FILE where LOAD_ID = :p1 and DATA_UPDATE_ID = :p2 order by FILE_ID ',134,1,0)=SUCCESS OCIAttrGet(8323594,OCI_HTYPE_STMT,836360c,0,24,831e5a8)=SUCCESS dbd_st_prepare'd sql SELECT dbd_describe SELECT (EXPLICIT, lb 80)... OCIStmtExecute(831e534,8323594,831e5a8,0,0,0,0,16)=SUCCESS OCIAttrGet(8323594,OCI_HTYPE_STMT,bfffe28c,0,18,831e5a8)=SUCCESS OCIParamGet(8323594,4,831e5a8,83636b0,1)=SUCCESS OCIAttrGet(83251e4,OCI_DTYPE_PARAM,83636c6,0,2,831e5a8)=SUCCESS OCIAttrGet(83251e4,OCI_DTYPE_PARAM,83636c4,0,1,831e5a8)=SUCCESS OCIAttrGet(83251e4,OCI_DTYPE_PARAM,83636c8,0,5,831e5a8)=SUCCESS OCIAttrGet(83251e4,OCI_DTYPE_PARAM,83636ca,0,6,831e5a8)=SUCCESS OCIAttrGet(83251e4,OCI_DTYPE_PARAM,83636cb,0,7,831e5a8)=SUCCESS OCIAttrGet(83251e4,OCI_DTYPE_PARAM,83636d8,bfffe288,4,831e5a8)=SUCCESS fbh 1: 'FILENAME' NULLable, otype 1- 5, dbsize 250/251, p250.s0 OCIParamGet(8323594,4,831e5a8,83636f0,2)=SUCCESS OCIAttrGet(83251c0,OCI_DTYPE_PARAM,8363706,0,2,831e5a8)=SUCCESS OCIAttrGet(83251c0,OCI_DTYPE_PARAM,8363704,0,1,831e5a8)=SUCCESS OCIAttrGet(83251c0,OCI_DTYPE_PARAM,8363708,0,5,831e5a8)=SUCCESS OCIAttrGet(83251c0,OCI_DTYPE_PARAM,836370a,0,6,831e5a8)=SUCCESS OCIAttrGet(83251c0,OCI_DTYPE_PARAM,836370b,0,7,831e5a8)=SUCCESS OCIAttrGet(83251c0,OCI_DTYPE_PARAM,8363718,bfffe288,4,831e5a8)=SUCCESS fbh 2: 'NUM_RECORDS'NULLable, otype 2- 5, dbsize 22/134, p0.s-127 OCIAttrSet(8323594,OCI_HTYPE_STMT,bfffe284,4,11,831e5a8)=SUCCESS OCIDefineByPos(8323594,83636b4,831e5a8,1,8364360,251,5,83589e0,83589f0,8358a00,0)=SUCCESS OCIDefineByPos
Re: DBD::Oracle 10.1 client
To add more info, I was told this problem only occurs if there is only one row returned. If more than one row is returned, the arrayref is fine. I changed the selectall_arrayref to selectrow_array and the data (one row returned) was fine. I'm posting to dev as well, just in case this is a known bug. I copied the table to a 9i instance and the ran the code below, and it worked fine. So it seems to be related to 10g. Thu, 2005-10-20 at 14:07 -0500, Scott T. Hildreth wrote: I am going to investigate more, but I thought I would post the question to see if anyone has run into this problem. I have co-workers that connecting to a remote Oracle DB (10.1), I compiled DBD::Oracle 1.16 with the 10.1 client libraries. The data returned from a selectall_arrayref is 2 fields a filename and a quantity. Here is the isolated code, 286:my $load_file_ar = $dbh-selectall_arrayref(q{ 287 select FILENAME, NUM_RECORDS 288 from LOAD_DATA_SRC_FILE 289 where LOAD_ID = ? 290and DATA_UPDATE_ID = ? 291 order by FILE_ID 292 }, undef, $load_id, $update_id); $load_id = 19 $update_id = 51. ...here is the data returned. DB4 x $files_ar 0 ARRAY(0x8536328) 0 ARRAY(0x85e40e0) 0 (binary data) 1 51 what ever $update_id's value is, this is always returned in the [1] position of the the arrayref and the filename is always binary data. This works fine with sqlplus. I have tried it with Perl 5.8.[167] always the same results. The database resides on an Alpha and the clients are on Linux. Trace doesn't show anything unusual. I don't know if this is an NLS-utf8 issue. Any ideas? Thanks, STH Trace- level 9 is attached. -- Scott T. Hildreth [EMAIL PROTECTED]
Re: bind_param_inout + DBD::ODBC
DBD::DB2 (http://search.cpan.org/dist/DBD-DB2/DB2.pod) supports bind_param_inout, but it would require you to use the DB2 Connect Personal Edition or DB2 Connect Unlimited for iSeries to access iSeries from your Linux, UNIX, or Windows box. Dan On 10/12/05, Stephen More [EMAIL PROTECTED] wrote: I am currently having a problem calling a stored procedure on an iSeries. DBD::ODBC::st execute failed: [unixODBC][IBM][iSeries Access ODBC Driver]Error in assignment. (SQL-22018)(DBD: st_execute/SQLExecute err=-1) In looking through the perldoc doc for DBI I found: bind_param_inout It is expected that few drivers will support this method. The only driver currently known to do so is DBD::Oracle (DBD::ODBC may support it in a future release). Therefore it should not be used for database independent applications. Does DBD::ODBC support bind_param_inout ?? If not, how can you call a stored procedure from perl using ODBC ? -Thanks Steve More
Re: Help with DBD-DB2 and Windows...
If you're willing to upgrade to Perl 5.8.x, then you can use the latest available version of DBD-DB2 from http://ftp.esoftmatic.com/DBI/ (it's okay to install the 5.8.4 version of DBD-DB2 on Perl 5.8.7). Dan On 10/7/05, Trent Ohannessian [EMAIL PROTECTED] wrote: Hello, I currently have Perl 5.6.1 and DBD-DB2 .76 installed on my Windows NT machine and everything works wonderfully. I would like to upgrade the DBD-DB2 to .78, but am having some difficulties. I can't find a PPM repository to upgrade it, and I using the make/nmake isn't an option on our machines. Does anyone have any ideas or suggestions? Thanks! Trent -- A chicken crossing the road is poultry in motion.
Re: How to set language on DB2 on AIX
[EMAIL PROTECTED] wrote: Hello, I'm now using Perl 5.005, DBI-1.15, DBD-DB2-0.75 on AIX 4.3. And like to upgrade them to Perl 5.8, DBI-1.48, DBD-DB2-0.78. Installation may be ok, but when I INSERT double bytes characters, I get the following error. [IBM][CLI Driver] CLI0109E String data right truncation. I'm using Japanese, and 80 byes wide char strings cann't be inserted into varchar(80), current version is ok. And smaller inserted strings seem to be unicode or utf-8. Env vars related is LANG=Ja_JP only. I tried NLS_LANG=American_America.JA16SJIS, which ended failed. What is the right way to set correct language specification? NLS_LANG is the correct thing to cope with? I search dbi ML archives goole but failed to find a good answer. Regards, Hirosi Taguti [EMAIL PROTECTED] Hello: I asked one of the developers here to help me with an answer, and this is what they responded with: * varchar(80) means that it can hold up to 80 bytes of data (not 80 characters). How many actual characters are there in your 80 byte Japanese string and what are they? What is the target database codepage ? How are you inserting the data ? Without this information, it is hard to answer your question . However here are some examples/hints: If database is Unicode (UTF-8), then data will be stored in UTF-8/1208 in varchar column. If environment is set to Ja_JP(943 most likely) then data will be converted from 943 to 1208. During conversion 80 bytes of 943 could expand to more then 80 bytes in 1208 - data will not fit into varchar(80) column. It is also necessary to know what has changed in your environment. If before you had English database or Japanese database, then data will not expand and will fit. You will need to drop/recreate your database to change it's codepage. Another possibility is that you have UTF-8 data, not Japanese data, then the problem is with settings on your client - proper LANG or db2set db2codepage=1208 could be missing. It is hard to advise until we know what data you are inserting into the database, how are you doing it and database codepage you need . You need to be very clear on what codepage the data is in and how you plan to store it. I hope this helps... Dan
Re: DBD-DB2 install issue
Ah, one other _very_ likely possibility is that the user running the tests (or any other script using DBD::DB2) had not inherited the DB2 instance profile before running the tests. The DB2 instance profile sets the environment variables that enable the DB2 client to find things like libdb2.so, catalog entries for DB2 databases servers, etc. It's an important step, but it often happens automatically because the user ID used to run the DB2 application just happens to be a DB2 instance owner. For example, if you create a DB2 instance using user 'db2inst1' in /home/db2inst1, and you log in as 'db2inst1' and run the Perl script, you'll already have the DB2 instance environment set up. But if you log in as user 'daniel' on the same system and try to run the Perl script, the script will fail (usually with a helpful error like Total environment allocation error). The proper fix for this is to inherit the DB2 instance environment before running the Perl script that relies on DBD::DB2 by sourcing the db2profile script that sets all of the environment variables for the DB2 instance user, e.g. [EMAIL PROTECTED]:\ . /home/db2inst1/sqllib/db2profile [EMAIL PROTECTED]:\ perl update_database.pl I would recommend deleting /usr/lib/libdb2.so.1 and trying this approach instead, as any other libraries that DB2 depends on will not be found using your approach. Dan Alec Brecher wrote: Thank you Dan. The make ran without complaint, but the make test failed 4 of 5 tests. The first time I went ahead and installed anyway and ran a test script which completely failed. The error was that libdb2.so.1 could not be found. Based on your theory below I copied libdb2.so.1 to /usr/lib and everything is running! Not pretty but it works. Thanks so much. -Alec Dan Scott wrote: Alec Brecher wrote: My DBD-DB2 installation on Fedora Core 3 is failing because it cannot find libdb2.so.1. The Application Dev client is installed and works fine. The DB2_HOME=/home/db2inst1/sqllib I saw some post from Owen Berry on another list regarding this issue. His fix: add -Wl,-rpath,/home/db2inst1/sqllib/lib to the makefile did not work for me. DBI = 1.48 DBD-DB2 = 0.78 perl = 5.8.5 Any help would be greatly appreciated. -Alec Hi: Is the problem occurring at install time, or at run time (specifically within the context of a Web application)? If the problem is occurring at install time, please post the exact set of commands you are issuing, along with the results of running 'set', and all of the output you get from trying to compile and install DBD::DB2. If the problem is occurring within the context of a Web application where Apache seems to be dying, you need to disable SELinux (/usr/sbin/setenforce 0) as the default policies for SELinux in Fedora Core 3 / RHEL 4 prevent httpd (Apache) from loading libraries like libdb2.so that exist in non-standard locations. As libdb2.so resides in /opt/IBM/db2/V8.1/lib/ rather than /usr/lib/ , the SELinux policy believes that someone is trying to load an evil harmful library and kills the process. I wish I knew enough about SELinux policies to offer a modification that would enable libdb2.so to be loaded, but I just don't seem to have enough room in my brain... Dan
Re: DBD-DB2 install issue
Alec Brecher wrote: My DBD-DB2 installation on Fedora Core 3 is failing because it cannot find libdb2.so.1. The Application Dev client is installed and works fine. The DB2_HOME=/home/db2inst1/sqllib I saw some post from Owen Berry on another list regarding this issue. His fix: add -Wl,-rpath,/home/db2inst1/sqllib/lib to the makefile did not work for me. DBI = 1.48 DBD-DB2 = 0.78 perl = 5.8.5 Any help would be greatly appreciated. -Alec Hi: Is the problem occurring at install time, or at run time (specifically within the context of a Web application)? If the problem is occurring at install time, please post the exact set of commands you are issuing, along with the results of running 'set', and all of the output you get from trying to compile and install DBD::DB2. If the problem is occurring within the context of a Web application where Apache seems to be dying, you need to disable SELinux (/usr/sbin/setenforce 0) as the default policies for SELinux in Fedora Core 3 / RHEL 4 prevent httpd (Apache) from loading libraries like libdb2.so that exist in non-standard locations. As libdb2.so resides in /opt/IBM/db2/V8.1/lib/ rather than /usr/lib/ , the SELinux policy believes that someone is trying to load an evil harmful library and kills the process. I wish I knew enough about SELinux policies to offer a modification that would enable libdb2.so to be loaded, but I just don't seem to have enough room in my brain... Dan
Re: DB2 Err Handling
Tim Bunce wrote: On Fri, Sep 02, 2005 at 05:37:57PM -0500, johnn wrote: Capacio, Paula J wrote: my $stmt = 'select count(*) from sysibm.badTblnm '; my $sth = $dbh-prepare($stmt) or die Prepare Failed\n; DBD::DB2 doesn't seem to return false values for failures. If that's true then it's broken. It may just be that the prepare() doesn't send the sql to the server until it's execute()'d - so any sql errors won't be noticed till then. Tim -- that's exactly the case. We're using deferred prepare by default in the DBD::DB2 driver. That's quite common across many drivers (as it saves round-trips to the server) and is, I think, mentioned in the DBI docs from prepare(). If you want to disable deferred prepare, you can: * set the db2_deferred_prepare statement attribute to false * or set DeferredPrepare = 0 in your db2cli.ini file Thanks, Dan P.S. Sorry for the delay -- just sold our house and have been focused on life outside of computers for the last month or so :)