Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PLSQL and substr problem

Re: PLSQL and substr problem

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Mon, 23 Aug 1999 21:38:56 +0200
Message-ID: <935437167.3021.0.pluto.d4ee154e@news.demon.nl>


Delete from table X
where exists
(select 'x' from table Y
 where y.column_name like substr(x.column_name,1,7)||'_' )
This should be all, no need to use a loop.

Hth,

Sybrand Bakker, Oracle DBA

M.Jord <mjjugs_at_gofree.indigo.ie> wrote in message news:eNfw3.3884$r4.2249_at_news.indigo.ie...
> I am trying to select the first seven char of a 8 characters column within
a
> large
> table.
> & then compare this with existing seven digit numbers.
> If there is a match then I need to delete the seven digit numbers.
>
> I have used a loop and substr(col.name,1,7) to select the digits into a
> cursor, and tried to compare this to a 2nd cursor which contains the 8
> digits.
> Can anyone help me write the pl/sql script to do this
> task.
> eg
>
> Table X
>
> Herd no
> A1093459
> A109345 >for deletion
> B2062768
> B206276 >for deletion
>
>
>
>
>
>
Received on Mon Aug 23 1999 - 14:38:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US