PL/SQL (MOSC)

MOSC Banner

How to optimize the following

edited Jun 10, 2010 4:41AM in PL/SQL (MOSC) 12 commentsAnswered
 Hi, I have an update statement that uses 2 functions

update table_a set col3 = function1(col1,col2), col4 = function2(col1,col2);

Each function access the same table with the same where clause

create or replace Function function1 (p_OrderDate in date, p_DriverCode in varchar2) 
    RETURN varchar2
is 
    v_TruckCode varchar2(10);
BEGIN
  SELECT skey_truck_code 
    INTO v_TruckCode
    FROM (SELECT skey_driv_empl_code, typed_time, skey_truck_code, RANK() OVER (ORDER BY typed_time asc) typed_time_rank
            FROM f_ticket
           WHERE skey_order_date = p_OrderDate and skey_driv_empl_code = p_DriverCode)
   WHERE typed_time_rank = 1; 

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center