Supplementary Actions
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    > BEE Variables
    > BEE Syntax
    > BEE Commands
    v Database Operation
       > Database Variables
       v Database Actions
          o Database Access Actions
          o VirtualBase Actions
          o Supplementary Actions
    > Content Management
    > Objects and Classes
    > Interface with others
    o Glossary
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> Reference >> Database Operation >> Database Actions >> Supplementary Actions <=  =>      <  1  >  
The supplementary operations

The two supplementary actions are used sparingly and only when there are absolute needs to do so:

Supplementary Actions

Description

push:var

Put the record (in the named BEE Variable array) back to the database so that it can be retrieved as the next record. The "Pushed in" record will be cleared everytime a new query or a seek operation is performed.

nextseq:[seq]

Get the next sequence for insert-key generation.  The result is stored in the variable dbobj%lastseq.

Please note that not all database platforms support automatic key generation.  For those that do, the implementation may be very different.

Some database platforms generate a new key value implicitly whenever a record is inserted, and allow you to the generated key without affecting its value (like MySQL).

Some others only allow you to get the key value from a sequence name (the seq argument) and a new value is generated every time it was accessed (like mSQL).  The sequence name is usually the table name (but does not have to be).  Therefore, the table name in dbobj%table is the default seq.

(Please note that accessing to the variable dbobj%lastseq will not cause a key generation as the variable is only a buffer holding the sequence returned by the action "nextseq".)

The behaviour of "nextseq" is platform dependent and it is dangerous to use it in the insert statement as two processes may get the same value if the platform does not generate a new key every time it was accessed.  It is recommended to insert via the "insert" action, instead of an explicit SQL insert statement via the "query" parameter, unless you know exactly what you're doing and have the need to do so.

 

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd