20. Writing 4GL Statements : Database Access Statements : Using Insert to Add Data to Database Tables
 
Share this page                  
Using Insert to Add Data to Database Tables
To insert new rows of data into a database table, use the insert statement. For example, this statement adds a row to the Personnel table, transferring the contents of simple fields Lname, Fname, and Empnum to table columns last, first, and empnum, respectively:
insert into personnel (last, first, empnum) 
  values (lname, fname, empnum);
Appending values to a database table from a table field generally involves using the insert statement along with the unloadtable statement, which is described in Processing an Entire Table Field or Array with Unloadtable and unloadtable Statement--Loop Through Rows and Execute Statements. Unloadtable can also be used with arrays.