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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Newbie : PL/SQL Function Return value

Re: Newbie : PL/SQL Function Return value

From: Stefan Grundmann <s.grundmann_at_t-online.de>
Date: Tue, 15 Aug 2000 19:36:39 +0200
Message-ID: <8nbumg$4rg$15$1@news.t-online.com>

Hello Lee!

You have to limit to length of your function-based-columns in the related view by using Oracles function substr().

create or replace view example_view
as
select
...
substr ( your_function(...), 1, xxx ) your_column_name, ...
from
...

where xxx is the appropriate length of the column you need.

The problem is, that in Oracle the return-type cannot be limited. So the varchar2-return-type is of length 4000 (or greater, if Oracle changes that).

Stefan

Lee Staples <lee_at_cybicom.co.za> schrieb in im Newsbeitrag: 966343180.455454_at_proxy.lia.net...
> Hi. I've just started working with PL/SQL and have defined functions that
> return a string. The problem is I'm creating a view using a whole lot of
> these type of functions, and the view ends up having a large number of
> varchar2(4000) fields. How can I force the function result to have a
> specific size if it is not based on an existing field type?
>
> Thanks.
> Lee.
>
>
Received on Tue Aug 15 2000 - 12:36:39 CDT

Original text of this message

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