Baron Schwartz wrote:
Kemin Zhou wrote:
Hi All,
I have one of the toughest problem to solve now. I have not been
able to sleep well in the last three days.
There is a simple query
insert into table foo (column1, column2, column5)
select $col
from bar
If I run this query by hand whatever th
Kemin Zhou wrote:
Hi All,
I have one of the toughest problem to solve now. I have not been able
to sleep well in the last three days.
There is a simple query
insert into table foo (column1, column2, column5)
select $col
from bar
If I run this query by hand whatever the value of $col, it wor
At 6:54 PM -0700 6/9/07, Kemin Zhou wrote:
Hi All,
I have one of the toughest problem to solve now. I have not been
able to sleep well in the last three days.
There is a simple query
insert into table foo (column1, column2, column5)
select $col
from bar
If I run this query by hand whatever
| Hi All,
|
| I have 2 separate mysql servers and need to import data from a table on
| sever1 to
| a table on server2. This would need to be done in Perl.
|
| The script in question already has open handles to both servers, so I
| know I can
| select all the rows from server1 and process them on
George, that's probably about the easiest way you could do it in perl.
If you want every column transferred you could do a "SELECT *" instead
of enumerating columns I think.
Dan
On 9/29/06, George Law <[EMAIL PROTECTED]> wrote:
Hi All,
I have 2 separate mysql servers and need to import data f
The print string you show is:
"prepare: $insert_sql: $DBI::errstr"
but your error message is
Unable to execute query: DBI::db=HASH(0x8647df0)->errstr
I think your problem is with a print line like:
print "Unable to execute query: $dbh->errstr"
and Perl is interpolating $dbh, but n
Hi!
Am Do, den 10.03.2005 schrieb sam um 14:55:
> Hi,
>
> The perl DBI does not prints error message:
> $sth = $dbh->prepare($insert_sql)
>|| print ERRFILE_OUT "prepare: $insert_sql: $DBI::errstr";
>
> The out of this error only does not print why the error was occurred.
> eg.
> Una
On 12/6/03 8:52 AM Dan Anderson wrote:
I am using the Perl DBI to connect to a mySQL database. I am
using prepare and execute statements to send the query to the database
and then execute it. Is there any benefit to doing this versus using
do?
The O'Reilly book "Programming the Perl DBI"
"nm" <[EMAIL PROTECTED]> wrote:
>
> I can login on console. I can telnet 192.168.1.20 3306 from a remote host
> but when I try to connect using perl DBI i get this error:
>
> DBI connect('database=test;hostname=192.168.1.20','root',...) failed: Access
> denied for user: '[EMAIL PROTECTED]' (Using
> I added Host 192.168.1.10 user root with passowrd in mysql user table.
Did you flush privileges?
did you hash the password using the 'password' function?
did you type the password correctly ?
>
> Ideas? What else?
>
> Thanks.
--
hi
pls
look into "man DBI" and find there this command.
kr
mr
>>> Jeff Snoxell <[EMAIL PROTECTED]> 01/18/03 10:45 AM >>>
Hi,
just stumbled across the following piece of code:
my $rowcount = $sth->rows();
And I checked it out compared to a count of the fetched rows from an SQL
QUERY. AND It
At 9:39 + 1/18/03, Jeff Snoxell wrote:
Hi,
just stumbled across the following piece of code:
my $rowcount = $sth->rows();
And I checked it out compared to a count of the fetched rows from an
SQL QUERY. AND It matched exactly!
BUT, I can't find the command "rows()" in the DBI documentation
No conspiracy, read it again ! ;)
http://www.perldoc.com/cpan/DBI.html#rows
Joseph Bueno
Jeff Snoxell wrote:
> Hi,
>
> just stumbled across the following piece of code:
>
> my $rowcount = $sth->rows();
>
> And I checked it out compared to a count of the fetched rows from an SQL
> QUERY. AND It
I'm not sure how Perl works on variable assignment. If $sth is passing a
reference to $record finish() may kill the variable $record holds a
reference to during garbage collection. If it *assigns* the row to $record
(meaning $record holds a copy of the record data and not a reference to
where the d
== 0 or die "could not do system - $!";
open I, "<$file" or die "could not open $file - $!";
while (){
print "$_";
}
close I;
-Original Message-
From: Bernd Prager [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 2:33
Sarah Killcoyne wrote:
I need to be able to connect to mysql through a perl or C++ script without
knowing the name of the database to connect to. I can't seem to find a way
to do this. Is it possible to either: look up database names so I can pick
one before connecting or connect without a data
- Original Message -
From: "Sarah Killcoyne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 03, 2002 11:14 AM
> I need to be able to connect to mysql through a perl or C++ script without
> knowing the name of the database to connect to.
,,,
I'm not an expert om the
For Perl...
Take a look at the data_sources DBI class method
http://search.cpan.org/author/TIMB/DBI-1.32/DBI.pm#DBI_Class_Methods
or the ListDBs MetaData Method for DBD::mysql
http://search.cpan.org/author/JWIED/DBD-mysql-2.1020/lib/DBD/mysql.pod#Priva
te_MetaData_Methods
Duncan
yeah, but i was looking for a function. mostly just to see if a matching
function to dbh->tables() existed.
-Original Message-
From: Grigor, Peter [mailto:pgrigor@;aseedge.com]
Sent: Friday, November 08, 2002 10:07 AM
To: 'Shon Stephens'; '[EMAIL PROTECTED]'
Su
Of course, you could have also used:
$stmt = $db->prepare("show databases");
Peter
<^_^>
-Original Message-
From: Shon Stephens [mailto:sstephens@;corp.goamerica.net]
Sent: Friday, November 08, 2002 9:50 AM
To: Shon Stephens; '[EMAIL PROTECTED]'
Subject: RE
No clue of dbi/dbd but the query SHOW DATABASES does what it tells.
STIBS
- Original Message -
From: "Shon Stephens" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 08, 2002 3:44 PM
Subject: perl dbi and mysql question
> i am using perl dbi with dbd::mysql. i know tha
eureka! i found it!
@dbs = $dbh->func('_ListDBs');
-Original Message-
From: Shon Stephens [mailto:sstephens@;corp.goamerica.net]
Sent: Friday, November 08, 2002 9:45 AM
To: '[EMAIL PROTECTED]'
Subject: perl dbi and mysql question
i am using perl dbi with dbd::mysql. i know that using th
On Sat, Sep 21, 2002 at 02:06:01AM -0500, Kevin wrote:
> Hello, I was wondering if anyone knows PERL & DBI, if so please respond to
>[EMAIL PROTECTED] personally, or to the list
>
>
> My question is, I'm trying to build a 'custom' querier for a survey program... based
>on the information s
At 10:23 -0800 6/21/02, nellA hciR wrote:
>iH
>
>running mySQL 3.23.51, i have a my.cnf file with local-infile=1 and
>am able to use the "load data local file" command when running run
>the interactive mysql app (command line).
>
>my problem is that i can not use the "load data local" command fr
Yes.
Denny said:
> Hi,
>
> How can i use Perl DBI to create tables in mysql?
>
> Denny
>
> __
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
>
Hi Denny,
>How can i use Perl DBI to create tables in mysql?
I am not an expert in CPAN modules for Perl but I am using the DBD module
that needs DBI module for access the MySQL. Please see the man pages for DBI
module.
I am using the:
DBI-1.22
DBD-mysql-2.1017
You can installing all men
Bob,
As soon as you compiled and installed perl itself, the Config
module of perl will tell any Makefile.PL driven package where to
install itself: under the directory structure of perl.
I don't know for sure, but I suppose DBI DBD installs via
Makefile.pl script... If not, do a perl -V to see w
--
From: "Jeremy Zawodny" <[EMAIL PROTECTED]>
To: "Philip Mak" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 07, 2001 10:48 PM
Subject: Re: Perl DBI: Same column name in different tables problem
> On Fri, Sep 07, 2001 at 10:03:03PM -0700, Phil
On Fri, Sep 07, 2001 at 10:03:03PM -0700, Philip Mak wrote:
> Let's say I performed the following query using Perl DBI:
>
> $row = $dbh->selectrow_hashref(<<"~");
> SELECT fanfics.handle, authors.handle
> FROM fanfics, authors
> WHERE fanfics.aid = authors.aid
> ~
>
> I won't be able to access b
On Sat, Aug 25, 2001 at 09:24:25PM -0500, Paul DuBois wrote:
> At 10:07 AM -0700 8/24/01, Katherine Porter wrote:
> >For single values I usually use this DBI function and query:
> >
> > my $val =3D $dbh->selectrow_array("SELECT value FROM tab1 WHERE test=3D=
> >2");
> >
> >However, what if I wan
On Fri, Aug 24, 2001 at 10:07:59AM -0700, Katherine Porter wrote:
> For single values I usually use this DBI function and query:
>
> my $val =3D $dbh->selectrow_array("SELECT value FROM tab1 WHERE test=3D=
> 2");
>
> However, what if I want to store a bunch of values into an array?
>
> my @
At 10:07 AM -0700 8/24/01, Katherine Porter wrote:
>For single values I usually use this DBI function and query:
>
> my $val =3D $dbh->selectrow_array("SELECT value FROM tab1 WHERE test=3D=
>2");
>
>However, what if I want to store a bunch of values into an array?
>
> my @vals =3D $dbh->?(
For single values I usually use this DBI function and query:
my $val =3D $dbh->selectrow_array("SELECT value FROM tab1 WHERE test=3D=
2");
However, what if I want to store a bunch of values into an array?
my @vals =3D $dbh->?("SELECT value FROM tab1 WHERE test > 10");
What's the syntax
r> I was not aware of placeholders, and the benifits of using them instead of
r> using $dbh->quote(). It doesnt make sence that the DBI version of quote isnt
r> as thorough as having the code behind placeholding do it.
I'm not DBI guru but I've seen that quote() doesn't quote some data
correctly
That would not be true.
You'd receive a message stating that you had one placeholder, but you
were passing 3 arugments, and it script would die on the error.
havoc
ryc wrote:
>
> I was not aware of placeholders, and the benifits of using them instead of
> using $dbh->quote(). It doesnt make se
I was not aware of placeholders, and the benifits of using them instead of
using $dbh->quote(). It doesnt make sence that the DBI version of quote isnt
as thorough as having the code behind placeholding do it. But anyhow, I have
a few questions as to how this works. Here is an example from the Per
r> Seems that you are not taking advantage of Perl. This is what you can do:
No, he is taking advantage of placeholders. It is much better to use
placeholder for value substitution that substitute values directly
into query with Perl because there is no need to escape values (do you
know that $d
Seems that you are not taking advantage of Perl. This is what you can do:
$parentid = x;
$orderby = 'DESC';
my $sth = $dbh -> prepare (qq{
SELECT message.name, contents, user.name, message.id
FROM message, user
WHERE folder='N' and parentid=$parentid
GROUP B
Simple answer: you can't do that.
The ? is only for WHERE parameters. You need to have two differnt queries
(or one query, and concatanate the desired sort command).
j- k-
On Monday 09 July 2001 21:13, havoc wrote:
> I'm having some trouble passing some information from my Perl script
Your inner loop usage of $sth overwrites the result set of the outer loop.
Use a different variable.
Hannes Niedner wrote:
> I am having trouble with DBI. I wrote a little script that should update
> fields in one table (uid_test) based on values in another table (merge). I
> updates one row and
Just if somebody is interested:
I solved the mystery with Error 19. All I needed to do was introducing a
second statement handle for the update query.
(BTW, the script runs probably faster using '$sth = $dbh->do' instead of
'$sth = $dbh->prepare', followed by '$sth = $dbh->execute').
Hannes
O
TEG> Batara Kesuma <[EMAIL PROTECTED]> writes:
>> Hello,
>>
>> I think it might not be a right mailing list for this question, but I
>> don't know where else should I post it.
>>
>> If I run Perl DBI's $dbh->connect() without $dbh->disconnect(), MySQL (or
>> is it the Perl DBI module) will run
At 12:17 PM -0400 6/22/01, Trond Eivind Glomsrød wrote:
>Batara Kesuma <[EMAIL PROTECTED]> writes:
>
>> Hello,
>>
>> I think it might not be a right mailing list for this question, but I
>> don't know where else should I post it.
>>
>> If I run Perl DBI's $dbh->connect() without $dbh->disconne
Batara Kesuma <[EMAIL PROTECTED]> writes:
> Hello,
>
> I think it might not be a right mailing list for this question, but I
> don't know where else should I post it.
>
> If I run Perl DBI's $dbh->connect() without $dbh->disconnect(), MySQL (or
> is it the Perl DBI module) will run rollback()
pect an error back from mysql on connection...
- Original Message -
From: "John Tsangaris" <[EMAIL PROTECTED]>
To: "Eric Fitzgerald" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 16, 2001 4:46 PM
Subject: RE: Perl DBI
> Hi, Eric.
&g
l without connecting to a database?
John
-Original Message-
From: Eric Fitzgerald [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 16, 2001 1:21 PM
To: John Tsangaris; [EMAIL PROTECTED]
Subject: Re: Perl DBI
Connect to the mysql database if you have access. It always exists.
- Original
Connect to the mysql database if you have access. It always exists.
- Original Message -
From: "John Tsangaris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 16, 2001 1:58 PM
Subject: Perl DBI
> Is it possible to connect to mysql without connecting directly to a
>
47 matches
Mail list logo