Re: Long to varchar2?

From: Neill Atkins <neill_at_firstwrd.demon.co.uk>
Date: 1996/06/16
Message-ID: <ymWCoBAiwFxxEwga_at_firstwrd.demon.co.uk>#1/1


In article <4ppj0m$fnq_at_inet-nntp-gw-1.us.oracle.com>, Scott Urman <surman_at_oracle.com> writes
>In article <4ppgnr$fij_at_rzsun02.rrz.uni-hamburg.de>, 3bohlman_at_rzdspc5.informatik.
>uni-hamburg.de (Holger Bohlmann) writes:
>|> Hello,
>|>
>|> is there anybody out there, who knows, how I can convert a
>|> LONG-Value in a VARCHAR2-Value (in Oracle?). Is it possible
>|> to do that?
>|>
>|> Holger Bohlmann
>|>
>First of all, the LONG would have to be less than 2000 characters, since that
>is the maximum length of a VARCHAR2. The best bet would be to use PL/SQL.
>Something like:
>
>DECLARE
> v_LongVal LONG;
> v_VarcharVal VARCHAR2(2000);
>BEGIN
> SELECT ...
> INTO v_LongVal
> FROM ...;
> v_VarcharVal := vLongVal;
> INSERT INTO ... VALUES (..., v_VarcharVal);
>END;
>
>Or you can just select into the VARCHAR variable directly from the LONG column,
>which will do the conversion implicitly.
>

Won't work between two databases and sqlnet ..

Neill Atkins
Portsmouth, UK. neill_at_firstwrd.demon.co.uk Received on Sun Jun 16 1996 - 00:00:00 CEST

Original text of this message