trouble converting from mysql

Joseph Morgan joseph at checkos.com
Mon Nov 5 18:38:24 CST 2007


On Nov 5, 2007, at 2:34 AM, Ruslan Zasukhin wrote:

> 1) In very big systems they think that its hard to get really not- 
> reused
> sequences of ids. Any TYPE is limited at last of end. But if you  
> use small
> system, and big TYPE then you can hope it will be enough for life- 
> circle.
>
> And big DBMS even do not have such term -- auto-incremented field.

Basically you are saying that millions and millions of records later,  
I may have to
rethink the way I am doing it because there are limitations of how  
high the TYPES go. Correct?

Like you say, it is a relatively small system. I think it is almost  
impossible for my end users
to make so many records to reach such limitations.

> 2) Valentina allow for ULONG field to have flag IDENTITY
>     although this variant of auto-increment field in fact uses RecID
>     i.e. Reuses values.
So then recid would be bad for invoice numbers because eventually
if an invoice gets deleted, that number would end up getting reused
and have the potential to refer to 2 different invoices with same  
number.

> 3) people also use way in BIG DBMS and you can use it also:
>
>         make Table IDs with 2 fields.  TableID, LastID
>
> And write procedure which will
>
>     GetNextIDFor( tableID )

Ok, so are there any big benefits of doing it with a stored
procedure instead of something like this?:

cursor = "select max(_rowID) from table1"

x = cursor.field(1).integervalue + 1

"insert into table1(_rowid,otherfields) values(x,otherfields)"

I am usually only entering one single row at a time so
speed probably won't be a concern.


Thanks,
Joseph


More information about the Valentina mailing list