Counters can be incremented by calling the stored procedure BEFORE the insert using syntax like: call InterSystems.Sequences_GetNext("Name"), or using standard SQL, or part of an SQL select like:

select InterSystems.Sequences_GetNext(sequencename) from InterSystems.Sequences where Name='sequencename'

Can also be queried as table InterSystems.Sequences, but that data is actually stored in ^InterSystems.Sequences. Note use of %CacheSqlStorage to speed incrementing.

Note: to make the Sequences system-wide, simply map ^InterSystems.Sequences* to a common location

Note: counter names are case-insensitive and force to uppercase on disk.

Merge of ideas by JSL and APC 09/2005 ]]>
persistent 1 custom %Persistent 60172,44404.735854 60137,56752.747989 0 1 1 Name 1 The name of the sequence or identity, forced to uppercase. Typically a tablename (MSSQL identities) or an Oracle-like Sequence name %String Last assigned value for this Name. Initial %Integer 0 Returns an integer value with next assigned counter. 1 name:%String %Integer 1 Hibernate procedure to intialise a sequence, but can be used at any time 1 SequenceName:%String %Integer 1 Hibernate procedure to kill a sequence, but can be used at any time 1 SequenceName:%String %Integer 1 %CacheSQLStorage ^InterSystems.SequencesS 1 data ^InterSystems.Sequences delimited {Name}