Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP: Assigning a high-length VARCHAR2 to a low-length one
In article <861dsa$o2p$1_at_news1.tele.dk>,
"Peder" <peder.pedersen_at_fillmbyen.com> wrote:
> Hello,
>
> Could anyone please help me with a small problem:
>
> I need to assign v1 to v2, where v1 is VARCHAR2 with a greater length
than
> v2. Is this possible? An error is raised when I attempt.
>
> If this is not possible, is there a way to extract the n leading
characters
> of a VARCHAR2 string?
>
> Thanks in advance,
>
> Peder
>
>
Use a substr function in your select:
select substr(column,start,length) from .....
DDC2> select substr('TOMMYBOY',1,3) from dual;
SUB
---
TOM
The available list of functions and their usage is covered in the SQL
manual.
--
Mark D. Powell -- The only advice that counts is the advice that
you follow so follow your own advice --
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Jan 18 2000 - 08:44:54 CST
![]() |
![]() |