Syntax:
set the table name of {specification} to {name} set the fields of {specification} to {fieldname} {type} [{n}] [and ...] set the specification of {record} to {specification} set field {fieldname} of {record} to {value} set the key of {record} to {encryption key}
Keyword handler:
net.eclecity.linguist.data.keyword.DataKSet.class
Runtime handler(s):
net.eclecity.linguist.data.handler.DataHSet.class
Function:
Set attributes of a specification or a record, as follows:
set the table name of {specification} names the table in the SQL database that will be used to hold records having this specification. Before you can add records to a new table you must first create the table using a record having the appropriate specification.
set the fields of {specification} defines the fields that will be present in every record using this specification. See the example below. Each of the fields can be of type int (not shown) or char with an appropriate field width as shown. They map directly onto SQL data types of the same names.
set the specification of {record} associates a specification with a record. From this point on you can refer to fields in the record using the names given in the specification, as in the examples below.
set field {fieldname} of {record} assigns a value to a field in a record. The {fieldname} is that given for the specification used by this record. Note: Because this package uses extra application logic, setting a value has no immediate effect on the SQL database itself. Changes are only written when a commit statement is given.
set the key of {record} stores the supplied string into the record for use during encryption and decryption. See encrypt and decrypt.
Changes to field values are made only to the local, cached copies of the records. No changes will be made to the SQL database until the commit command is given.
Example(s):
set the table name of CustomerSpec to "Customer" set the fields of CustomerSpec to id long and name char 30 and email char 60 and company char 40 and address char 40 and district char 40 and city char 40 and postcode char10 and state char 10 and country char 20 and phone char 20 and fax char 20 and vat char 15 set the specification of MyCustomer to CustomerSpec set field name of MyCustomer to "Alfred E Newman" set field email of MyCustomer to "alfred@mad.com" set field company of MyCustomer to "MAD magazine" set the key of MyCustomer to "A private key"