Sureshkumar M (HCL Financial Services) schreef:
Can someone help me on this
Impossible.
--
Affijn, Ruud
Gewoon is een tijger.
Hendrik Schumacher schreef:
To avoid painful quoting the mysql reference manual suggest binding
the value like this:
$sth = $dbh-prepare (select name from toolbox where name LIKE
CONCAT('%', ? ,'%'));
That has issues similar to REGEXP, because the value can contain
LIKE-wildcards such as %
Bruce Johnson schreef:
I'm trying something along the lines of:
insert into foo(fname, lname, phone, dateadded, status, datemodified)
values (?,?,?,curdate(),1,curdate())
and it's failing saying I have an sql error at ...curdate().
DBD::mysql::db do failed: You have an error in your SQL
Jeffrey Seger schreef:
Are you using do() instead of prepare()? Placeholders go into with
prepared statements, not immediate executions.
See the DBI documentation:
do
$rows = $dbh-do($statement) or die $dbh-errstr;
$rows = $dbh-do($statement, \%attr) or die
Derek Jones schreef:
All of the common languages suffer from rounding problems inherent in
IEEE rounding (round-to-even and other issues). Math::Round resolves
these issues.
If you don't round to even (and your numbers are of the same sign), then
the totals of the original values and the
Archon810 schreef:
So I've been tracing this extremely weird segfault in my code for
about half a year now mostly due to the evasive nature of the crash
and finally traced it down to these specific steps:
- perl 5.10 (happened in 5.8 too)
- DBI 1.605
- DBD::mysql 4.007
- $dbh =
Colin Wetherbee schreef:
my $sql = q(SELECT departure_date, eq.name AS equipment,
dp.full_city AS departure_city, ap.full_city AS arrival_city,
ca.name AS carrier_name, number
FROM jsjourneys
FULL OUTER JOIN jscarriers AS ca ON jsjourneys.carrier = ca.id
FULL
Carville, Stephen schreef:
and c.certcrtdate = to_date('%s','MM-DD-')
Aaargh, you should always use '-MM-DD'.
--
Affijn, Ruud
Gewoon is een tijger.
Paul DuBois schreef:
mmccaws2 wrote:
can I set an option so that when auto_increment reaches it's maximum
integer value, it will start all over at zero. I'm deleting every 15
minute the earlier entries, so I'm not too worried about the table
growing too large. Can mysql be set to roll
I have no idea about why the query with the utf8-upgraded name-value
takes so much longer.
In your code there is:
my @cred = split(/[\s\n]+/, $line);
which I think is better written as
my @cred = split ' ', $line;
--
Affijn, Ruud
Gewoon is een tijger.
Peter J. Holzer [EMAIL
Mathew Delong schreef:
I am calling into a Perl script from a Java class to retrieve
information from a database, and am interested in using DBI for the
connection. However, the Java class calling into the perl script will
already have an established JDBC connection to the database, and I
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.
That instruction doesn't guarantee that the new table has the same
structure.
H.Merijn Brand schreef:
2007-05-31 0.27 - H.Merijn Brand [EMAIL PROTECTED]
* checked with perlcritic (still works under 5.00504)
so 3-arg open cannot be used (except in the docs)
* 3-arg open in docs too
* Added a lot to the TODO list
* Some more
I created a quick-fix to get rid of the error about the quoted
LIMIT-value, but I assume this must have been solved in better ways. The
fix below is easy to enhance to also cover the LIMIT ?,? variant, but
I would rather see a cleaner approach. Does it exist already?
#!/usr/bin/perl
use strict;
Stephen Carville schreef:
When I make a call to an Oracle 10g database using DBI and SQLRelay
(for connection pooling) I seem to get results from the previous
SELECT.
For example, If I send the following:
select a.statid, b.webstatdesc, a.pendid, c.penddesc,
a.certno,
Stephen Carville schreef:
Dr.Ruud:
The tranid and certno in your where don't have table
identifiers. If you assume that the result is one record, check for
more.
I didn't know that dropping the table ids could make a difference.
I'll try adding them. Thanks.
They shouldn't make
John Scoles schreef:
As execute_array is normally use to inserts/update of millions of
records and with this volume you would not want your process to choke
on just one bad record
Huh? It is fine if you can deliberately turn it off, but by default such
a feature should abort and roll back.
Joseph Lamb schreef:
s.shipdate
snip
TO_CHAR(SHIPDATE, 'MMDDYY') = TO_CHAR(SYSDATE-21, 'MMDDYY') and
Maybe you need to replace SHIPDATE by s.shipdate?
--
Affijn, Ruud
Gewoon is een tijger.
Making DBI/DBD scripts portable
http://www.xs4all.nl/~hmbrand/dpws2006/
as presented at the
Dutch Perl Workshop 2006
http://workshop.perlpromo.nl/
--
Affijn, Ruud
Gewoon is een tijger.
Garrett, Philip:
Mark Galbreath:
I searched all night and cannot find an example of how to do this
correctly. Capture the table dump's STDOUT with IO::Pipe somehow? The
documentation of IO::Pipe is pretty sparse. Any suggestion is greatly
appreciated.
This should do it:
use IO::Handle;
Ron Savage schreef:
Dr.Ruud:
So we're back at:
/\A(?:mysql|pg)\z/i
/\A(?i:mysql|pg)\z/
[db_vendor()]
In the case of 'DBI DSN' = 'dbi:Pg:dbname=staff', I store 'Pg'.
In the case of 'DBI DSN' = 'dbi:ODBC:pg-staff', I store 'Pg'.
[...]
if ($self - db_vendor() =~ /(?:mysql|Pg
Ron Savage schreef:
o Fell free to donate large quantities of money to the
Perl DBI Development Fund, at (watch wrap):
https://donate.perlfoundation.org/index.pl?node=Fund%20Drive%20Statusselfund=10
2
That is really a nasty wrap: the 10 in stead of 102 hides the DBI
Development Fund.
This
Ron Savage schreef:
[attribution repaired] Ruud:
[attribution repaired] Ron:
[attribution repaired] Ron:
Nope. Method db_vendor() extracts the vendor's name from the
connect string passed to DBI, so I don't see how it could return
that :-))).
And anyway, I control the config file this
Ron Savage schreef:
Dr.Ruud:
[ /mysql|Pg/ ]
Notice that 'CertainlyNotPgAtAll' matches, so maybe you were
looking for /\A(?:mysql|pg)\z/i
Nope. Method db_vendor() extracts the vendor's name from the connect
string passed to DBI, so I don't see how it could return that :-))).
Is it legal
Ron Savage schreef:
sub last_insert_id [...]
if ($self - db_vendor() =~ /(?:mysql|Pg)/)
That regex can be written as /mysql|Pg/.
Notice that 'CertainlyNotPgAtAll' matches, so maybe you were looking for
/\A(?:mysql|pg)\z/i
MySQL's native LAST_INSERT_ID() will return the *first* id from a
Jeffrey Seger schreef:
Dr.Ruud:
JupiterHost.Net:
Dr.Ruud:
Jeffrey Seger:
perl -MData::Dumper -e' print Dumper @INC'
Alternative:
perl -MData::Dumper -e' print Data::Dumper-Dump([EMAIL PROTECTED],
[qw(*INC)])'
Oi, why not much cleaner (code and output):
perl -MData::Dumper -e
Jeffrey Seger schreef:
Ok, you're right. Let's stop now as we are not adding to anyone's
knowledge of DBI or DBD::*.
You keep messing up, so I'll see no more of you.
here were 30+ lines that you should have cut
--
Affijn, Ruud
Gewoon is een tijger.
JupiterHost.Net schreef:
Dr.Ruud:
Jeffrey Seger:
perl -MData::Dumper -e' print Dumper @INC'
Alternative:
perl -MData::Dumper -e' print Data::Dumper-Dump([EMAIL PROTECTED],
[qw(*INC)])'
Oi, why not much cleaner (code and output):
perl -MData::Dumper -e' print Dumper [EMAIL PROTECTED
Jeffrey Seger schreef:
perl -MData::Dumper -e' print Dumper @INC'
Alternative:
perl -MData::Dumper -e' print Data::Dumper-Dump([EMAIL PROTECTED],
[qw(*INC)])'
--
Affijn, Ruud
Gewoon is een tijger.
Louis Gonzales schreef:
As far as I know, MSAccess is an application
and doesn't have the robustness of a Database Server
There is MsAccess and there is the Jet-Engine/Desktop-Engine.
See also the content and links on:
http://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine
--
Affijn,
Paul DuBois schreef:
UPDATE tbl_name SET col_name = 0 WHERE col_name = 0;
If you've selected the rows-changed count, $sth-rows() will always
return 0, because the statement doesn't actually change any col_name
value from its current value.
That would be an odd optimization. The update
31 matches
Mail list logo