|
SQL | Data Entry and Modification |
SELECT
with a WHERE
clause. These are:SELECT
statement
which is part of the command.DELETE FROM [tabfile.] | [database.] name [WHERE condition] [COMPILE_ONLY]Deletes rows or views from tables and records from databases.
Specify record name, record number or the keyword CIR as a database record name. If a database name is not specified, the default database is used. Specify a table or a view and the tabfile name. If the tabfile name is not specified, the default tabfile is used.
WHERE
WHERE
defines the set of records to be deleted.
COMPILE_ONLY
Compiles the command and checks for syntax errors but does not
perform the deletions.
ENTER INTO
ENTER INTO [tabfile.] | [database.] name
[ LABELS ]
[ LENGTH n ]
Prompts for data from the screen to enter new records or rows interactively. It
is recommended that one of the other SIR/XS facilities such as
FORMS or
VisualPQL is used for interactive data entry
for all but the most trivial instances.
Specify record name, record number or the keyword CIR as a database record name. If a database name is not specified, the default database is used. Specify a table or a view and the tabfile name. If the tabfile name is not specified, the default tabfile is used.
SQL prompts for the values of each variable. After the last value for one record or row, SQL prompts again for an entry into the first variable of the next record or row. Finish input at any time with the Cancel button. This cancels the current record and terminates the process.
ENTER INTO
creates new records or rows. It does not allow the
updating of existing data. If a record with the same key as an existing record
is entered, it is rejected. If a row with the same values in a unique index as
an existing row is entered, it is rejected. If a record or row is rejected the
process is terminated.
LENGTH
INSERT INTO [tabfile.] | [database.] name [(variable list, ...)] VALUES (value_list) | SELECT statement [COMPILE_ONLY]Inserts rows into tables and records into databases. The inserted rows or records are created by the
SELECT
clause.Specify record name, record number or the keyword CIR as a database record name. If a database name is not specified, the default database is used. Specify a table or a view and the tabfile name. If the tabfile name is not specified, the default tabfile is used.
The variable list specifies the variables or columns. This must match the
columns created by the SELECT
. If the variable list is
omitted, all variables defined for the record or row are expected.
INSERT INTO
variable list.
Specify strings in single quotes.SELECT
SELECT
retrieves data from other tables or record
types and this data is then used to create the specified rows or records. Any
valid SELECT
can be used as the source of values for the
insert operation. The variables that are in the SELECT
list
must match in type, length and order with the INSERT INTO
variable list.COMPILE_ONLY
INSERT
command to be compiled but not
executed. It is used for checking syntax.SELECT
, and some new
employees are to be added:SELECT * FROM EMPLOYEE ON MYTABLE WHERE GENDER EQ 1 INSERT INTO MYTABLE - SELECT * FROM EMPLOYEE WHERE GENDER EQ 2
UPDATE [ tabfile.] | [ database.] name SET variable_name = expression, ... [ WHERE logical condition] [ COMPILE_ONLY ]Updates existing rows or records in a table or database. Specify record name, record number or the keyword CIR as a database record name. If a database name is not specified, the default database is used. Specify a table or a view and the tabfile name. If the tabfile name is not specified, the default tabfile is used.
The
The WHERE clause
specifies the rows or records to be updated.
SET
statement lists the variables to update.
Separate each variable name or expression with a comma.COMPILE_ONLY
Specify to compile the
UPDATE
command but not to
execute it, for checking syntax before updating data.
UPDATE MYTABLE SET SALARY = SALARY * 1.1, CURRDATE = TODAY(0)