Re: perl is not working after migrating the server to AIX 7.2

2022-02-16 Thread Fennell, Brian
When I get errors from CPAN I usually switch to whet or curl to get the package them make ; make all and make test ; make install. You could also try cpanm and see if it gives you better error messages - if you are building binary packages you May need a c compiler - easy with Linux - may be

RE: [EXTERNAL] Re: select decimal column from mysql

2021-12-20 Thread Fennell, Brian
/ https://perldoc.perl.org/perlapi https://perldoc.perl.org/perlembed https://perldoc.perl.org/Devel::Peek https://www.nntp.perl.org/group/perl.perl5.porters/2015/11/msg232974.html -Original Message- From: Fennell, Brian Sent: Monday, December 20, 2021 10:14 AM To: john miky ; dbi-users

RE: [EXTERNAL] Re: select decimal column from mysql

2021-12-20 Thread Fennell, Brian
Variables in perl are “untyped” or better yet “dynamically typed”. Every variable is a string but will behave like a int or float in the right context. Conversions from string to int to float and back to string happen automatically and silently. This may be surprising and confusing if you are

RE: Strange issue with inserting varchar2()

2021-05-27 Thread Fennell, Brian
One more https://stackoverflow.com/questions/1454952/dummys-guide-to-unicode The information contained in this electronic mail transmission is intended only for the use of the individual or entity named in this transmission. If you are not the intended recipient of this transmission, you

RE: Strange issue with inserting varchar2()

2021-05-27 Thread Fennell, Brian
/pod/perlunifaq.pod https://metacpan.org/pod/distribution/perl/pod/perlunifaq.pod -Original Message- From: Fennell, Brian Sent: Thursday, May 27, 2021 8:10 PM To: Bruce Johnson ; dbi users Subject: [EXTERNAL] RE: Strange issue with inserting varchar2() UTF-8 has a variable number

RE: Strange issue with inserting varchar2()

2021-05-27 Thread Fennell, Brian
UTF-8 has a variable number of bytes per character. Some encodings have 1 byte per character always. Some encodings have two bytes per character always. Assuming that the number of bytes is the same as the number of characters sometimes leads to wrong answers. When you are using perl as a

Re: [EXTERNAL] Re: DBI.pm - Memoryfault(coredump)

2020-10-26 Thread Fennell, Brian
I think the following links should cover all the pieces needed for Perl/JDBC/Oracle https://www.oracle.com/database/technologies/appdev/jdbc.html https://metacpan.org/pod/distribution/DBD-JDBC/JDBC.pod https://sdkman.io/ Perl can launch the java server using qx: https://perlmaven.com/qx This

Re: [EXTERNAL] Re: DBI.pm - Memoryfault(coredump)

2020-10-26 Thread Fennell, Brian
Also consider switching to the JDBC module and using the Oracle JDBC driver. The JDBC driver requires launching a Java server which perl accesses via sockets which is available from CPAN but is not simply a drop in replacement for other DBI / DBD modules. I had to downgrade both perl and

Re: DBD::Oracle 1.80 & Oracle client 19c Segfaults on Destroy

2020-06-23 Thread Fennell, Brian
Another idea . . . You could also wrap Oracle SQLPlus in perl using qx How-to SQLPLUS and XML here: https://asktom.oracle.com/pls/apex/f?p=100:11:0P11_QUESTION_ID:3512822500346787661 That and a little perl text parsing could get you a long way - split , grep, map, s and tr. This

RE: [EXTERNAL] Re: DBD::Oracle 1.80 & Oracle client 19c Segfaults on Destroy

2020-06-22 Thread Fennell, Brian
FYI The Oracle DBD driver is hard to build, it requires Oracle C Libraries and Header files. It also requires Oracle Development files described by Oracle as Examples, but which are really templates for building any C client. All Oracle C Clients are hard to build. If I recall sometimes a

RE: [EXTERNAL] PERL - DBI MODULE

2020-06-04 Thread Fennell, Brian
DBI is an interface. It isn’t really meant to be used without some kind of a database / DBD driver behind the interface. The following are simple and do not require a lot of other things to be installed: https://metacpan.org/pod/DBD::Mock https://metacpan.org/pod/DBD::Mem

RE: [EXTERNAL] PERL - DBI MODULE

2020-06-04 Thread Fennell, Brian
For further reading: https://metacpan.org/pod/DBI::DBD These links may help as well: (You can compare perl to other programing languages you may already know) https://rosettacode.org/wiki/Table_creation https://rosettacode.org/wiki/Table_creation/Postal_addresses

RE: Perl script excessively executing statement

2020-02-18 Thread Fennell, Brian
John, The part of the story that troubles me is this: "it was working fine - nothing changed - then it broke". It is the middle part - something must have changed. If I were in your shoes I would be looking for the "what changed". I had a piece of perl / Oracle code break when we upgraded the OS.

RE: Perl script excessively executing statement

2020-02-14 Thread Fennell, Brian
John, One way for you to execute sql thousands of times from perl is to do it in your loop. The other way is for the Oracle server to do it for you in its loop. Sometimes an Oracle Upgrade will cause the Oracle Optimizer to change - this can cause SQL that "worked fine" to start behaving

RE: Perl script excessively executing statement

2020-02-13 Thread Fennell, Brian
If you are trying to execute one SQL statement against the database for each loop iteration – you are doing it wrong. You are adding a round trip for every row which will be slow for the client and waist time and other resources on the server. Look on the net for other approaches using NVL and

RE: Translate between DBI and SQL

2019-02-11 Thread Fennell, Brian
P.S. This may also help: http://www.dispersiondesign.com/articles/perl/perl_escape_characters Short answer: Use single-quoted strings whenever possible - they have the fewest characters to escape - only backslash and single quote - and you can escape both by preceding with a backslash. Use

RE: Translate between DBI and SQL

2019-02-11 Thread Fennell, Brian
P.P.S. My last answer used single-quote for a column with a space in it in PostgreSQL - this is wrong, it should have been a double-quote for the name of the column with a space and a single quote for a quoted string literal in PostgreSQL. Better example: (Adapted from answer to question here

RE: Translate between DBI and SQL

2019-02-11 Thread Fennell, Brian
Mike, If you have a complete example of what you are starting with and what you want to end up with your question would be clearer. If I understand you correctly: You start with raw SQL such as you might enter into a Postgres command line tool (for example psql). What you want is the equivalent

RE: Generic way of fetching a list of databases

2018-11-19 Thread Fennell, Brian
If you like you can review the "data_sources" subroutine defined here: https://metacpan.org/pod/DBI If you find the completely Generic way to list databases Lacking - here are few particular solutions: In Particular for PostgreSQL: This lists databases: SELECT datname as database FROM

RE: Generic way of fetching a list of databases

2018-11-16 Thread Fennell, Brian
Closest thing that I know of is INFORMATION_SCHEMA and the INFORMATION_SCHEMA.TABLES pseudo table. INFORMATION_SCHEMA is a standard across many databases. One Database that doesn’t comply is Oracle (but it can be installed by the DBA as an Add-on) for Oracle select from ALL_TABLES (or

RE: Tim Bunce - RE: DBD-DBI Insert Binary Files and using Perl modules in cPanel environment

2018-09-28 Thread Fennell, Brian
Correction: MYSQL uses "BIGINT" (or another type with "INT" in its name) where Oracle uses NUMBER. https://docs.oracle.com/cd/E12151_01/doc.150/e12155/oracle_mysql_compared.htm#BABHHAJC The rest of what I said still stands (I think). YMMV The information contained in this electronic mail

RE: Tim Bunce - RE: DBD-DBI Insert Binary Files and using Perl modules in cPanel environment

2018-09-28 Thread Fennell, Brian
If you encode your binary data as pure ascii, in and out, any database will do just fine. Encodings to consider are mime-64 (https://metacpan.org/pod/MIME::Base64) and q-encoding (https://en.wikipedia.org/wiki/Quoted-printable ) - both are lossless and can store any binary data. Hexadecimal

RE: debugging and stepping into ->do

2018-04-25 Thread Fennell, Brian
Jeff, Sorry if I was telling you something you already knew. I do that sometimes – I am a computer geek and sometimes my social skills are lacking. All the best in your XS hacking. It looks to me that this is actually documented behavior (if you know that the documentation is on the DBI

RE: (Fwd) Perl with Oracle 12c

2018-04-10 Thread Fennell, Brian
DBD::Oracle is hard to build from source . . . just went thru this. If you don't build from source it may not be compatible with your Oracle shared libraries, OS Shared libraries or Oracle Server. Consider carefully Oracle client and server characterset (and Perl characterset, and OS

RE: Hunting down (possible) memory leak in DBD::Oracle

2018-01-16 Thread Fennell, Brian
stopher Jones [mailto:christopher.jo...@oracle.com] Sent: Monday, January 15, 2018 6:56 PM To: dbi-users@perl.org Subject: Re: Hunting down (possible) memory leak in DBD::Oracle On 16/1/18 9:17 am, Fennell, Brian wrote: > $ egrep -B1 -A20 -i 'invalid write' > /copy/sandbox/feeds/data/se

RE: Hunting down (possible) memory leak in DBD::Oracle

2018-01-15 Thread Fennell, Brian
I got this case running with valgrind - Valgrind reported - 8 invalid writes, 8 invalid writes, 2239 accesses to uninitialized values. All invalid writes have a stack trace leading back to XS_DBD__Oracle__st_fetchrow_array (Oracle.xsi:662) and ora_st_fetch (oci8.c:4032) Details follow: export

RE: Hunting down (possible) memory leak in DBD::Oracle

2017-12-20 Thread Fennell, Brian
John, Thanks for your incites. I tried what you said. I read up on NVARCHAR2 v VARCHAR2 - interesting.  I also see that Oracle has a way (more than one way) to specify if a VARCHAR2 should contain bytes or characters - further while a VARCHAR2(11 byte) and a VARCHAR2(11 char) are different

RE: Hunting down (possible) memory leak in DBD::Oracle

2017-12-19 Thread Fennell, Brian
And, also with the log level set to 15 here are the LAST 200 lines 3abd340 (field=0): '1127646' field #2 with rc=0(OK) 3abd340 (field=1): '1268251' field #3 with rc=0(OK) 3abd340 (field=2): 'a...' field #4 with rc=0(OK)

RE: Hunting down (possible) memory leak in DBD::Oracle

2017-12-19 Thread Fennell, Brian
With the log level set to 15 here are the first 200 lines of log AAA::DBI::Connection::db=HASH(0x3abce00) trace level set to 0x0/15 (DBI @ 0x0/0) in DBI 1.637-ithread (pid 12594) -> STORE for DBD::Oracle::db (AAA::DBI::Connection::db=HASH(0x3abce00)~INNER 'RowCacheSize' 2097152)

RE: Hunting down (possible) memory leak in DBD::Oracle

2017-12-19 Thread Fennell, Brian
John, Thanks for the ideas to change the cache params - I will try that! Here is the SQL and the field types: SELECT d.ROW_NUMBER, d.f1, d.f2, d.f3, d.f4, d.f5 FROM ( SELECT /*+ FULL(A) PARALLEL(A 6) */ rownum ROW_NUMBER, A.field1 f1 ,

RE: Hunting down (possible) memory leak in DBD::Oracle

2017-12-18 Thread Fennell, Brian
Pluta, Looks like it is worth a try - when I looked at the project before it looked like it was for installing a "per user" perl. Does it work for root / all users on a box as well? Brian

RE: Hunting down (possible) memory leak in DBD::Oracle ** EXTERNAL **

2017-12-18 Thread Fennell, Brian
Good question - I have asked DBA and am waiting for a reply. -Original Message- From: Howard, Chris [mailto:howa...@prpa.org] Sent: Monday, December 18, 2017 11:36 AM To: Fennell, Brian <fenne...@radial.com>; dbi-users@perl.org Subject: RE: Hunting down (possible) memory leak

RE: Hunting down (possible) memory leak in DBD::Oracle ** EXTERNAL **

2017-12-18 Thread Fennell, Brian
Ok . . . I am already benefiting from the support from this list : - ) I noticed that I was actually ordering my query BY rownum (which doesn't make much sense . . . and perhaps oracle's optimizer recognized this and ignored the pseudo column.) Just to be sure, I change the query and then

RE: Hunting down (possible) memory leak in DBD::Oracle

2017-12-18 Thread Fennell, Brian
John, Thanks so much for your reply! I have put off this work for a few years and now the pressure is on - the original box and OS are so old that the DBA and System Engineer and the Operations manager have all ganged up on me. I suppose I could try and work around by downgrading both the perl

RE: Hunting down (possible) memory leak in DBD::Oracle ** EXTERNAL **

2017-12-18 Thread Fennell, Brian
umber >= 100 -Original Message- From: Howard, Chris [mailto:howa...@prpa.org] Sent: Monday, December 18, 2017 9:21 AM To: Fennell, Brian <fenne...@radial.com>; dbi-users@perl.org Subject: RE: Hunting down (possible) memory leak in DBD::Oracle ** EXTERNAL ** Same database... do

Hunting down (possible) memory leak in DBD::Oracle

2017-12-16 Thread Fennell, Brian
Dear DBI people - I am trying to port some old perl code to a new box. (see Details below) Needless to say the original box and code works fine, but the new box (and old code) does not. Specifically what I am seeing is that when I select slightly over a million records from a specific join