Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

Re: Some things to solve ...

Quote Reply
Re: Some things to solve ... In reply to
No, you weren't, but I think there was a different solution/reason for what was going on.

I'll see if I can find that thread (or if you can). But if you look at the table definition for any of the tables manged through DBSQL.pm and the "add" routine, the ID field is automatically generated, and unique. I had a problem early on trying to use DBSQL.pm with tables where I was using a different key field. I gave up and added the ID field even if I wasn't using it. Alex considered (and may have) made changes to allow use of the routines with the "?" auto-increment field as the first field, but I never really went back. I just changed my own logic and thinking to use ID #'s as the key field.

I might be subtly confusing things, I'll have to check -- (see if I can insert another record with the same ID in a table) _BUT_ in links, the ID (auto-increment) field is declared as "PRIMARY". Primary is a "UNIQUE" key, and thus, whether or not "AUTO_INCREMENT" allows duplicate values, the "PRIMARY" attribute to that field would not.

An AUTO_INCREMENT field must be indexed, but I can't find documented anywhere if it has to be "UNIQUE."

In Links, it _IS_ UNIQUE by virtue of being declared "PRIMARY".



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Subject Author Views Date
Thread Some things to solve ... Robert 3896 Jul 26, 2000, 9:22 AM
Thread Re: Some things to solve ...
Stealth 3794 Jul 26, 2000, 9:32 AM
Thread Re: Some things to solve ...
pugdog 3792 Jul 26, 2000, 9:44 AM
Thread Re: Some things to solve ...
Stealth 3799 Jul 26, 2000, 10:19 AM
Thread Re: Some things to solve ...
pugdog 3796 Jul 26, 2000, 11:02 AM
Thread Re: Some things to solve ...
Robert 3780 Jul 26, 2000, 3:13 PM
Post Re: Some things to solve ...
Stealth 3841 Jul 26, 2000, 3:18 PM