Home

Adding a Record to a Table

   

Description

To visually add a value to a table, open it in the Datasheet View, click the cell of the column and type or select the value.

The SQL formula to add a new record to a table is:

INSERT INTO TableName VALUES(Column1, Column2, Column_n)

Consider the following table:

CREATE TABLE Employees
(
    EmployeeID Integer,
    FirstName Text(20),
    LastName Text(20),
    HourlySalary Currency
);

Here is an example of adding a new record to the above table:

INSERT INTO Employees
VALUES(10, 'Eugenie', 'Dieky', 16.82);

The above formula anticipates that there will be a value for each column. As alternative, you can open parentheses after the name of the table and add the list of columns whose values you want to provide. Then, in the parentheses of VALUES, provide the values in the order of the columns after the name of the table. Contsider the following table:

DROP TABLE Employees;
CREATE TABLE Employees
(
    EmployeeID Counter,
    FirstName Text(20),
    LastName Text(20),
    HourlySalary Currency
);

Here is an example of adding a new record to the above table:

INSERT INTO Employees(LastName, FirstName, HourlySalary)
VALUES('Bayala', 'Laurent', 20.24);
 
 
     
 

Home Copyright © 2010-2012 FunctionX Home