I have a small table ....
mysql> describe HostFunction;
+------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------+------+-----+---------+-------+
| Hostname | varchar(100) | | PRI | | |
| shortname | varchar(100) | | | | |
| status | varchar(10) | | | | |
| function | varchar(20) | | | | |
| log_date | timestamp(14) | YES | PRI | NULL | |
| lastupdate | timestamp(14) | YES | | NULL | |
+------------+---------------+------+-----+---------+-------+
when I create the table I insert a series of values ....
================================================== ===========================
cat test
INSERT INTO HostFunction VALUES
('controlwstr0.foobar.org','controlws','production ','TME
Console',20040220102459,00000000000000);
INSERT INTO HostFunction VALUES
('csdevdb2.foobar.org','csomsb1','sandbox','Order
Management',20040220102459,00000000000000);
================================================== =============================
so far so good, I am able to insert the values from the command line
using ...
mysql asset_mgmt < test
================================================== ==========================
mysql> select * from HostFunction;
+--------------------------+---------------+------------+---------------------+----------------+----------------+
| Hostname | shortname | status | function
| log_date | lastupdate |
+--------------------------+---------------+------------+---------------------+----------------+----------------+
| controlwstr0.foobar.org | controlws | production | TME Console
| 20040220102459 | 00000000000000 |
| csdevdb2.foobar.org | csomsb1 | sandbox | Order
Management | 20040220102459 | 00000000000000 |
================================================== ===============================
then I have the input file ....
|controlwstr0.foobar.org|controlws|production|TME Console|2004-02-17
14:24:00
|csdevdb2.foobar.org|csomsb1|sandbox|Order Management|2004-02-19
11:17:00
I use mysqlPP module to send it to the database using the following
command....
$self->{'dbh'}->do("INSERT INTO HostFunction VALUES ( ?, ?, ?, ?, ?,
?)",
undef,$hostname, $host, $status, $project,$date);
I wonder why if I have the same "hostname, log_date " pair instead of
complaining, it just replaces the conflicting entry..
odd enough, I have other table in the same database populated with the
same command, and it complains when I try to insert a value with the
same hostname, log_date pair...
any ideas???
regards,
esv.