can one use a select statement returning a single value for "default" ? what would be the syntax ? (enclosed, not enclosed ...)
ex : select max(id) from ids
Regards
can one use a select statement returning a single value for "default" ? what would be the syntax ? (enclosed, not enclosed ...)
ex : select max(id) from ids
Regards
Seqno() operates in a similar way to AUTOINC and returns a unique row id.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
I should also mention that this handles concurrent requests while maintaining that the result is guaranteed unique. The original question you asked about using SELECT MAX() ... Is not guaranteed to return a unique id in a multiuser context.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
I can't use seqno(), as it is re-initialised at app startup. It has to be a sequence used by surrogate keys. My workaround is a virtual table invoking a function defined on the db side.
Regards
Additionally, each row (record) inserted into a Lianja table has a hidden readonly column called SYNCNUM which is used internally, but it can be referenced in your apps too.
GUID() is another built-in function which can be used to generate a unique id but unlike SEQNO() it's values are in random order whereas SEQNO() is always ascending.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
The next Seqno() is maintained in the table header. It is not reset at app startup.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
you mean in RC8?
No it is in RC7.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
unless I am doing something wrong, seqno() does'nt behave that way
table structure
Structure for table : tab.dbf
Alias : tab
Number of records : 4
Date of creation : 08/12/2013
Date of last update : 08/12/2013
DES3 Encrypted : No
CursorAdaptor : No
Field Field Name Type Width Dec Description
1 ID Integer 1 id
2 TSTAMP Character 19 tstamp
** Total ** 24
In form Id is read only, default is seqno()
below is what i get after creating 2 records, exiting the app and creating 2 other records
ID TSTAMP
1 08/12/2013 07:04:42
2 08/12/2013 07:05:08
1 08/12/2013 07:06:14
2 08/12/2013 07:06:21
4 records selected in 5ms
Regards
There seems to be an issue using seqno() with tables opened exclusively. I will look into it and fix it. It works shared.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Bookmarks