Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > E

EDIT (Short Name: EDI)

Scroll Prev Top Next More

Use the EDIT command to change data in the Data Editor/Browser.

 

EDIT

 

Options

 

*

Specifies all columns.

 

,

Indicates that this part of the command is repeatable.

 

(expression)

Determines a value using a text or arithmetic formula. The expression can include other columns from the table, constant values, functions, or system variables such as #date, #time, and #pi.

 

ALL

Specifies all columns.

 

AS alias

Determines the alias of the column.

 

colname

Specifies a column name. The column name is limited to 128 characters.

 

DISTINCT

Suppresses the display of duplicate rows. If you specify DISTINCT, you cannot change the data that is displayed.

 

EXCEPT colname

Specifies column names to be excluded from the Data Browser. The EXCEPT clause is helpful with tables which have many columns, to exclude columns from the result set. EXCEPT saves time to avoid typing a long list of column names. When using EXCEPT there can only be one table specified.

 

FROM tbleview

Specifies the table.

 

MDI

Specifies a modeless Data Editor window, where other windows within R:BASE can be accessed without closing the current Data Editor window first. This option is used in R:BASE for Windows only.

 

NOCHG

Prevents changes to the issued EDIT command and stops users from reaching additional data by adding columns to the command or changing the command's WHERE clause with the Update Query menu option. NOCHG is particularly useful when the EDIT command is issued within an application or command file.

 

ORDER BY clause

Sorts rows of data. For more information, see ORDER BY.

 

=READ

Specifies that the column is read-only, preventing changes to data.

 

WHERE clause

Limits rows of data. For more information, see WHERE.

 

OPTION parameters - provides the ability customize the Data Editor Window. These enhanced parameters are supported at the R> Prompt, in command files, EEPs and stored procedures.

 

OPTION Parameters

Value

Description

CAPTION

value

specifies the window caption

CELL_HINTS

ON (Default)

OFF

specifies if NOTE column cell hints are displayed

COLUMN_WIDTH[x] y

values

specifies the column width for a column, where X is the zero-based column index and Y is the width in pixels

CURRENT_FIELD_VALUE_VAR

value

specifies to capture the field value for the current focused cell

CURRENT_FIELD_VAR

value

specifies to capture the column name for the current focused cell

EXPORTRESULT

ON (Default)

OFF

specifies if the "Export Result to->" menu item is available

GRIDVIEW


specifies the "View as Grid" mode is displayed

HEIGHT

value

specifies the window height, in pixels

IMAGE_HINT

ON (Default)

OFF

specifies if image hints are displayed

LEFT

value

specifies the window location, in pixels, from the left of the screen over

LOCK

nnn

specifies to lock a number of columns

MODAL

ON (Default)

OFF

specifies if the window is modal or non-modal. With the MODAL set to OFF, the Data Editor window displays as a separate button on the Windows task bar.

NO_FOCUS_FIELDS

value

specifies columns that cannot receive focus. The value is a comma separated list of columns.

ON_CELL_CLICK_EEP

value

specifies to execute the EEP command file when a cell is clicked

ON_CELL_DBL_CLICK_EEP

value

specifies to execute the EEP command file when a cell is double-clicked

PRINTDATA

ON (Default)

OFF

specifies if the "Print Data" menu item is available

READONLY

ON

OFF

specifies if the data is read only

ROW_NUMBERS

ON

OFF (Default)

specifies if a record number is displayed (column to the far left)

ROWVIEW


specifies the "View as Row" mode is displayed

ROW_VIEW_DESCRIPTIONS

ON

OFF (Default

specifies to display the column comments from the table definition (when present) to the right of the data, when ROWVIEW mode is specified

SAVERESULT

ON (Default)

OFF

specifies if the "Save Data As->" menu item is available

SAVERESULTTEMPONLY

ON

OFF (Default)

specifies if the "Save Results As->" menu items are available for both permanent and temporary tables/views

TOP

value

specifies the window location, in pixels, from the top of the screen down

TREEGRIDVIEW


specifies the "View as Tree Grid" mode is displayed

UPDATE_QUERY

ON (Default)

OFF

specifies if the query can be updated

WIDTH

value

specifies the window width, in pixels

WINDOW_STATE

MAXIMIZED

NORMAL

MINIMIZED

specifies the windows state

ZEBRA_STRIPE

ON

OFF

specifies if zebra stripes are displayed

 

About the EDIT Command

 

The EDIT command starts the Data Editor and displays the data you specify. In a multi-user environment, R:BASE checks whether the row of data you are editing has been changed by another user and notifies you if it has - this is called concurrency control.

 

You can use the EDIT command to modify data when the following conditions are met:

 

You have not used the DISTINCT option in the command.

You have rights to change the data in the specified table. Access rights are assigned with the GRANT command.

 

Notes:

 

The EDIT command will display the data within a multi-table view (a view based on multiple tables), but the data will not be editable.

A view with a GROUP BY parameter is also not editable.

 

Examples

 

Example 01:

 

The following command displays all columns in the transmastertable and orders the rows by the customer identification numbers contained in the custid column.

 

EDIT * FROM transmaster ORDER BY custid

 

Example 02:

 

The command below displays the following columns from the customertable: custid, company, custaddress, custcity, custstate, and custzip. The only rows that are displayed are rows that have 100 for a customer identification. The custid and company columns are specified to be read-only and cannot be edited.

 

EDIT custid=READ, company=READ, custaddress, custcity, +

custstate, custzip FROM customer WHERE custid = 100

 

Example 03:

 

The following command open all records for the Customer table with a maximized Data Editor window and "Customer Data" as the caption.

 

EDIT ALL FROM customer OPTION WINDOW_STATE MAXIMIZED|CAPTION 'Customer Data'

 

Example 04:

 

The following will start the Data Editor for custid 125, displaying the data as a single row in read only mode.

 

EDIT ALL FROM customer WHERE custid = 125 OPTION WINDOW_STATE NORMAL|ROWVIEW|READONLY ON

 

Example 05:

 

The following opens the Data Editor for the Customer table, with a limited height and width, and is located near the top left corner of the screen.

 

EDIT ALL FROM Customer +

OPTION WINDOW_STATE NORMAL +

|TOP 25 +

|LEFT 25 +

|WIDTH 1000 +

|HEIGHT 500

 

Example 06:

 

The following opens the Data Editor for active customers in the Customer table, with column alias names, a custom caption, and specified column widths for three that contain shorter data lengths.

 

EDIT +

CustID AS `Customer ID`, +

Company AS `Company Entity`, +

CustAddress AS `Home Office Address`, +

CustCity AS `Home Office City`, +

CustState AS `Home Office State`, +

CustZip AS `Home Office Zip Code`, +

CustPhone AS `Primary Phone Number`, +

CustFax AS `Fax Number`, +

LastUpdateDate AS `Last Date Modified`, +

LastOrderDate AS `Last Order Date`, +

CustURL AS `Company Home Page`, +

CustEMail AS `Primary Email Address`, +

CustStatus AS `Active Status`, +

PaymentTerm AS `Payment Terms`, +

CreditLimit AS `Imposed Credit Limit` +

FROM Customer +

WHERE CustStatus = 'A' +

ORDER BY Company ASC +

OPTION CAPTION 'Active Customer Information'+

|WINDOW_STATE NORMAL +

|COLUMN_WIDTH[4] 50 +

|COLUMN_WIDTH[5] 50 +

|COLUMN_WIDTH[12] 50

 

Example 07:

 

The following opens the Data Editor for contacts with email addresses in the Contacts table, and launched the CellDblClick.rmd command file when a cell is double clicked.

 

EDIT CustID,ContFName,ContLName,ContEMail FROM Contact +

WHERE ContEMail IS NOT NULL +

OPTION ON_CELL_DBL_CLICK_EEP CellDblClick.rmd

 

Example 08:

 

The following opens the Data Editor for California customers in the Customer table, and captures the column name and value wherever the focus is upon a cell.

 

SET VAR vCurFieldName TEXT = NULL

SET VAR vCurFieldValue TEXT = NULL

EDIT CustID,Company,CustCity,CustState,CustZip FROM Customer +

WHERE CustState = 'CA' +

OPTION CURRENT_FIELD_VAR vCurFieldName +

|CURRENT_FIELD_VALUE_VAR vCurFieldValue