Home » SQL & PL/SQL » SQL & PL/SQL » date problem
date problem [message #4377] Tue, 03 December 2002 15:11 Go to next message
Pam
Messages: 20
Registered: October 2000
Junior Member
I need to create a date column that accepts only the month and year (for credit card expiration).

The column defaults to the first of the month which is not good for the customer or the store.

How can I change the default to the last day of month so a customer can use their card all month.
Re: date problem [message #4378 is a reply to message #4377] Tue, 03 December 2002 15:31 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
One option would be to create a trigger to force the date to the last in the entered month:

create or replace trigger t_trg
before insert or update on t
for each row
begin
  :new.expiration_date := last_day(:new.expiration_date);
end;
/
Previous Topic: Data Inserts
Next Topic: Diff. between 'IS' & 'AS' key words while creating the Function,Procedure..
Goto Forum:
  


Current Time: Wed May 15 05:18:56 CDT 2024