Update. DORIC 9.65, INFO-Text software
Pubblicità
Pubblicità
UPDATE
UPDA
TE [DF_item_1 [,DF_item_2.]] [
BY
DF_item [
ORDE
RED
]] syntax cont’d
[BY DF_item [
ORDE
RED]] [PROMPT] [,
S
]
UPDA
TE [
B
Y DF_item [
ORDE
RED]] [WITH IF_name [
AL
AY
[
NC
]
LN
[
NC
]
NC
]]
allows you to change individual item values within selected records in the selected data file and to optionally update records using an input form.
arguments
DF_item_1 [,DF_item_#...] the name of the item or items whose values will be changed.
[BY DF_item] identifies an item whose values are the basis INFO uses to determine which selected records are chosen for updating.
[ORDERED] specifies that the selected records are sorted on the item specified in the BY option.
[PROMPT] When PROMPT is specified, INFO issues a separate prompt for each item whose values are being updated, for each record located for updating.
[,S] suppresses the initial display of the item values in the record located for updating. If used following the
PROMPT or ORDERED option, the S option must be preceded by a comma.
WITH IF_name [AL | AY [NC] | LN [NC] | NC] you can use an input form to display the values for each record that you want to update. Options for suppressing the prompt and clearing the screen are available. See the
INPUT FORM command for more information about executing an input form.
INFO Reference Manual Commands 551
UPDATE
WITH IF_name identifies the input form that INFO uses to display each record and to accept new item values for that record. The form must exist in your INFO user area.
AL (Automatic Leave) suppresses the IS THIS RECORD
ACCEPTABLE? prompt and automatically accepts the item values in the record just displayed or updated, but does not clear the screen at the end of the record.
AY (Automatic Yes) suppresses the IS THIS RECORD
ACCEPTABLE? prompt, assumes a response of Y and clears the screen after you finish viewing or updating a record, unless the NC option is included. You cannot use the AY option when the first field of an input form is defined as forced (F subcommand).
LN displays the IS THIS RECORD ACCEPTABLE?
prompt and waits for a response of L or N (leave or not accept). If you enter Y or <RETURN>, INFO assumes a response of L. If you enter Q, INFO displays an error message and reissues the prompt.
NC (No Clear) does not clear the screen after the item values in the record have been displayed or updated, regardless of the response to the message IS THIS
RECORD ACCEPTABLE? If the WITH option specifies a multi-screen input form, INFO displays the first screen of the form after each record is entered.
note discussion
n
An unqualified UPDATE command causes INFO to prompt you for the record number of each record you wish to update. Specify the record number of the record you wish to update. INFO displays the current values of every item in the record being updated. You may change the value of any item in that record.
The UPDATE command allows you to change individual item values in selected records. INFO prompts you to identify individual records to be updated. You identify records either by specifying a record number or by specifying a particular item value that a record has.
552 Commands INFO Reference Manual
UPDATE
Updating by record number
Updating by item value
If you use the UPDATE command without options, INFO prompts you with RECNO?> to enter the record number of the record you want to update. When you enter a record number, INFO displays the values of every item in the record or of every specified item for that record. INFO then displays the prompt ?> and waits for you to enter a new value for any item in the items list. You specify a new item value as follows:
>?DF_item=value
DF_item is the item name of the item whose value you want to change, and value is the new item value assigned for that individual record.
When you have completed changing item values in a particular record, enter <RETURN> at the ?> prompt.
INFO prompts you again with RECNO?>. You can enter another record number and update another record. When there are no more records that you want to update, enter
<RETURN> at the RECNO?> prompt. You then return to
ENTER COMMAND > level
If you use the BY option in the UPDATE command, INFO displays the prompt BY_item?> (where BY_item is the item specified in the BY option) and waits for you to enter an item value. INFO searches the selected records for the next record that has that item value. When such a record is found, INFO displays all the current item values or only the values specified in the items list for that record, displays the prompt ?> and waits for you to specify a new value for an item in that record. You specify a new value for an item as shown above.
When you have completed changing item values in a particular record, enter <RETURN> at the ?> prompt.
INFO then prompts you again with BY_item?>. You can specify another value to use in locating another record for updating. When you update all the records you want, enter <RETURN> at the BY_item?> prompt. You then return to ENTER COMMAND > level.
INFO Reference Manual Commands 553
UPDATE
Features when updating by record number or by item value
In the UPDATE command line, if you accompany the BY option with the ORDERED option, INFO assumes that the selected records are sorted on the BY_item and uses a binary search to locate the next record for updating.
If you include the PROMPT option in the UPDATE command, INFO prompts separately for each item or each item in the items list. That is, INFO displays the name of the item being updated instead of the ?> prompt. Respond to each DF_item> prompt by entering only a value, not
DF_item=value.
If you include the S (suppress) option in the UPDATE command, INFO does not display the current item values before the prompt. However, at the next RECNO?> or
BY_item?> prompt, you can specify that the item values be displayed in the next record located for updating.
Follow the record number or item value response with the current delimiter character and the letter D as follows:
RECNO?>3,D
or
CUSTOMER>JONES,D where a comma (,) is the current DELIMITER character.
If you include both the PROMPT and S options in the
UPDATE command line and you include a D as part of your response to the RECNO?> or BY_item?>, INFO prompts you for new item values according to the operation of the PROMPT option.
At the RECNO?> prompt, if you specify the record number of a data file record that is not selected, INFO locates the next selected record whose record number is greater than
554 Commands INFO Reference Manual
UPDATE
the record number you specified. For example, if you specify record 1 for updating and only records 5 through
10 are selected at the time you enter the UPDATE command, INFO locates and displays record 5 for updating.
At the RECNO?> prompt, specify = to retrieve the next selected record for updating.
At the BY_item?> prompt when the BY_item is C-type, you can specify a partial value. INFO searches the C-type
BY_item in the records for a match based on the partial item value.
Once you have specified a value at a BY_item?> prompt, if you specify = at a subsequent BY_item?> prompt,
INFO locates the next selected record that matches the value originally specified.
At the ?> or BY_item?> prompt, you can enter the CCHR setting's BACKTAB character to display the previous item value allowing you to re-enter a value.
At the ?> prompt, specify = to repeat the display of the record's item values.
At the ?> or BY_item?> prompt, to update more than one item value using one entry, separate DF_item=value entries with the current DELIMITER character. For example, when the slash (/) is the current DELIMITER character:
?>PART-NUM=1234/CUSTOMER=JONES
At the ?> prompt, when updating the value of a C-type item, type the value immediately after the equal sign (=).
Any blank spaces are included as part of the new item value.
INFO Reference Manual Commands 555
UPDATE
Updating using an input form
Updating A type Items
Another way to use the UPDATE command is to specify that an INFO input form be used to control which items are updated. This is most useful when the records being updated were originally entered using an input form, so that similar data validation procedures (or even the same input form) must be used when updating those records.
If you specify the WITH option, INFO clears the screen and prompts you with RECNO?> or BY_item?> on line 1.
For each record that you update, INFO executes the named input form once, displaying the current value of each item named in the input form. Note that INFO ignores any S (Store) subcommands in the input form when displaying the current item values for a particular record. Once the input form is executing:
To preserve an item value, enter an equal sign (=) or the
TAB character in response to the prompt for that value
To change an item value, enter the new value
For complete information about using input forms, see
'Executing an existing form' in the INPUT FORM command.
Updating A-type items divides into two catagories
— changing the name of the text file the record points to, and changing the text in the text file. INFO-Text allows you either capability. You access A- type items just as you access other datafile items to be updated — using either the reselect dialog or the WITH input form option.
You can change the name of the text file mentioned in an
A-type item only by redefining the item as a C-type item and then updating the file name as a C-type item. INFO-
Text then references the new file as part of the record.
See the REDEFINE command for details.
To update the text file, either from a ?> prompt or as part of the processing of an input form, enter a space and press <RETURN>. INFO Text puts the text file into the editor for you. Make the desired changes. When finished, press the <FILE> key and then the REFILE option on the menu. INFO-Text saves the file as changed, and returns you to the UPDATE dialog or to the input form.
556 Commands INFO Reference Manual
UPDATE
To avoid saving the changes, select the NOSAVE option.
INFO-Text returns you to the update dialog or to the input form.
example
ENTER COMMAND >SELECT D.EMPS
5 RECORD(S) SELECTED
ENTER COMMAND >UPDATE S
RECNO?>3
?><RETURN>
RECNO?>3,D
L.NAME
F.NAME
TITLE
SSN
ADDRESS.1
?>SSN=888888888
RECNO?><RETURN>
Suppresses the initial display of the item values for each record you update.
Display this one only.
3
=DOLITTLE
=ELIZA
=SPEECH THERAPIST
=999999999
=LONDON UK
INFO Reference Manual Commands 557
Scarica
Pubblicità