[EE] When inserting a record using parsing, you must supply a value for each column to add data to.
A value in the VALUES clause for each column named in the INSERT command’s column list must be provided.
If a column has a default value, the keyword DEFAULT may be used as a value on the VALUES clause.
The image below shows a sample SQL INSERT command using parsing.
Each column is separated by commas. Next is the values keyword that is followed by the three values to be added to the table.
The values in the second set of parenthesis should correspond with the column names in the first set of parenthesis.
Run Time prompting (‘?’) can be used in place of any hard coded value. Running this INSERT command will only display the
values you choose in the INSERT command.
Only the three fields and their values that were specified in the INSERT command will be added.
Using parsing allows users to only enter the information they want added to the record.
In the event that there is a required field in the table into which you are inserting records, you will
have to be sure to give the required field a value or else an error will occur.
In this example, an associated Insert operation includes data from another Row by using the ??FIELDNAME snipit.
insert into WOWSAMP.HANDLINGEVENT (EventType, cargoId, completionTmsp, eventid, locationId, registrationTmsp, voyageid) values ( ?, ??cargoid, ?, ?, ?, ?, ??voyageid)