Re: Database Queries (gurus - Help needed)

From: Peter Moore <pt_at_chaff.demon.co.uk>
Date: 1995/08/19
Message-ID: <24080337wnr_at_chaff.demon.co.uk>#1/1


In article: <413mq7$8tt_at_odin.community.net> ericl_at_community.net writes:
> > try to do
> >
> > update table_name set name=substr(name,3,10)
> >
> > if your table looks like
> >
> > table_name(name varchar2(10))
> >
> > good luck !
> >
> >
> >Yong,
> >
> It looks like you are trying to update your column with 2 non-existant
> characters.
>
> The syntax for substr is:
>
> substr(column,beginning character, number of characters)
>
> To update name with the last 8 characters of name you would use:
>
> update table_name set name = substr(name,3,8)
>

To help things further, If you leave off the last parameter you get everything to the end of the field.

So you coulddo

  SUBSTR(name,3)

HTH Pete

-- 

------------------------------------------------------------------------
|  Peter Moore - Database Administrator - MAT Transport Ltd.
|  pt_at_chaff.demon.co.uk : +44 (171) 410 6373
|  "With a little study you'll go a long ways & I wish you'd start now!"
Received on Sat Aug 19 1995 - 00:00:00 CEST

Original text of this message