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

Home -> Community -> Usenet -> c.d.o.misc -> specifying length of return VARCHAR2

specifying length of return VARCHAR2

From: <gregory_s_at_my-deja.com>
Date: Fri, 30 Jul 1999 19:01:26 GMT
Message-ID: <7nsspv$sdk$1@nnrp1.deja.com>


I've come across a solution to the oft-quoted limitation of PL/SQL that the length of a VARCHAR2 function return cannot be specified.

The typical work-around is to truncate the result where it is used in a view. This is makes for heavy syntax when a common function is used many times.

However, at least in Oracle 8, one can do the following:

dummy_variable VARCHAR2(150);
SUBTYPE t_return IS dummy_variable%TYPE; FUNCTION get (ix IN NUMBER) RETURN t_return;

Works nicely. Hope that helps.
-Greg

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Jul 30 1999 - 14:01:26 CDT

Original text of this message

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