Re: perl DBI does not do execute mysql statement

2007-06-11 Thread Kemin Zhou
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

Re: perl DBI does not do execute mysql statement

2007-06-09 Thread Baron Schwartz
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

Re: perl DBI does not do execute mysql statement

2007-06-09 Thread Paul DuBois
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

Re: perl/dbi - insert into server2.db2.table2 select * from server1.db1.table1

2006-09-29 Thread dpgirago
| 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

Re: perl/dbi - insert into server2.db2.table2 select * from server1.db1.table1

2006-09-29 Thread Dan Buettner
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

RE: Perl DBI does not print error.

2005-03-10 Thread John Trammell
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

Re: Perl DBI does not print error.

2005-03-10 Thread Joerg Bruehe
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

Re: perl DBI vs. prepare and execute do

2003-12-06 Thread Joakim Ryden
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"

Re: PERL DBI DBD mysql / REMOTE ACCESS

2003-10-30 Thread Egor Egorov
"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

Re: PERL DBI DBD mysql / REMOTE ACCESS

2003-10-30 Thread Johannes Ullrich
> 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. --

Re: Perl DBI secret command?

2003-01-18 Thread Markus Reger
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

Re: Perl DBI secret command?

2003-01-18 Thread Paul DuBois
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

Re: Perl DBI secret command?

2003-01-18 Thread Joseph Bueno
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

RE: Perl DBI $sth->fetchrow_hashref() persistence?

2003-01-15 Thread Joe Stump
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

RE: Perl DBI or C++ API Help!

2002-12-04 Thread Norris, Joseph
== 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

Re: Perl DBI or C++ API Help!

2002-12-04 Thread Stephen Patterson
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

Re: Perl DBI or C++ API Help!

2002-12-03 Thread Bernd Prager
- 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

RE: Perl DBI or C++ API Help!

2002-12-03 Thread Salada, Duncan
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

RE: perl dbi and mysql question

2002-11-08 Thread Shon Stephens
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

RE: perl dbi and mysql question

2002-11-08 Thread Grigor, Peter
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

Re: perl dbi and mysql question

2002-11-08 Thread stibs-pi
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

RE: perl dbi and mysql question

2002-11-08 Thread Shon Stephens
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

Re: Perl DBI Interfacer

2002-09-21 Thread Brian Reichert
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

Re: Perl/DBI & load data local

2002-06-21 Thread Paul DuBois
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

Re: Perl DBI

2002-05-23 Thread Curtis Maurand
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 > >

Re: Perl DBI

2002-05-23 Thread Viliam Batka
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

RE: Perl DBI & DBD & Show Table Modules Best Dir Install Choices!

2001-09-15 Thread Dipl.-Inf. Guus Leeuw jr.
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

Re: Perl DBI: Same column name in different tables problem

2001-09-07 Thread Dana Powers
-- 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

Re: Perl DBI: Same column name in different tables problem

2001-09-07 Thread Jeremy Zawodny
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

Re: Perl DBI -- How to select all returned values into an array

2001-08-26 Thread Tim Bunce
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

Re: Perl DBI -- How to select all returned values into an array

2001-08-25 Thread s. keeling
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 @

Re: Perl DBI -- How to select all returned values into an array

2001-08-25 Thread Paul DuBois
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->?(

Re: Perl DBI -- How to select all returned values into an array

2001-08-25 Thread Katherine Porter
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

Re: Perl DBI to MySQL -- Passing info to query

2001-07-11 Thread Ilya Martynov
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

Re: Perl DBI to MySQL -- Passing info to query

2001-07-10 Thread havoc
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

Re: Perl DBI to MySQL -- Passing info to query

2001-07-10 Thread ryc
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

Re: Perl DBI to MySQL -- Passing info to query

2001-07-10 Thread Ilya Martynov
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

Re: Perl DBI to MySQL -- Passing info to query

2001-07-09 Thread ryc
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

Re: Perl DBI to MySQL -- Passing info to query

2001-07-09 Thread Joshua J. Kugler
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

Re: Perl DBI Error 19

2001-06-27 Thread Gerald Clark
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

Re: Perl DBI Error 19 -solved

2001-06-25 Thread Hannes Niedner
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

Re: Perl DBI and rollback()

2001-06-23 Thread Ilya Martynov
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

Re: Perl DBI and rollback()

2001-06-22 Thread Paul DuBois
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

Re: Perl DBI and rollback()

2001-06-22 Thread Trond Eivind Glomsrød
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()

Re: Perl DBI

2001-02-16 Thread Eric Fitzgerald
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

RE: Perl DBI

2001-02-16 Thread John Tsangaris
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

Re: Perl DBI

2001-02-16 Thread Eric Fitzgerald
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 >