Re: Perl/mysql question

2003-07-30 Thread Octavian Rasnita
Hi all,

I am using DBI and DBD::mysql to connect to a MySQL database from perl and I
would like to get the execution time period after a query, like MySQL
standard client shows.

Sometimes when I work in the standard console client it tells me that there
are x wornings.
How can I see which are those warnings?

Thank you.



Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Howell, Scott" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 30, 2003 6:38 PM
Subject: Perl/mysql question


Has anyone written a perl script to get records from another database and
write it to a file on mysql's LOAD DATA INFILE format? I just need some
pointers in perl so a LOAD DATA INFILE will be read correctly.

For example, a perl script:
Select * from emp from a Progress database
Will write to a text file called emp.txt in the LOAD DATA INFILE format,
Then,
I can to a direct LOAD DATA INFILE into my mysql database.

I tried doing direct select/inserts in perl but found dumping to a text file
and doing a LOAD DATA to be MUCH faster.

Am I missing something here?

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Perl/mysql question

2003-07-30 Thread Joel Fentin
Howell, Scott wrote:

Has anyone written a perl script to get records from another database and
write it to a file on mysql's LOAD DATA INFILE format? I just need some
pointers in perl so a LOAD DATA INFILE will be read correctly.
For example, a perl script:
Select * from emp from a Progress database
Will write to a text file called emp.txt in the LOAD DATA INFILE format,
Then,
I can to a direct LOAD DATA INFILE into my mysql database.
I tried doing direct select/inserts in perl but found dumping to a text file
and doing a LOAD DATA to be MUCH faster.
Am I missing something here?

Download data from mysql to pipe delimited text file; whole table.
SELECT * FROM table1 INTO OUTFILE 'c:/test.txt' FIELDS TERMINATED BY "|";
Same download with perl/cgi
my $statement = 'SELECT * FROM table1 INTO OUTFILE \'C:/test.txt\' 
FIELDS TERMINATED BY "|"';
$dbh->do($statement) or die "tilt\n";

Upload data from pipe delimited text file. Loads whole table.
LOAD DATA LOCAL INFILE "[path with front slashes] filename.txt" INTO 
TABLE tablename
FIELDS TERMINATED BY "|";

Note that some service providers don't like this and won't permit it.
--
Joel Fentintel: 760-749-8863FAX: 760-749-8864
email: [EMAIL PROTECTED]
Biz:   http://fentin.com
Personal:  http://fentin.com/me/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Perl/mysql question

2003-07-30 Thread Dan Muey
> Has anyone written a perl script to get records from another 
> database and write it to a file on mysql's LOAD DATA INFILE 
> format? I just need some pointers in perl so a LOAD DATA 
> INFILE will be read correctly.


You might want to check out Perl's DBI module at search.cpan.org
I use that all the time to interact with mysql.
Simple quick and just as sexxy as mysql itself!

HTH

DMuey

> 
> For example, a perl script:
> Select * from emp from a Progress database
> Will write to a text file called emp.txt in the LOAD DATA 
> INFILE format, Then, I can to a direct LOAD DATA INFILE into 
> my mysql database.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Perl/mysql question

2003-07-30 Thread Howell, Scott
Has anyone written a perl script to get records from another database and
write it to a file on mysql's LOAD DATA INFILE format? I just need some
pointers in perl so a LOAD DATA INFILE will be read correctly.

For example, a perl script:
Select * from emp from a Progress database
Will write to a text file called emp.txt in the LOAD DATA INFILE format,
Then,
I can to a direct LOAD DATA INFILE into my mysql database.

I tried doing direct select/inserts in perl but found dumping to a text file
and doing a LOAD DATA to be MUCH faster.

Am I missing something here?

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]