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
/
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
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
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
/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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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)
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 ,
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
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
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
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
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
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
36 matches
Mail list logo