This tutorial describes how to insert a row into a table.
You can insert a single row or several rows in a table. To insert several rows the SQL statement needs to be called in a loop until the condition is satisfied.
The high level steps for inserting a row into a table are shown here:
Configure the SQL statement.
Execute the statement.
An
Configure the SQL statement
Declare the necessary literals as shown and instantiate an object of the
Prepare the SQL statement for execution.
Get the index of each of the parameters with the given name and bind it with the text and integer value respectively.
Execute the statement
Note
To add several rows to a data table you need to call an INSERT statement within a loop. The following example inserts rows containing numbers 1 to 10 into the countries database. Steps 1 and 2 of the above list remain the same. The remaining steps are as shown below:
Get the index of the parameter.
Iterate the loop 10 times by binding the integer value of the variable i with the parameter. Then execute the
Inserting a Row into a Table - This document
You +can insert a single row or several rows in a table. To insert several rows +the SQL statement needs to be called in a loop until the condition is satisfied.
The +high level steps for inserting a row into a table are shown here:
Configure the SQL statement.
Execute the statement.
An
Configure +the SQL statement
Declare the necessary
+literals as shown and instantiate an object of the
Prepare the SQL statement +for execution.
Get the index of each +of the parameters with the given name and bind it with the text and integer +value respectively.
Execute +the statement
Execute the SQL statement to insert a record.
Close +the SQL statement.
Note
To +add several rows to a data table you need to call an INSERT statement within +a loop. The following example inserts rows containing numbers 1 to 10 into +the countries database. Steps 1 and 2 of the above list remain the same. The +remaining steps are as shown below:
Get the index of the +parameter.
Iterate the loop 10
+times by binding the integer value of the variable i with the parameter. Then
+execute the
Inserting +a Row into a Table - This document