?

Log in

No account? Create an account

Previous Entry | Next Entry

Dear Database Developers:

You know that sometimes my code is contingent on the results that you send me. And you know that clients always want to change label text, so the best practice is for you to send me category IDs.

SO WHY DO YOU MAKE THE CATEGORY ID A GENERATED KEYCODE THAT WILL CHANGE FROM SERVER TO SERVER?

No love,

-The Gneech

Tags:

Comments

hantamouse
Nov. 19th, 2010 11:46 pm (UTC)
class
CREATE TRIGGER trig_my_fault AFTER UPDATE OF fault ON employee FOR EACH ROW WHEN employee.name = 'myself';
BEGIN
IF :NEW.fault = TRUE THEN
Blamecast('myself');
END IF;
END trig_my_fault;


PROCEDURE blamecast(v_name IN VARCHAR2) IS
PRAGMA AUTONOMOUS_TRANSACTION
v_someone_else number(10);
v_count number(10);
BEGIN
UPDATE employee SET fault = FALSE WHERE employee.name = v_name;
SELECT count(id) INTO v_count FROM employee;
SELECT INTO v_someone_else dbms_random.value(1,vCount) num from dual;
UPDATE employee SET fault = TRUE WHERE ROWNUM = v_someone_else;
COMMIT;
END blamecast;

Latest Month

November 2019
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930

Tags

Page Summary

Powered by LiveJournal.com
Designed by Tiffany Chow