Example Of Replace; Right Function; Examples Of Right - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Example of REPLACE

Use the REPLACE function to change job descriptions so that occurrences of the company
name are updated:
SELECT jobdesc FROM persnl.job;
Job Description
------------------
MANAGER COMNET
PRODUCTION
ASSEMBLER COMNET
SALESREP COMNET
SYSTEM ANAL COMNET
...
--- 10 row(s) selected.
UPDATE persnl.job
SET jobdesc = REPLACE (jobdesc, 'COMNET', 'TDMNET');
Job Description
------------------
MANAGER TDMNET
PRODUCTION
ASSEMBLER TDMNET
SALESREP TDMNET
SYSTEM ANAL TDMNET
...
--- 10 row(s) selected.

RIGHT Function

The RIGHT function returns the rightmost specified number of characters from a character
expression.
RIGHT is a Neoview SQL extension.
RIGHT (character-expr, count)
character-expr
specifies the source string from which to return the rightmost specified number of characters.
The source string is an SQL character value expression. The operand is the result of evaluating
character-expr. See
count
specifies the number of characters to return from character-expr. The number count must
be a value of exact numeric data type with a scale of zero.

Examples of RIGHT

Return 'Smith':
RIGHT ('Robert John Smith', 5)
Suppose that a six-character company literal has been concatenated as the first six characters
to the job descriptions in the JOB table. Use the RIGHT function to remove the company
literal from the job descriptions:
UPDATE persnl.job
SET jobdesc = RIGHT (jobdesc, 12);
COMNET
TDMNET
"Character Value Expressions" (page
208).
RIGHT Function
391

Advertisement

Table of Contents
loading

Table of Contents