Somthing like
my $block_count = 0;
while() {
$block_count++ if /[bB][eE][gG][iI][nN]/;
s/;//g if $block_count == 0;
$block_count-- if /[eE][nN][dD];/;
print;
}
should remove your colons, assuming that BEGIN and END lines have no other
commands, and there are no colons in strings
On Wed, Jun 13, 2001 at 07:06:55PM -0400, Philip Mak wrote:
> I've been experimenting with a programming technique idea I had that I
> call "Object Oriented Databases". The goal of the technique is to make
> programming database driven websites easier by allowing the website code
> (I use Apache::
On Thu, Jun 14, 2001 at 03:16:05PM -0700, traja wrote:
> How do I get the headers (column names) when I do a select thro' DBI.
> fetchrow will fetch only the data. I need to display the headers as
> well.
>From the DBI perldocs:
NAME (array-ref, read-only)
Returns a reference
I've sorted the problem, this is a bit obscure and is one of those
irritating obvious things... A bit more background is required
The box mysql is running on used to be a linux box but was moved to freebsd
with the compatability libraries etc.
After this was done everything, including mysq
Hi guys,
I have a problem with compling, he can not find a module.
Is it because I installed the DBD::Oracle 1.06 wrong or something
else?
error message:
install_driver(Oracle) failed:
\Can't locate loadable object for module DBD::Oracle in @INC
(@INC contains: /opt/perl5/lib/5.6.0/PA-RISC1.1
Try reinstalling. Did you get errors when installing? Do you have another
perl installation that this could of been installed with. Your @INC does
not contain the necassary info, you can try pushing the necessary dir into
it, but that should of been done when you installed perl, unless DBD::Ora
Hello,
I'm trying to fetch data from 2 stored procedures one after
another and i'm getting weird error message when it start to
fetch from second one. Here is a code snippet
my $sth1 = $dbh->prepare("call sp_Get_Buildings()");
$sth1->execute();
my $
Hi,
Do you know what I do wrong?
The installation details you can found below.
I will appriciate every information.
Thanks.
Environment:
OS: HP-UX 11
Oracle: 8.1.6.1
Perl : 5.6
C-compiler: B3901BA B.11.01.06 HP C/ANSI C Developer's Bundle for
HP-UX 11.00 (S800)
INSTALL
Search for Oracle.pm file then print out @INC and see if the @INC contains
that directory.
Also, though this is not a problem at this time, but
my($db_type, $db_name, $hostname, $port, $dbh, $sth,$user,$passwd);
$db_type = 'Oracle';
$db_name = 'rdw';
chop($hostname = 'gcclo19');
##What doe
Hi all
Just thought I'd let you know about a gotcha when using ODBC (and ADO I
think)
to connect to Microsoft Sqlserver. I now highly recommend having:
SET NOCOUNT ON
as the first statement in all your stored procedures.
I had a cursor inside a stored procedure that ran correctly from isqlw bu
Subject: Announcing DBD::LDAP!
Greetings,
I am proud to release the 3rd alpha version of DBD::LDAP to CPAN!
This module is designed to allow one to access LDAP (Lightweight Directory
Access Protocol) databases using traditional SQL and Perl and DBI. It is
hoped that someone (besides me) w
Hello Jones,
Friday, June 15, 2001, 5:54:56 PM, you wrote:
Yep, but i already wrote about this as an unsuitable
solution, cos in real project i have to prepare all
$sth's and only then do smth with them.
JRC8CS> Will this work if you change the order
Additionally, use SET NOCOUNT ON if you plan on using temp tables inside
stored procedures!
Basically what this option (NOCOUNT) does is turn off the message returned
at the end of each statement that states how many rows were affected by the
statement.
-Original Message-
From: [EMAIL P
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 15, 2001 3:49 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: AW: Help with semi colons and Oracle blocks through dbi
>
>
> Somthing like
>
> my $block_count = 0;
> while() {
>
Hi
When I tried to execute the perl program, I got the following error message.
Could anyone help?
Thanks
Jenny
Error message:
Can't locate DBI.pm in @INC at c:\hcis_conversion\conversion_hms_2.1.6.pl.
I found the file Oracle.pm, I think I have a problem now.
$ ls
ADO.pm
Multiplex.pm
Oracle.pm
Sponge.pm
ExampleP.pm
NullP.pm
Proxy.pm
$ pwd
/opt/perl5/lib/site_perl/5.6.0/PA-RISC1.1/DBD
@INC contains:
/opt/perl5/lib/5.6.0/PA-RISC1.1
/opt/perl5/lib/5.6.0
DBI needs to be installed. If you think it is installed, it needs to
be in the @INC path.
Run a program and 'print join(":", @INC)'. Is DBI.pm in any of those
directories? No? Where is it? Maybe you can 'use lib
qw(/directory/where/DBI.pm/is/);'
but its better if DBI is installed correctly.
And
Means you don't have DBI installed or your perl installation is broken or
DBI pm was installed under a different perl installation than is used to run
this script.
Ilya
-Original Message-
From: Liu, Jenny
To: 'dbi '
Sent: 06/15/2001 9:42 AM
Subject: DBI.pm eror
Hi
When I tried to execu
chop is used to chop of a character
$username = "isterin";
chop($username);
print $username;
Will print "isteri".
It might of had a purpose in the Cheetah book, but not necessarly in your
case. Your @INC looks fine, I would recommend reinstalling Perl, since the
installation might be broken, a
Hello all,
I'm just new to DBI, it's my first working DBI script so please don't laugh too hard
at me. The script below works fine (AFAIK) but is slow - inserting 10 records into
the table takes ~1 hour 20 minutes. I think that's because I placed $sth =
$dbh->prepare in the while loop insi
Hi greg,
This should speed it up:
Take the "my $sth = $dbh->prepare("INSERT INTO edi_pad (@names) VALUES
('$customer','$upc','$upc_itemlist{$upc}','$sdq[$i]','$za01','$sdq[$i+1]','$
xq02','$xq03')");" line outside the while loop and replace it with :
my $sth = $dbh->prepare("INS
You should use placeholders, so place your prepare() outside of the loop and
see docs on how to use placeholders. This will speed it up definitelly, but
I think you have a bigger problem that this. 1 hour and 20 minutes is
hirrible. Are you sure it's inserting takes that long, write a small scr
It's much faster (usually) if you prepare once using placeholders
and execute using bind parameters.
As a psuedo-code example;
my $sql = "INSERT into FOO (name, address, phone) VALUES (?, ?, ?)";
my $sth = $dbh->prepare($sql);
my ($name, $address, $phone);
while (;
$sth->execute($name, $
Here are a few ways you can speed it up:
1. Read the placeholder info from the other posts.
2. Writing 10 records out to a file and then reading them back in is
likely to take a lot of time. Is there a reason why the first two while
loops can't be just one while() loop? And do you really
Many, many thanks for all of you - I'm going to use your expertise right now.
Greg
>>> "Greg Wardawy" <[EMAIL PROTECTED]> 06/15/01 11:33AM >>>
Hello all,
I'm just new to DBI, it's my first working DBI script so please don't laugh too hard
at me. The script below works fine (AFAIK) but is slow
Thanks a lot. It's much better now - inserting 100K records takes just 26 min.
Greg
>Writing 10 records out to a file and then reading them back in
>is likely to take a lot of time
Depends on what you mean by a lot of time. It will take more time than
inserting 10 records, but definitelly shouldn't take 1 hour and 20 minutes.
I think there are bigger problems non DBI relate
What exactly did you change. Just used placeholders? If yes, we can use
this as an example for anyone else here, since this is a tremendous time
change.
Ilya
-Original Message-
From: Greg Wardawy
To: [EMAIL PROTECTED]
Sent: 06/15/2001 12:32 PM
Subject: Re: How can I speed it up?
Thank
I'm helping a co-worker debug some code, and I can't figure out
what is going on. I hope someone can shed some light on it.
This is perl, version 5.005_02 built for alpha-dec_osf
DBI 1.14
Msql-Mysql-modules-1.2217.tar.gz
Basically, He calls a subroutine that evals the execute
and checks $@.
Just looked over the Programming the Perl DBI and wasn't able to find any
info on nesting tranactions in DBI.
I guess my questions are
a. can it be done
b. if so, how
Thanks
--
|| James Maes
|| Senior Programmer
|| [EMAIL PROTECTED]
|| The
Well depending on why it is failing. You error message does not provide any
help. Try using $DBI::errstr in it and also use trace() at level 2 (see
docs). You can then submit both to us if you can't figure out yourself.
Ilya
-Original Message-
From: Scott T. Hildreth
To: [EMAIL PROTEC
Is there any DBI/ODBC/ADO module(s) that will allow me to access "Lotus
Notes" Databases using PERL scripts
Thanks in advance
Pat
Sorry I should have mentioned that I did Trace it,
I traced one of the Statement Handles as well as the
Db Handle, it shows the Duplicate Error being returned
but nothing else,
ERROR EVENT 5 'Duplicate entry '2067258104' for key 1' on
DBI::st=HASH(0x14037fa50)
Duplicate entry '2067258104' fo
On Fri, 15 Jun 2001 14:20:28 -0500 (CDT), "Scott T. Hildreth"
<[EMAIL PROTECTED]> wrote:
It appears that you are attempting to enter data to a column that has possible
reached it's max size. What type of column type is the duplicate entry referring
too??
>>Sorry I should have mentioned that I
This is kind of a cop out, but I think you'd be better off fixing your
database to match what your program expects than to change your program to
deal with incomplete data in the database. Or you could just check if
things exist before inserting them. I think you are getting into some messy
stuf
Yes, using placeholders dramatically increased the speed. I had no time to apply and
test all Mitch's suggestions except optimizing the regex and moving 'no warnings'
outside the loop but I'm working on it. Strange, inserting 100K records with
placeholders and 'no warnings' outside the loop ta
t
This is what I'm looking for. My point about the
foreach/fetchall_arrayref was only to indicate my
limited experience using fetchall_arrayref. That's the
only programming context in which I've used it. I
suspected there was a way to do what I wanted and I
thought fetchall_arrayref was possibly
As mentioned the other day, another time factor on inserts is how
you commit. The default AutoCommit is often expensive; but you
also don't want to go the extreme other end and commit only at the
end. I often use counters and tune the commits to N lines; where
I find a value for N that's optim
It is updating data, the duplicates come from running again.
Will get so far then it dies. When I took out the eval from
the one function, it stopped dieing there. He has numerous code
changes/fixes to make. He was reusing a global $sth for every
handle, preparing everytime in a loop...etc.
I'm having troubles compiling DBD-Oracle-1.07 with Oracle 8i EE for NT. I'm
using cygwin with perl 5.6.1. DBI-1.18 compiled and install OK except for
the RPC stuff which I don't think I need.
perl Makefile.PL runs OK...
{MPI1:22} make realclean
{MPI1:23} perl Makefile.PL
Using DBI 1.18 installed
40 matches
Mail list logo