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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to set the size of string returned by PL/SQL functions?

Re: How to set the size of string returned by PL/SQL functions?

From: Robert Klemme <shortcutter_at_googlemail.com>
Date: Sun, 07 Oct 2007 11:57:46 +0200
Message-ID: <5mrossFf11scU1@mid.individual.net>


On 05.10.2007 05:01, userjohn wrote:
> "John Heitmuller."

>> Can I change I define a size for the VarChar2
>> returned by the function?

>
> sure...
> but....WHY ? why do you care ? and why do you THINK you want to do it ?

For example if you want to pull data from the view and insert it into some table it is better to have the correct VARCHAR2 length in the view def - otherwise you always have to do CAST/SUBSTR when inserting into another table. Also, as has been pointed out by several Oracle pro's, it is generally better to make columns as wide as they need to be - but not wider. This is meta information that the DB as well as users can use (for example, if you code a client application in a language that requires preallocation of char arrays you will be thankful for the information that the field can have max. 15 chars and not 4k).

Kind regards

        robert Received on Sun Oct 07 2007 - 04:57:46 CDT

Original text of this message

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