Update Statement
The fourth option in the code wizard is the 'add update statement', this option creates the program code to update an existing record of a table.
Step 1 | Set the cursor at the place in your code where you want to insert the new code lines. |
|
Step 2 | Start the code wizard. This can be done by clicking the right mouse button and choosing "Code Wizard" from the popup menu, or by using the shortcut "Ctrl+W". |
|
Step 3 | Choose "Update statement" and click "Next". |
|
Step 4 | Choose the table query/queries you wish to update, and click 'Next'.
|
|
Step 5 | After selecting the 'Table Query', the fields of the table are listed for selection. The fields can be individually selected by checking the required check boxes, or the button 'Select all' used to select all fields. Once the fields are selected, click the 'Finish' button.
|
|
Step 6 | The selected fields are added in the code editor, together with the update command for those fields. These are added at the position where the screen cursor was when the code wizard was started.
gtq_customer.city :=
gtq_customer.country_code := gtq_customer.cust_no := gtq_customer.lastname := gtq_customer.postcode := gtq_customer.street := gtq_customer.tel_no := gtq_customer.update (city, country, cust_no, lastname, postcode, street, tel_no) If all the fields were selected, then all the fields of the table are added in the code editor, ready for values to be assigned, together with the table query update command, which has an asterisk to update all the fields, e.g. 'gq_new.update (*)'. |