Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need a trigger to prevent invalid dates

Status
Not open for further replies.

hschlais

Programmer
Nov 6, 2007
2
0
0
US
Hi experts,

An application my new company uses allows invalid dates to be stored (2/29, 4/31, 6/31, 9/31, 11/31). Pervasive is not anyone's speciality and the application vendor takes too long to get things done (especially since it doesn't hurt their application) so I would like to ask if anyone already has a trigger that can check for bad dates. We know which tables and columns to target and a trigger seems like the right way to go - get the data fixed before it goes in.

Thank you, I hope I'm not asking for too much.

Warm regards,

 
First of all, Triggers may not work for you. If the application uses the Btrieve interface, adding a trigger will disable Btrieve access to that file. For example, if you add an Insert trigger to a table, Btrieve will not be able to insert a record. Btrieve will return a status 149.
Second, I don't believe the PSQL trigger syntax would allow you to do what you are looking for.



Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Thank you mirtheil for replying.

I found my way a bit around the tek-tips web site and did a search. Someone had posted a link to a Pervasive web site ( and there was a DateFixer utility. I have not tried it yet (scared to, it's quite a few years old).

Warm regards,
 
I've seen that tool. I can't say I've used it but I believe it works. THat being said, all it does is fix existing dates in a table. It will not prevent them from being added in the first place.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top