Find Jobs
Hire Freelancers

prevent overlapping codes (EUP-2007-9-3)

$15-20 USD

Igangværende
Slået op over 16 år siden

$15-20 USD

Betales ved levering
I have the following table: create table TB_CON /* contracts */ ( id_dpt numeric(18) not null, /* department ID */ id_con numeric(18) not null, /* row ID */ contract varchar(13) not null, description varchar(40) not null, valid_fm date, /* validity start */ valid_to date, /* validity end */ work_hours integer primary key (id_con) ) ; Database is Firebird 1.5 I need After Insert and a After Update triggers that will prevent a user from inserting 2 equal codes in overlapping validity periods. you may find the following SP useful: ALTER PROCEDURE OVERLAP ( A1 INTEGER, B1 INTEGER, A2 INTEGER, B2 INTEGER ) RETURNS ( RESULT INTEGER ) AS declare variable a integer; declare variable b integer; begin result=0; if ( a1 is null ) then begin suspend; exit; end if ( b1 is null ) then begin suspend; exit; end if ( a2 is null ) then begin suspend; exit; end if ( b2 is null ) then begin suspend; exit; end if ( b1<=a2 ) then begin suspend; exit; end if ( a1>=b2 ) then begin suspend; exit; end if ( ( a2<=a1 ) and (b2>=b1) ) then begin result=b1-a1; suspend; exit; end if ( (a2>=a1) and (b1<=b2) ) then begin result= b1-a2; suspend; exit; end if ( (a1>=a2) and (b1>=b2) ) then begin result=b2 - a1; suspend; exit; end if ( (a1>=a2) and (b1<=b2) ) then begin result=b1 - a1; suspend; exit; end if ( (a2>=a1) and (b2<=b1) ) then begin result=b2 - a2; suspend; exit; end end^ The triggers should take into due account the following special cases: valid_fm null means 'no validity start' 'valid from the start of time' valid_to null means 'no validity end' 'valid to the end of time' ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform w32
Projekt-ID: 3263830

Om projektet

Projekt på afstand
Aktiv 17 år siden

Leder du efter muligheder for at tjene penge?

Fordele ved budafgivning på Freelancer

Fastsæt dit budget og din tidsramme
Bliv betalt for dit arbejde
Oprids dit forslag
Det er gratis at skrive sig op og byde på jobs

Om klienten

Flag for ITALY
Italy
5,0
509
Medlem siden feb. 20, 2005

Klientverificering

Tak! Vi har sendt dig en e-mail med et link, så du kan modtage din kredit.
Noget gik galt, da vi forsøgte at sende din mail. Prøv venligst igen.
Registrerede brugere Oprettede jobs i alt
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Indlæser forhåndsvisning
Geolokalisering er tilladt.
Din session er udløbet, og du er blevet logget ud. Log venligst ind igen.