redirecting query output?
am 02.03.2010 17:17:02 von Richard Reina
I have a perl script that periodically reads and enters (via perl->DBI pars=
ed system output (about received faxes) into a table. Since the old output=
is repeated I have put, when creating the table, the UNIQUE key on the fie=
ld of the faxname, which is always different (something like fax000007879.t=
if)=20
Every time the script is run many of the old faxes that have already been e=
ntered into the table are still on the server (as I would like them to be).=
As a result MySQL via execute() dutifully warns about all the duplicate e=
rrors. Is there anyway to redirect that output so the it does not appear as=
standard output? Or is it a bad idea to do so and should I being doing a d=
ifferent sort ow query altogether?
Thanks,
Richard
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: redirecting query output?
am 02.03.2010 17:49:05 von Olaf.Stein
--_000_C7B2ABB11483Dolafsteinnationwidechildrensorg_
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I don't think you do anything about the output, you could however check if =
a record is already in the table before inserting it.. And skip it i=
f already there
Olaf
On 3/2/10 11:17 AM, "Richa=
rd Reina" wrote:
I have a perl scr=
ipt that periodically reads and enters (via perl->DBI parsed system output =
(about received faxes) into a table Since the old output is repeated I =
have put, when creating the table, the UNIQUE key on the field of the faxna=
me, which is always different (something like fax000007879tif)
=0D=
=0AEvery time the script is run many of the old faxes that have already bee=
n entered into the table are still on the server (as I would like them to b=
e) As a result MySQL via execute() dutifully warns about all the duplic=
ate errors Is there anyway to redirect that output so the it does not ap=
pear as standard output? Or is it a bad idea to do so and should I being do=
ing a different sort ow query altogether?
Thanks,
Ric=
hard
--
MySQL General Mailing List
For list archives: =
http://listsmysqlcom/mysql
To unsubscribe: http://listsmys=
qlcom/mysql?unsub=3Dolafstein@nationwidechildrensor g
=
------------------------ -
Olaf Ste=
in
DBA
Battelle Center for Mathematical Medicine
Nationwide =
Children's Hospital, The Research Institute
700 Children's Drive
=
43205 Columbus, OH
phone: 1-614-355-5685
cell: 1-614-843-0432=0D=
=0Aemail: olafstein@nationwidechildrensorg
"I consid=
er that the golden rule requires that if I like a program I must share it w=
ith other people who like it"
Richard M Stallman
=0D=
=0A
--_000_C7B2ABB11483Dolafsteinnationwidechildrensorg_--
Re: redirecting query output?
am 02.03.2010 18:35:54 von Chris W
I'm not sure this is the best solution, but whenever I am inserting a
lot of records with the possibility of some of those records already
existing and I have no reason to update the existing records with new
data, I use 'INSERT IGNORE'. I'm not sure if that will 'ignore' other
errors that you may want to show. I would read up about it here....
http://dev.mysql.com/doc/refman/5.1/en/insert.html
Richard Reina wrote:
> I have a perl script that periodically reads and enters (via perl->DBI parsed system output (about received faxes) into a table. Since the old output is repeated I have put, when creating the table, the UNIQUE key on the field of the faxname, which is always different (something like fax000007879.tif)
>
> Every time the script is run many of the old faxes that have already been entered into the table are still on the server (as I would like them to be). As a result MySQL via execute() dutifully warns about all the duplicate errors. Is there anyway to redirect that output so the it does not appear as standard output? Or is it a bad idea to do so and should I being doing a different sort ow query altogether?
>
> Thanks,
>
> Richard
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org