Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Newbie : PL/SQL Function Return value
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
![]() |
![]() |