Please enable JavaScript to view this site.

R:BASE 11 Beginners Tutorial

Navigation: Lesson 7 - Using R:BASE Commands

Using R:BASE Commands at the R> Prompt

Scroll Prev Top Next More

First, you need to open a database in order to use the R:BASE commands in this section. If you are not connected to the database, do so now.

 

1.At the R> Prompt, enter "CONNECT SkyWrite"

 

R:BASE displays "Database Exists" and then returns the R> Prompt.

 

R:BASE is now connected to the database.

 

To find the correct syntax for a command, you can look it up in the Command Index, or use the R> to launch the help as described earlier, by typing "HELP" followed by the command name.

 

If an incorrect spelling for a command is entered, the error message "Unrecognized command - retype it" is displayed. If any invalid parameters or invalid sequence is entered, the error message "Syntax is incorrect for the command" is displayed.

 

2.At the R> Prompt, enter SELECT and press [ENTER].

 

R:BASE displays an error message.

 

Commands that operate with a single word, such as CLS or EXIT, obviously will not generate the error message using this method, but all commands requiring more than one word will.

 

If you know the correct syntax, you simply type the command and its parameters at the R> Prompt.

 

3.Enter SELECT ALL FROM Customer

 

R:BASE displays as many columns from the table Customer as will fit on the screen, and will prompt you to continue if more output follows.

 

R:BASE remembers the last command line you entered so that you can easily repeat the last command if you want. You can also add to or edit the command once it is redisplayed.

 

4.Press the [Page Up] key.

 

R:BASE displays SELECT ALL FROM Customers and the cursor is positioned at the end of the line. To edit the command, you use the left-arrow key to move the cursor to where you want to edit. You use the [Insert] key to add characters or use the [Delete] key to delete characters, or you can overwrite existing characters. The cursor will appear differently based on whether the Insert or Overwrite is specified for the keyboard. When Insert is in use, the cursor will blink as a block. When Overwrite is in use, the cursor will blink as an underscore.  

 

5.Press the left-arrow key until the cursor is positioned on the "A" of the word ALL.
6.Press the [Delete] key three times to delete the word ALL.
7.Make sure the cursor is a block character by pressing the [Insert] key.
8.Enter CustomerCompany
9.Press the [End] key to go to the end of the command line and then press [ENTER].

 

R:BASE displays only the column CustomerCompany from the table Customers.

 

Commands that display data from a database can use the WHERE and ORDER BY clauses. The WHERE clause sets conditions by which to display the information, and ORDER BY indicates the order to display it.

 

10.Press the [Page Up] key to retrieve the command line.

 

Enter a space, then WHERE CustomerCompany LIKE 'C%' ORDER BY CustomerCompany DESC followed by the [Enter] key.

 

The WHERE clause restricts the rows displayed to those companies whose names begin with C. The % following the C is a wildcard character which means any next characters. This character is the same as the * wildcard used in DOS operating system commands. The ORDER BY clause sorts the data descending by the company name.

 

After entering each of the commands, note that the Command History panel stores all of the commands entered. To reenter any command listed in the Command History panel, double click on it. To display the command at the Input Console, select it.