Auto Increment Field

Ruslan Zasukhin sunshine at public.kherson.ua
Fri May 6 11:40:26 CDT 2005


On 5/6/05 9:17 AM, "Derrick Muller" <derrick at xact.co.za> wrote:

>> Hi Derrick, 
>  
>>> Is it possible to set a integer field to AUTO INCREMENT on create?
>  
>> We have not yet such feature.
>  
>> Usually people use RecID field.
>  
>> But right, since we want support pure Relational model also,
>> It is good idea add auto increment also. I think it is in our bug tracking
>> system as feature request.
>  
> Looks like I will have to create a single record control table to track
> document numbers (Invoice No, Job Sheet No, etc.)

Yes. This is common solution
  
> So, is it possible to specify a table which only allows a single record so
> that:
>  
> SELECT * FROM ControlTable
>  
> Will always return a single record to the recordset/cursor.

No, you cannot limit number of records in table.

You can do this

    Numbers { TableName, NextID }

Now you can

    curs = db.SqlSelect(
        "SELECT NExtID FROM tblCounters WHERE TableName = 'myTable'" )

    nextID = curs.Field(1).value

    curs.Field(1).value = nextId + 1
    curs.Update   


> (I am still very new to RB & Valentina and recordsets vs cursor will be
> subject of another mail)



-- 
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