the project ), what changes should be made to the current code to permit that when a lab exam is made to a patient it search a table and take The fee and inmediatly add's it to the patient, since on real practice Each lab exam has it's different price well diferent fees will be Added to the patients account;
Perhaps using "stored procedures" started by "triggers"?
With a trigger, we can arrange for the DBMS to execute a stored procedure when certain actions are taken upon a table (like an INSERT, UPDATE, or DELETE).
The combination of stored procedures and triggers enable enforcement of quite sophisticated business rules directly at the best place for enforcing business rules, which is... the database.
To use a trigger, one must first write the procedure to be triggered and then create the trigger itself.
The trigger automatically fires whenever the specified event occurs (DELETE, INSERT, or UPDATE).
We can program the trigger so that it fires after the event occurs, in
which case the called procedure will have access to both the original
data (for updates and deletes] and the new data (for inserts and updates).
We can also program the trigger to fire before the event occurs. In this
case, we can prevent the update occurring, or change the data to be
inserted or updated.
That's how it is done with Oracle, IBM DB2, and postgreSQL.
But those are some of the basic things that area missing in MySQL (although, to be fair, in its last version they gave it a try and released some support for stored procedures... others were doing that reliably for more than 10 years.. well better latter then never).
J. Antas
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Care2002-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/care2002-developers