trouble converting from mysql

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Nov 5 02:34:27 CST 2007


On 5/11/07 7:11 AM, "Joseph Morgan" <joseph at checkos.com> wrote:

Hi Joseph,

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.


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.

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 )


> Hello everyone,
> 
> I am still working on the mysql>valentina switch.
> 
> I have an existing primary key: "_RowID" for each table in the database.
> 
> I need them to auto increment. I know I need some sort of ID that
> won't be reused
> because they correspond to user accounts and invoice id's that end
> users will see and use.
> 
> My latest attempt is this:
> //alter the database
> "ALTER TABLE accountsreceivable CHANGE _RowID _RowID long primary key
> unique autoincrement"
> 
> INSERT INTO accountsReceivable( ARDate,ARCustomerID,
> ARDueDate,ARTotal,ARTax,ARCoworkerID,ARPaymentStatus,
> ARDetails,ARInvoiceBalance,ARTime,ARMessageID,ARTerms,
> ARPOText,ARticketDiscount,ARticketDiscPercent,paymentText )
> Values ( '2007-11-04',23,'2007-11-14',1.1e+1,1.0,10,'0','details',
> 1.1e+1,'10:26:39','1','4','PO','0',0.0,'' )
> 
> I get the following error when inserting into the database:
> Error: Kernel error: 0x23508. Primary key constraint violation
> occurred, table name = "accountsreceivable", constraint name =
> "PK_accountsreceivable__rowID".
> 
> 
> I also tried in vstudio:
> "ALTER TABLE accountsreceivable CHANGE _RowID _RowID long identity"
> But show columns reveals that identity never gets set to true.
> Also this changes nullable to true which seems incorrect.
> 
> Any ideas on how to make this work?




-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list