473,748 Members | 4,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use Duration and booking date to stop bookings during this time

23 New Member
I'm trying to use PL/SQL to create a trigger that will stop bookings. Based on a duration field and a start time.

I have had a go at trying to do this but I'm sure that im well off from where I need to be.
Expand|Select|Wrap|Line Numbers
  1. Create or Replace Trigger multiple_appointments
  2. Before insert on appointment
  3.  
  4. Begin 
  5.  
  6.     IF (NEW.toNumber(ADATE) between toNumber(ADATE + "Duration(Min)" from Appointmenmt) 
  7.                     and toNumber(ADATE + "Duration(Min)" from appointment)
  8.     Then
  9.     RAISE_APPLICATION_ERROR (-20500, 'There is already a appointment schedualled for this time');
  10.     End IF;
  11. END;
Any help would be great thank you very much.
Mar 28 '08 #1
0 1277

Sign in to post your reply or Sign up for a free account.

Similar topics

5
1464
by: Murphy | last post by:
We are currently looking into the development of an application for booking resources and are researching the available options for recording and tracking these bookings. The possibilities we have presently for managing and tracking bookings are: a) Store bookings in SQL db and code the calendar functionality, showing existing bookings & availability b) Interface with Exchange c) Utilise a 3rd party product
4
3252
by: WiseOwl | last post by:
Hi folks I teach. At school, four IT rooms are booked using a paper based outline timetable. Completing it is easy but basic and impossible to ensure completion of all fields (name, year group, subject and software) and analysis of bookings is a nightmare. I just fancied pottering with Access, which I am pretty familiar with, to see if I could create a means of booking a room using a database. Locking a booking would then be a...
2
8236
by: Andy | last post by:
Hi folks I teach. At school, four IT rooms are booked using a paper based outline timetable. Completing it is easy but basic and impossible to ensure completion of all fields (name, year group, subject and software) and analysis of bookings is a nightmare. I just fancied pottering with Access, which I am pretty familiar with, to see if I could create a means of booking a room using a database. Locking a booking would then be a...
2
2860
by: Mike Glazer | last post by:
I am trying to construct an Access database to be used for making bookings to share vehicles. The user has to be able to select a starting date and time and an ending date and time. However, when the user tries to select a period already booked the system needs to object and not allow it. Any ideas how this can be achieved? Mike Glazer
25
2862
by: NDayave | last post by:
How do, I have a access 2000 booking database with Personal Details, Outing Details and the Bookings in three tables: tblBookings -- -Autonumber, -Number, -Number, -Currency, -Yes/No, -Yes/No tblPersonaldetails -- -Autonumber, etc tblOutingDetails -- -Autonumber, etc
5
13532
by: sticky | last post by:
Hi I need to be able to lock a table against INSERT and UPDATE, but not SELECT, for the duration of a transaction. The transaction will be defined at the application level in c#, and then use stored procedures to make multiple selects and then an insert. What is the best way of doing this? Description of the system:
8
3016
by: shrimpeh | last post by:
Hi im currently messing around with creating a diary/booking system for a leisure centre. And im stuggling with how I can display all the data. The booking is taking the activity the customer is doing and the date and time etc. I want to display the data with each different activity having its own column and the rows having times. So that you can view a full day and see what is happening with each activity at all times of the day. Basically I...
3
3659
by: Wildster | last post by:
Hi, I have a form in Access 2000 running Windows XP with the following fields: - Booking_ID Date Person_Name Booking_Type 8-9am (y/n checkbox) 9-10am (y/n checkbox)
4
2678
by: phill86 | last post by:
Hi, I am trying to represent on a form time slots I have re-created the look of an outlook calendar on the form I have a table with the calendar bookings start and end time and there could be any number of bookings in a day. The following code represents the column for the first day of the week (monday) and formats the text boxes accordingly if the room is booked. This all works fine but I have to have this code again to represent the...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.