473,326 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

primary key not enforced..?

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.
Jul 19 '05 #1
3 1245
fixed, sorry about that......
Jul 19 '05 #2
fixed, sorry about that......
Jul 19 '05 #3
fixed, sorry about that......
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: js | last post by:
I am trying to create a primary key constraint on a view in the following statement. However, I got an error ORA-00907: missing right parenthesis. If the CONSTRAINT clause is removed, then the...
11
by: SWE | last post by:
Knifflige Frage zu Datenbanken: Es gibt Tabellen, die mehr als ein PK-Feld haben; also z.B.MAID und GMID. Soweit ok. Nehmen wir an, aus dieser Tabelle sollen keine Datensätze physikalisch...
1
by: Bob | last post by:
Hi, Does anyone know why forgein key constraints are not enforced when updateing multiple tables using a combination of views and rules? This doesn't seem to be a major problem as I can...
5
by: Bob Sparks | last post by:
I upgraded to stinger and got stung. Not all my code compiles. Most of the problems are stinger seems to be more stringent on casting varchars to vargraphics. This I am working out, however, one...
0
by: Steve | last post by:
For all who might have read my previous posts ---- AccessXP in 2000 mode and I presume in 2002 mode has a bug you might not know about. If you try and delete a record in a subform where...
4
by: Omey Samaroo | last post by:
I am using Employee_Number as a primary field in one table and in another table I have a field with the same name that it references in a one to many relationship. How do I change the primary field...
18
by: Thomas A. Anderson | last post by:
I am a bit confused in creating a composite primary key. I have three table with two of the tables containing primary keys. I have two of the tables (each with a primary key) having one to many...
13
by: Ron | last post by:
Hi All, Okay, I've read previous suggestions about not showing the primary key to the user of forms. If a number is to be shown (let's say, customer number) it should be generated independently...
4
by: Peter | last post by:
I am interested in informed feedback on the use of Constraints, Primary Keys and Unique. The following SQL statement creates a Bands tables for a database of bookings Bands into Venues, where the...
2
blyxx86
by: blyxx86 | last post by:
Good Afternoon Everyone, I am migrating from MS Access to MySQL (TONS faster, not to mention the usefulness of triggers). Well, I am running into problems with the way MS Access lets you design...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.