Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Return value of PL/SQL-functions
A very mindbugging problem we do have to deal with is, that 'hand made'
PL/SQL-functions with caharcter return values always give back something other
than Oracle functions.
Every return value seems to bo turned in a kind of long string regardless of the
defined function type (CHAR, VARCHAR, VARCHAR2).
A self written funtion like
CREATE OR REPLACE FUNCTION my_substr( str_Input IN VARCHAR2, n_Start IN INTEGER, n_Len IN INTEGER ) RETURN CHAR IS BEGIN RETURN SUBSTR( str_Input, n_Start, n_Len ); END my_substr;
You can see the difference in SQL*Plus:
SELECT c1, SUBSTR( c1, 1, 2 ) FROM tyb;
SELECT c1, my_substr( c1, 1, 2 ) FROM tyb;
If anyone knows how to make a function like my_subtr functions to behave like SUBSTR we' be very very happy!
Thanks,
Stephan Hüttner
Hackenberg & Partner
Germany
Received on Thu Dec 19 1996 - 00:00:00 CST