Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Location
    Washington DC area
    Posts
    1,770

    Smile Unanswered: greater than system date

    I have a query that requires a date field in a record to be greater than the sysdate for future reference.

    select *
    from all_tab_cols
    where column_name like '%LAST_ANALYZED' is => 'SYSDATE';

  2. #2
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    You will need to write a sqlplus script to do an execute immediate on generated sql statements, You first have to build the 'select' statement for the tables that have the date column you are looking for:
    Code:
    with names as
     ( select owner, table_name, column_name
        from  all_tab_cols
       where  column_name like '%LAST_ANALYZED'
        and   data_type  =  'DATE' )
    select 'select * from ' || owner || '.' || table_name || ' where ' || 'trunc( ' || column_name || ' )  >=   trunc( sysdate )'
     from  names

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •