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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Please can anyone help me with SQL in Oracle.

Re: Please can anyone help me with SQL in Oracle.

From: Kbat <kbatsche_at_yahoo.com>
Date: 2000/01/31
Message-ID: <875tfb$a2f$1@nnrp02.primenet.com>#1/1

With PL/SQl you could try ...

declare
test_date date;

begin

select birthdate into test_date from _table_;                       --add
the name of the table here
if test_date <= add_months(sysdate,180) then

        _do_something_;
else

       _do_something_else_;

Good Luck

Ray <raytao_at_home.com> wrote in message news:38967653.11734066_at_news...
> In the table I have created using Oracle 8 and SQL statements, I need
> to be able to check if a field called 'BIRTHDATE' of type 'DATE' is
> no more than 15 years from today. How can I code for this because I
> cannot use the SYSDATE system variable with the CREATE TABLE
> statement? I need to somehow check if this constraint is true.
> Should it be coded on the column level or table level? Does anyone
> know how I can do this? Any help would be great!!! Please email me
> at raytao_at_home.com if you have a solution. Thank you.
Received on Mon Jan 31 2000 - 00:00:00 CST

Original text of this message

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