On Tue, 13 Nov 2001, Gerald Clark wrote:
Looks correct to me.
What do you think is the problem?
2 rows were affected by the replace.
One row was deleted, and one was inserted,
Both rows had a value of 'test' for column 'Tab'.
Cool, thanks to Jeremy Zawodny and you, now I know even more
On Tue, Nov 13, 2001 at 12:45:17PM -0800, Jeremy Zawodny wrote:
On Tue, Nov 13, 2001 at 08:53:09PM +0100, Martin MOKREJS wrote:
Hello,
I think I've found a bug. Just by playing with REPLACE and INSERT,
the following happened. I'm including full log, demonstrating that I
don't
On Tue, Nov 13, 2001 at 10:04:22PM +0100, Martin MOKREJS wrote:
On Tue, 13 Nov 2001, Gerald Clark wrote:
Looks correct to me.
What do you think is the problem?
2 rows were affected by the replace.
One row was deleted, and one was inserted,
Both rows had a value of 'test' for column
-Original Message-
From: Martin MOKREJ [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 14 November 2001 10:04 a.m.
To: Gerald Clark
Cc: [EMAIL PROTECTED]
Subject: Re: Introducing hidden row having duplicated primary key
On Tue, 13 Nov 2001, Gerald Clark wrote:
Looks correct to me.
What do
, and
it has a primary key, say pk.
since pk is auto incrementing , whenever a new article is added it will
increment by one.However, if
i delete an article ( a row) it will not decrement. So when i want to
display them five by five, i will
have trouble, because some numbers do not exist. In oracle
the subject and contents of articles, and
it has a primary key, say pk.
since pk is auto incrementing , whenever a new article is added it will
increment by one.However, if
i delete an article ( a row) it will not decrement. So when i want to
display them five by five, i will
have trouble
I would like to have a table that has a primary key defined on a
combination of two columns in the table. In other words a unique key
based upon the values in two columns.
I don't think I am able to do this in mysql. I think you can only have
a primary key on one column
Yes, you can have multi-column keys. see the manual, para. 6.5.3 CREATE
TABLE Syntax
-Original Message-
From: Brendin [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 12:37 PM
To: [EMAIL PROTECTED]
Subject: primary key based on unique value for two columns
I would like
Brendin wrote:
I would like to have a table that has a primary key defined on a
combination of two columns in the table. In other words a unique key
based upon the values in two columns.
I don't think I am able to do this in mysql. I think you can only have
a primary key on one column
Hi
You are wrong.
Just try for example:
create table test(
pk1 int not null,
pk2 int not null,
primary key(pk1,pk2)
);
Regards
Daniel £a
e-direct Polska sp. z o.o
I would like to have a table that has a primary key defined on a
combination of two columns in the table. In other words a unique key
based upon the values in two columns.
I don't think I am able to do this in mysql. I think you can only have
a primary key on one column
You can't use a primary key for that, but you CAN make a unique two-column
key:
ALTER TABLE MyTable ADD UNIQUE MyNewIndex (Column1,Column2)
- Jonathan
-Original Message-
From: Brendin [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 10:37 AM
To: [EMAIL PROTECTED]
Subject
Will this relate the primary keys to one another or just create primary
keys on the columns.
Ie:
Create table test (column1 int(11) not null, column2 int(11) not null,
primary key (column1, column2) )
Then could you...
Insert into test values (1,2)
Insert into test values (1,3)
Note
This will work thanks... That's what I want a unique key based on
two columns.
-Original Message-
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 12:09 PM
To: 'Brendin'; [EMAIL PROTECTED]
Subject: RE: primary key based on unique value for two
sure you can
CREATE TABLE xx (field1 INT NOT NULL,field2 INT NOT NULL,PRIMARY KEY
(field1,field2))
and you have table xx with unique key in two fields
hand
primoz
- Original Message -
From: Brendin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 7:37 PM
Subject
I have not tested this with the primary key - my previous suggestion went
off the logic in my head at the time (most likely not a good thing, since
I'm tired right now), but I have a feeling Bill here is probably correct if
he says it's possible with the primary key as well. I stand corrected
At 02:32 PM 10/30/2001 -0700, Steve Meyers wrote:
What would be ideal would be to use auto-incremented numeric fields as
primary key fields, and then have a special field in each table
designated
as the user-friendly field. That way, when you want to view the
contents
of a table
]]
Sent: Tuesday, October 30, 2001 3:11 PM
To: [EMAIL PROTECTED]
Subject:bad practice to have a primary key field whose value
changes?
I'm creating a database where one of the tables stores data about news
Web
sites
On Tue, 2001-10-30 at 13:10, Bennett Haselton wrote:
I'm creating a database where one of the tables stores data about news Web
sites, and I'm using the URL of the site as a primary key field. This
field value might change occasionally. I'm wondering if this is bad
practice, especially
On 26-Oct-2001 Tim Evans wrote:
I have inherited a database built by someone else who was apparently
very
stingy. :-)
A primary key was set to 'tinyint(4)' limiting the number of records
to 128.
I've tried:
alter table my_data modify phyid mediumint unsigned DEFAULT 0;
...but got
Hi,
A primary key was set to 'tinyint(4)' limiting the number of records
to 128.
I've tried:
alter table my_data modify phyid mediumint unsigned DEFAULT 0;
ERROR 1121: Column 'phyid' is used with UNIQUE or INDEX but is not
defined as NOT NULL
Try:
alter table my_data modify phyid
I have inherited a database built by someone else who was apparently
very
stingy. :-)
A primary key was set to 'tinyint(4)' limiting the number of records
to 128.
I've tried:
alter table my_data modify phyid mediumint unsigned DEFAULT 0;
...but got:
ERROR 1121: Column 'phyid' is used
I'm having a difficult time synchronizing my Master and Slave Servers.
I've been doing this using MySQL Binary Logs, where the Master rotates the
logs at 1 hour times, and the slave downloads it and imports it.
What happens why I try to pipe the binlog into mysql is that it reports and
error
Hello, I have a mysql database with a table called cust. The primary key column
custid is of type int and has the auto_increment feature which has been working
perfectly for months. The auto_increment feature set numbers as high as 21700.But
suddenly, it started over, setting numbers like
On 29-Aug-01, Paul DuBois wrote:
Create a single PRIMARY KEY that consists of the two columns chapter and
section, and make section an AUTO_INCREMENT column. When you insert
rows, set chapter to the proper chapter number and section to NULL.
This will cause MySQL to generate independent
I want to create a table with two Primary Keys. The first key is a category
field, and the second is auto-incremented. Example: Key 1=Chapter name, Key
2 =section number. For example, (Chapter1, 1) (Chapter1, 2) (Chapter1, 3)
then with a new Cheaper, I want to restart the auto-incremented
-incremented field back
to 1 (Chapter2, 1) (Chapter2, 2). How do I get the auto-incrementer to
restart with each new chapter?
Try this:
mysql CREATE TABLE test (chapter INT NOT NULL, section INT NOT NULL
AUTO_INCREMENT, PRIMARY KEY (chapter, section));
Query OK, 0 rows affected (0.00 sec)
mysql INSERT
Cheaper, I want to restart the auto-incremented field back
to 1 (Chapter2, 1) (Chapter2, 2). How do I get the auto-incrementer to
restart with each new chapter?
Create a single PRIMARY KEY that consists of the two columns chapter and
section, and make section an AUTO_INCREMENT column. When you
Hi!
A serious bug has been found in the big BLOB and TEXT
support of InnoDB. If you update the primary key of a
row whose length is 8000 bytes, then the table
becomes corrupt. Also the tablespace may become
corrupt. Note that also a REPLACE can internally be
handled as an update.
A fixed
Also, I'm seeing this in the logfile:
java.lang.NullPointerException
WOApplication 'Newsie': Exception occurred while handling request:
com.webobjects.foundation.NSForwardException
[com.webobjects.jdbcadaptor.JDBCAdaptorException] null
Paul
(in case you're wondering, yes, i did get mysql
(in case you're wondering, yes, i did get mysql working argh.)
info: WO5, Mac OS X 10.0.4, MySQL 3.23.32, mm.mysql JDBC adaptor 2.0.6.1
I get this error:
java.lang.IllegalStateException: Adaptor
com.webobjects.jdbcadaptor.JDBCAdaptor@b7ad3 failed to provide new primary
keys for entity
way for do
the same in a better way?
Thanks
Javier Armendáriz
[EMAIL PROTECTED]
Brian Warn wrote:
Hello,
I want to use two text columns as my primary key. From the DuBois book, I see that
I cannot do this since my v. 3.22.32 tables are ISAM, and BLOB and TEXT columns
cannot be indexed
On Tue, Jun 19, 2001 at 08:48:56AM -0700, Brian Warn wrote:
Hello,
I want to use two text columns as my primary key. From the DuBois
book, I see that I cannot do this since my v. 3.22.32 tables are
ISAM, and BLOB and TEXT columns cannot be indexed. Besides
upgrading to v. 3.23
Hello!
I have two databases that i want to replicate: each database should contain
the same information. That's why i have set a circular replication relation.
All works fine, except that one of the table is filled in real-time; this
table has a primary key with autoinc type. When a new record
-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
]On Behalf
Of Fabien Balageas
Sent: 14 June 2001 13:59
To: '[EMAIL PROTECTED]'
Subject: Replication and primary key autoinc issue
Hello!
I have two databases that i want to replicate: each database
should contain
the same information
',
volume int(10) unsigned NOT NULL default '0',
PRIMARY KEY (symbole,id),
KEY idx_id (id)
) TYPE=Innobase;
As you can see, (symbole,id) is the primary key.
But :
mysql select * from livequote_last_PAR where symbole='1rPFTE' order by id desc
KEY (symbole,id),
KEY idx_id (id)
) TYPE=Innobase;
As you can see, (symbole,id) is the primary key.
But :
mysql select * from livequote_last_PAR where symbole='1rPFTE' order by id
desc;
+-+---+-+--++
| symbole | id| date
Heikki,
I did the downgrade to Mysql-3.23.36. I don't have this problem with
3.23.36 !
Alex.
HT check by other queries whether it is the table which contains a
HT duplicate row, or if the SELECT gives a wrong answer.
HT Check what
HT SELECT * FROM ... WHERE symbole='1rPFTE';
HT
Heikki,
Another exemple :
mysql select * from livequote_last_PAR where symbole='1rPFTE' order by id desc;
+-+---+-+--++
| symbole | id| date| last | volume |
+-+---+-+--++
|
Heikki,
HT check by other queries whether it is the table which contains a
HT duplicate row, or if the SELECT gives a wrong answer.
HT Check what
HT SELECT * FROM ... WHERE symbole='1rPFTE';
HT returns.
Really strange :
mysql select * from livequote_last_PAR where symbole='1rPFTE' order
I used Access (sorry) to develop a db design. I then used ODBC to export it
to MySQL. The tables all lost their primary key definitions. Now I need to
set them back to be a primary key. I have tried:
ALTER TABLE def_categories MODIFY ID PRIMARY KEY
Any help is appreciated!
Sean Tibbetts
On 25-Apr-01 [EMAIL PROTECTED] wrote:
I used Access (sorry) to develop a db design. I then used ODBC to export it
to MySQL. The tables all lost their primary key definitions. Now I need to
set them back to be a primary key. I have tried:
ALTER TABLE def_categories MODIFY ID PRIMARY KEY
Dear MySQL experts
In the following example I created simple table with two-column primary key ID,IDT.
After some inserts there came insert with ID, IDT values, that are not equal to none
of the previous couples, but MySQL still reported error "Duplicate entry". In the
l
Hi,
On Sat, Apr 14, 2001 at 11:53:52AM +0200, Filip Trojan wrote:
In the following example I created simple table with two-column primary key ID,IDT.
After some inserts there came insert with ID, IDT values, that are not equal to none
of the previous couples, but MySQL still reported error
CTED]
Sent: Saturday, April 14, 2001 11:53 AM
Subject: bug - multiple column primary key cannot correctly determine
duplicate entry
Dear MySQL experts
In the following example I created simple table with two-column primary key
ID,IDT. After some inserts there came insert with ID, IDT values, that are
I have a primary key listed as ID
When I first added about 10 records and then deleted a few records and
then added more records it didn't replace the missing records.
When I select all records to view I now get:
1
2 why didn't it go to 3, 4 and 5 after 2?
6
7
8
When I add a record
When I first added about 10 records and then deleted a few records and
then added more records it didn't replace the missing records.
That's MySQL's usual behaviour. auto_increment only garantees to create
unique keys. "Holes" left by deleting data are not filled.
Jens
I can understand not wanting to have holes, but..
If it is a primary key, how are you going to handle updating tables that
rely on that key id?
If your id numbers were to shift, like you want, and you had a related sub
table (one to many) and this was say, an shopping cart, then all of a sudden
How would you actually overcome that? Wouldn't it be good if MySQL would be adapted to
actually do this for you?
-- Kobus
"Jens Vonderheide" [EMAIL PROTECTED] 2001-04-08 19:25:48
When I first added about 10 records and then deleted a few records and
then added more records it didn't
, but..
If it is a primary key, how are you going to handle updating tables that
rely on that key id?
If your id numbers were to shift, like you want, and you had a related sub
table (one to many) and this was say, an shopping cart, then all of a sudden
customer A's line items are showing up in Customer B's
How would you actually overcome that? Wouldn't it be good if
MySQL would be adapted to actually do this for you?
I think that not reusing deleted numbers is easier (i.e. more efficient).
IIRC, earlier versions of MySQL in fact reused the numbers.
There are 2 ways to overcome this:
1) Check
How I learned to love number gaps:
I have a database of colleges and universities. Every degree listing
as a numbered id. This used to be auto-incremented. After several
deletes and additions, I found it advantageous to have gaps between
schools to add new degree listings, so that I didn't
how to use more than one field in a table as combined primary key.
e-mail= [EMAIL PROTECTED]
Hi,
Can i add the Primary key for a table after i created a table?
and if this column is not null and auto_increment will there occur an
error?
t.i.a.
regards
denis
-
Before posting, please check:
http://www.mysql.com
Friends.
people out in here are very afraid , when they hear Mysql does not support foreign
keys.
It really become difficult , why foreign keys are not enforced by mysql.
Anyways, can u please tell me does our favourite database support composite primary
keys as in Acess databse key...?
U
On Sat, Feb 24, 2001 at 09:43:45AM -0700, Karl Stubsjoen wrote:
I'm trying to understand MySQL indexing but am having trouble
understanding the differnences (and when to use each) between
Primary Key, Key, Unique, an Index. Can you help?
Index and Key are the same.
A Primary Key
Hello,
I'm trying to understand MySQL indexing but am having trouble understanding the
differnences (and when to use each) between Primary Key, Key, Unique, an Index. Can
you help?
Thank you!
On Sat, Feb 24, 2001 at 09:43:45AM -0700, Karl Stubsjoen wrote:
I'm trying to understand MySQL indexing but am having trouble
understanding the differnences (and when to use each) between
Primary Key, Key, Unique, an Index. Can you help?
Index and Key are the same.
A Primary Key
hi all
i use mysql-3.23.32
my project need to use unsigned Bigint as a primary key.
but when i insert many rows in this table.
sometimes it will error with Duplicate such like
insert into Table
values('9231852172526977164',0,0,52056,0,0,0,0,0,52056,0,0,0,0,0,0,0,11,0,'184000','184000',1
, which doesn't make sense
at all. I'm surprised the insert even works.
Thirdly, have you tried checktable/myisamcheck?
- Original Message -
From: "chchen" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 20, 2001 18:56
Subject: BigInt with primary key
hi all
i
' NOT NULL,
sLocation smallint(5) DEFAULT '0' NOT NULL,
dLocation smallint(5) DEFAULT '0' NOT NULL,
FirstTime time DEFAULT '00:00:00' NOT NULL,
LastTime time DEFAULT '00:00:00' NOT NULL,
Times smallint(5) unsigned DEFAULT '0' NOT NULL,
PRIMARY KEY (A),
KEY dLocation (dLocation
On Tue, Feb 20, 2001 at 06:56:28PM +0800, chchen wrote:
hi all
i use mysql-3.23.32
my project need to use unsigned Bigint as a primary key.
but when i insert many rows in this table.
sometimes it will error with Duplicate such like
insert into Table
values('9231852172526977164
I have written the following SQL request, but I get
an error, why ?
create table MovementOrder (
teamCode INT(4) NOT NULL,
quarter INT(4) NOT NULL,
position INT(4) NOT NULL,
priority INT(4) NOT NULL,
order VARCHAR(10),
parameter VARCHAR(5),
PRIMARY KEY(teamCode,quarter,position
Is there an idea in having a PRIMARY KEY and UNIQUE key for the same table
column ?
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive
No. A primary key is a unique key, by definition.
--
"There cannot be a crisis today. My schedule is already full."
--Henry Kissinger
-Original Message-
From: Jacob Friis Larsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 09:58
To: [EMAIL
http://www.calevans.com
-Original Message-
From: Jacob Friis Larsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 9:58 AM
To: [EMAIL PROTECTED]
Subject: PRIMARY KEY (userid), UNIQUE (userid)
Is there an idea in having a PRIMARY KEY and UNIQUE key for the same table
column
ubject: Re: write problems via MS Access 97 in table with timestamp and
primary key
I used to get this all the time, myself, when I was trying to update
a mysql database with Access 2000 through myodbc. Funny, at the time,
nobody else seemed to understand what I was talking about. Once I got
to update certain fields in the table. The table
has a timestamp and a primary key. In fact, this user can change
certain fileds without difficulty for certain types of data and not
for others (i.e. Access accepts changes when the data is a document
but not when its a collection). To make t
One of our users is getting the message "another user has changed this
database..etc save changes to clipboard or drop changes... etc",
when he tries to update certain fields in the table. The table has a
timestamp and a primary key. In fact, this user can change certain
file
501 - 569 of 569 matches
Mail list logo