User talk:Davidtabb

To view a table or procedure in iSQL through unix


Table: dbschema -d hhal -t imast

Procedure: dbschema -d hhal -f rpt_usage

LENGTH function
You also can use the LENGTH, USER, CURRENT, and TODAY functions anywhere in an SQL expression that you would use a constant. In addition, with Universal Server, you can include the DBSERVERNAME keyword in a SELECT statement to display the name of the database server where the current database resides.

You can use these functions and keywords to select an expression that consists entirely of constant values or an expression that includes column data. In the first instance, the result is the same for all rows of output.

In addition, you can use the HEX function to return the hexadecimal encoding of an expression, the ROUND function to return the rounded value of an expression, and the TRUNC function to return the truncated value of an expression.

In Query 2-64, the LENGTH function calculates the number of bytes in the combined fname and lname columns for each row where the length of company is greater than 15.

Query 2-64

SELECT customer_num, LENGTH (fname) + LENGTH (lname) namelength FROM customer WHERE LENGTH (company) > 15

Laura Grace's Funny moments
On Tuesday morning the 14th of October 2008 whilst Laura is in toilet training she disappeared from Kate's sight and later Kate found a small brown present waiting for her in her new shoes in the closet.

Indenting and shifting
vi supports auto-indentation of text lines and also provides command for manual indentation. This is usefull when editing program source code. It is a common convention in many programming languages to use indentation to increase readability of the source code.

[edit] Options

The option shiftwidth (sw) determines how much space is used for indentation. E.g.

:set shiftwidth=4

or

:set sw=4

tells vi to use four spaces for indentation.

The option [no]autoindent (ai) tells vi to use auto identation or not. Auto indentation is turned on by

:set autoindent

or

:set ai

And it is turned off by

:set noautoindent

or

:set noai

Scrolling through a file
The vi scrolling commands are useful if you just want to read text sequentially. These commands are all control characters. You will not need to hit the return or enter key after typing the command. The notation ctrl-letter means hold down the control key while pressing the letter key.

* Scroll forward a page with ctrl-f * Scroll back a page with ctrl-b * Scroll forward half a page with ctrl-d * Scroll back half a page with ctrl-u * Scroll forward a line with ctrl-e * Scroll back a line with ctrl-y

Searching for text
The / and ? commands are used for locating text patterns in the text.

* Search forward for pattern with /pattern * Search backward for pattern with ?pattern * Continue search with n

The n command searches for the pattern specified in the previous / or ? command, and it searches in the same direction. You will need to hit the return or enter key to complete the / or ? commands, but not the n command.

The pattern can contain any string of characters, but some ($, ^, *, ., /, [, and ]) have special meanings. These characters should be preceded by a backslash if you need them in the pattern.

Each time you use a / or ? command, it establishes a search direction for future searches. If you want to search mainly in that direction, but occasionally go in the other direction, you can use n and N for search continuation.

* Continue search and change to the forward direction with / * Continue search and change to the backward direction with ? * Continue search in the opposite direction with N

The N command does not change the established search direction. Later n commands will search in the direction as before. You will need to hit the return or enter key to complete the / or ? commands, but not the N command. Moving the cursor The following commands are sufficient while you are getting accustomed to vi. You do not need to hit the return or enter key for any of these commands.

* move the cursor left with h   * move the cursor down with j    * move the cursor up with k    * move the cursor right with l

After you are more comfortable with the commands listed above, you will probably want to learn some other commands for moving the cursor. The following commands are useful.

* move the cursor to the top of the screen with H   * move the cursor to the middle of the screen with M    * move the cursor to the bottom of the screen with L    * move the cursor to the beginning of the following line with Enter * move to the beginning of the preceding line with -

Many UNIX compilers report errors by giving a short message about the error and telling you the line number where it occurred. vi simplifies finding the offending line with the following commands:

* move to line n with nG   * move to the last line of the file with G

Inserting text
In insert mode, most characters that you type are entered into the text in front of the cursor. As you type characters, the cursor moves to the right so that they appear in the order that you typed them. When you are in insert mode, you can add as many lines of text as you want. From command mode, you can start up insert mode with one of the following commands.

* begin inserting in front of the cursor with i   * begin inserting after the cursor with a    * begin inserting in a new line below the cursor with o    * begin inserting in a new line above the cursor with O

The i command is needed to add text to the beginning of a line. The a command is needed to add text to the end of a line. The O command is needed to add text at the beginning of the file. The o command is needed to add text at the end of the file.

When you are through with any insert mode,

* return to command mode with Esc

Deleting text
After you have positioned the cursor you can

* delete the character under the cursor with x

When you first learning vi, this is enough to know. Later, you will probably want to learn how to delete larger text objects. Undoing inserts and deletes Everyone makes mistakes. If you have erroneously inserted or deleted text, you can

* undo a single insert or delete with u

File manipulations
Many of the file manipulation commands are colon commands. You will need to hit the enter key to complete these.

* change to a different file with :e filename * return to the previous file with :e# * return to the file you started out with with :rew * quit the vi session with :q

While you are editing with vi, changes that you make do not immediately affect the file that you are editing. vi is actually just making changes in an internal copy of the file. You will need to use colon commands to write the internal copy to the file. You will need to hit the enter key to complete these commands.

* save the text with :w * save the text and quit the vi session with :wq

If you created a new file without giving a file name on the command line, you will need to supply a name before terminating the program.

* name the file and save the text with :w filename

What to do after accidental changes When browsing a file, you might accidentally enter insert mode. If you do, you can return to command mode by hitting the escape (Esc) key.

While you are using vi, changes that you make do not immediately affect the file that you are working with. vi is actually just making changes in an internal copy of the file. But when you have made changes, vi will not let you quit or switch to another file unless you either write the internal copy to the file or give an insistent version of a command. A colon command can be made insistent by adding an exclamation point (!).

* change to a different file after unwanted changes with :e! filename * return to the previous file after unwanted changes with :e!# * return to the file you started out with after unwanted changes with :rew! * quit the vi session after unwanted changes with :q!

== What to do when vi freezes up ==

There is an undocumented vi mode in which vi does not respond to any commands and does not enter typed characters into the text. You may accidently get into this mode if you forget to start an insert mode before trying to enter text. If this happens to you, you can usually get back to normal command mode by giving the command :v.