DISC

Contents | What's New | Quick Links

 

SQL Functions

Introduction

Software Installation

Concepts and Design

Designing Applications

Omnidex Environments

SQL Reference

Omnidex API's

Utilities

Interfaces

Performance Guide

Troubleshooting Guide

Appendix

 

 

SUBSTRING

 

The SUBSTRING function returns a new character string that is a substring of another string. The new string begins at the specified starting point in the original string (string1) and extends the number of characters specified in the length parameter. If the length parameter is omitted, the new string extends to the end of the original string.

The return datatype is C STRING.

Syntax

Example

SQL Reference

Commands

Functions

 

Syntax

SUBSTRING(string1 FROM start [FOR length]))

SUBSTRING(string1,start,length) is supported in Omnidex SQL Plus ONLY.

SUBSTRING

Required.

string1

Required. This is the string that contains the characters that will be returned.

FROM

The FROM keyword is required.

start

Required. start is an integer indicating the position of the first character relative to 1 that will be returned.

FOR length

Optional. This indicates the number of characters after and including the start character, that will be returned. If omitted, all of the remaining characters after and including the start character will be returned.

top

 

Example

SUBSTRING(PRODUCTS.PRODUCT_NO FROM 2 FOR 3)

The character position index begins with 1. If the product_no is ASUP93541, the above example would return SUP.

select product_no,

SUBSTRING(PRODUCTS.PRODUCT_NO FROM 2 FOR 3),
SUBSTRING(PRODUCTS.PRODUCT_NO FROM 5

from products

Product_no

 

 

ASUP93541

SUP

93541

BPRI54687

PRI

54687

 

 

 

top

Dynamic Information Systems Corporation - Omnidex Version 3.8 Build 6 J15.03-Copyright © 2003

DISC | Documentation Home