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

Home -> Community -> Mailing Lists -> Oracle-L -> SQL question: possible to improve performance in these functions?

SQL question: possible to improve performance in these functions?

From: Guang Mei <zlmei_at_hotmail.com>
Date: Fri, 04 May 2001 14:11:12 -0700
Message-ID: <F001.002F9E81.20010504140548@fatcity.com>

Oracle : 8.0.5
Platform : Sun

Is there any way to "optimize" the following two functions to improve speed? I am calling this type of functions a lot.

Thanks.



function fTest1 (v_id in number) return boolean is   v_date date;
BEGIN
  select max(my_date_field) into v_date from my_table where id= v_id;   if v_date > sysdate - 30 then return true; else return false; end if; EXCEPTION
  when others then return false;
END fTest1;

function fTest2 (v_id in number) return varchar2 is

   text varchar2(32000);
  cursor cur1 is
   select my_text_field from my_table where id= v_id;

BEGIN   for x in cur1 loop

     text := text || chr(10) || x.my_text_field ;   end loop;

  return text;

END fTest2;




Get your FREE download of MSN Explorer at http://explorer.msn.com

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Guang Mei
  INET: zlmei_at_hotmail.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri May 04 2001 - 16:11:12 CDT

Original text of this message

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