Back Previous Next


Linguist data package - create

Syntax:

	create table for {record}
	create {record} where
		field {fieldname} is {value}
		[...]

Keyword handler:

   net.eclecity.linguist.data.keyword.DataKCreate.class

Runtime handler(s):

   net.eclecity.linguist.data.handler.DataHCreate.class

Function:

Creates either a new table or a record for an existing table.

The first of these takes a defined record and uses it to create a new, empty table, first deleting any existing one of that name (the name is defined in the specification that also defines the fields of the record). Note that the table is not created directly from a specification but from a record having that specification.

The second form creates a new record using the information given. You must provide values for a unique ID field - which may be of any type but is always called id - but the remainder of the field values can be added later if necessary. In the second example below, the Name and Email fields are taken from buffers in the program, but the rest are all parameters of an HTTP GET or PUT command in a servlet. The assumption here is that the field values have all come from an HTML form filled in by the user of a browser.

The new record will be added to the local record cache, but no changes will be made to the SQL database until the commit command is given.

Example(s):

   create table for Customer
   create Customer where
      field "id" is the millisecond
      field "name" is Name
      field "email" is Email
      field "company" is parameter "company"
      field "address" is parameter "address"
      field "district" is parameter "district"
      field "city" is parameter "city"
      field "state" is parameter "state"
      field "postcode" is parameter "postcode"
      field "country" is parameter "country"
      field "phone" is parameter "phone"
      field "fax" is parameter "fax"
      field "vat" is parameter "vat"


Back Previous Next the field specifed of record {record}.