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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: URGENT help- needed (deletes)

Re: URGENT help- needed (deletes)

From: Rajagopal Venkataramany <gvrvrr_at_yahoo.com>
Date: Wed, 6 Dec 2000 20:26:51 -0800 (PST)
Message-Id: <10702.123893@fatcity.com>


Salu,

  Let me clarify 2 points so that u understand it   correctly.

  1. The sql%rowcount was suggested to check whether the delete statement affected any rows and if not use it as a mechanisom to quit the program with a exception so that u don't have to wait for a long time to know that it did not delete any records.
  2. I did mention in my earlier email that it could be because of the time component stored in the join_date column.

     try,

    select to_char(join_date,'dd-mon-yy hh24:mi')     from <table_name> where rownum <= 5;

    This sql will list out 5 rows and find out as to     whether you see the hours and the minutes displayed

    as 00:00 or valid numbers. If they are valid     numbers, it means the join_date field has time     component stored with it.

    In that case one way is to use trunc(join_date)     in the WHERE condition so that you will get the     script working but this will have performance     implication because the index will not be used.

    Alternatively declare 2 local variables as (say)     v_low_date and v_high_date and initialize them     as v_low_date := to_date(given_date,'dd-mon-yy')     and
v_high_date := to_date((given_date||'23:59:59'),

                        'dd-mon-yy hh24:mi:ss').

   Then use these variables in the WHERE condition as    WHERE join_date between v_low_date and v_high_date    besides other conditions so that the existing index    is used.

   Hope this is clear to you and let me know if it    worked for you...

Regards
Rajagopal Venkataramany

Received on Wed Dec 06 2000 - 22:26:51 CST

Original text of this message

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