Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / General DB Topics / General DB Topics / August 2004

Tip: Looking for answers? Try searching our database.

IbSql v MySql.... Auto_Increment

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Waites - 09 Aug 2004 17:38 GMT
Hi all,

I've got to set-up a database on an Interbase SQL server.... I want to
do an ID for each entry.... In MySql it is easy using the AUTO_INCREMENT
attribute. I can't see anything similar for Interbase Sql.

Has aanyone any experience of a work around?

Any theories welcomed,

Cheers,

Paul.
Noel - 09 Aug 2004 21:18 GMT
>I've got to set-up a database on an Interbase SQL server.... I want to
>do an ID for each entry.... In MySql it is easy using the AUTO_INCREMENT
>attribute. I can't see anything similar for Interbase Sql.
>
>Has aanyone any experience of a work around?

Use generators for the auto increment fields.
Paul Waites - 10 Aug 2004 13:28 GMT
>>I've got to set-up a database on an Interbase SQL server.... I want to
>>do an ID for each entry.... In MySql it is easy using the AUTO_INCREMENT
[quoted text clipped - 3 lines]
>
> Use generators for the auto increment fields.

Thanks Noel,

Seems to have done the trick,

Paul.
Noel - 11 Aug 2004 11:02 GMT
>> Use generators for the auto increment fields.

>Thanks Noel,
>
>Seems to have done the trick,

You are welcome :-)   You have figured out the bit about using GEN_ID
in the 'before insert' trigger for the table, I take it.
Paul Waites - 13 Aug 2004 17:03 GMT
>>>Use generators for the auto increment fields.
>
[quoted text clipped - 4 lines]
> You are welcome :-)   You have figured out the bit about using GEN_ID
> in the 'before insert' trigger for the table, I take it.

Hi Noel,

Yes I did... Took a bit of sussing out but quite a neat trick.

I don't quite know what I've done to deserve the other post but I am
self taught so therefore don't always get the conventions right.

B.T.W there seems to be lots of web info on MySql, but little on
IbSql.... I guess that I'm moving in when others are moving out! Still
if it does the job its o.k with me.

Paul.
Noel - 13 Aug 2004 17:58 GMT
>Hi Noel,
>
>Yes I did... Took a bit of sussing out but quite a neat trick.
>
>I don't quite know what I've done to deserve the other post but I am
>self taught so therefore don't always get the conventions right.

Its a hobby-horse of his, and like most people with hobby-horses, IMHO
he can be a little blind to the downside of them, and just a little
rude and pompous in presenting his case.

The 'standard' of having natural keys is the ideal, but is not always
the most practical.  I fall somewhere between the two stools, in that
I would prefer to use natural keys in any system I design but
sometimes I recognise that natural keys are just not a practical
proposition.

However, I feel that Joe does have a very strong point when he says
that DBs using system generated keys frequently often have no means of
verifying the key, that is, no check digit calculated on the key.  

>B.T.W there seems to be lots of web info on MySql, but little on
>IbSql.... I guess that I'm moving in when others are moving out! Still
>if it does the job its o.k with me.

IB and Firebird (the IB-derived open-source DBMS) are both far more
robust (IMHO) than MySQL.  Firebird has the added advantage in that it
is totally free.  Check out www.firebirdsql.org
eg - 24 Aug 2004 07:16 GMT
>>B.T.W there seems to be lots of web info on MySql, but little on
>>IbSql.... I guess that I'm moving in when others are moving out! Still
[quoted text clipped - 3 lines]
> robust (IMHO) than MySQL.  Firebird has the added advantage in that it
> is totally free.  Check out www.firebirdsql.org

Also, for more info on Firebird (and Interbase) check out the IBPhoenix
site at: http://ibphoenix.com/

Finally, Helen Borrie just published a book about Firebird. You can find
info here: http://ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_firebird_book
--CELKO-- - 11 Aug 2004 18:03 GMT
>> I want to do an ID for each entry.... In MySql it is easy using the
AUTO_INCREMENT attribute  ... <<

You have no idea what a key is, so you are using sequential record
numbers!  Since MySQL is not a database, being totally non-relational
is perhaps forgiveable.

But why not clean up that design and move up to an RDBMS while you
have the chance?
Noel - 11 Aug 2004 18:56 GMT
>>> I want to do an ID for each entry.... In MySql it is easy using the
>AUTO_INCREMENT attribute  ... <<
[quoted text clipped - 5 lines]
>But why not clean up that design and move up to an RDBMS while you
>have the chance?

You were so busy preparing to launch into your usual tirade that you
missed the part about him moving to Interbase, which is an RDBMS.
Just because Interbase supports auto-increment columns, which the
world and his dog already know you consider a sin, does not mean it
does not qualify as an RDBMS.  

BTW, I notice you are still quoting posts you are responding to in a
non-standard way :-)
eg - 24 Aug 2004 07:15 GMT
> You were so busy preparing to launch into your usual tirade that you
> missed the part about him moving to Interbase, which is an RDBMS.
> Just because Interbase supports auto-increment columns, which the
> world and his dog already know you consider a sin, does not mean it
> does not qualify as an RDBMS.  

Actually, Interbase (and Firebird) do not support an auto-increment
column. However, you can achieve the desired effect through the use of
generators and triggers.
michael newport - 22 Aug 2004 15:17 GMT
an RDBMS like Ingres ?

now thats a good idea !
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.