In what context? Within a trigger ld and :new are used to refer to the value a column has before it was changed and :new the value it has after it changed.
Does this answer your question? SOL
The best thing about banging your head against a wall is when you stop.
i am trying to build a botton on my form with oracle developer that does this
if ld.colname <> :new.colname then
:storecolname := ld.colname
end if;
but all the examples I have seen where this work are database triggers not a "when button pressed trigger" so i was wondering if new and old can only be accessed by a database trigger
Not really, because it depends on the created trigger if you assign the new values as NEW and old values as OLD. Inside the trigger you will reference your data as :OLD and :NEW.
I understand that most of the documents uses such reference for ease of understanding. But if you want to confuse yourself you can use other references for old and new values. For example;
CREATE TRIGGER mytrigger
AFTER UPDATE ON mytable
REFERENCING OLD AS oldies NEW AS newbies
FOR EACH ROW
WHEN (newbies.column='999999')
BEGIN
INSERT INTO table2
....
VALUES oldies.column1, ldies.column2 ....);
END;
/
For the Oracle Developer part, lets wait for other inputs.
If you want to get the old and new values after you update, why not something like this:
1. select the record first and store to a variable say, "old"
2. your update statement
3. select again or assign the current value, then store it to another variable, say "new"
4. use your statement referencing these variables.
Actually you can also use the ld and :new of the database trigger but you have to create a package body and then assign to it your ld and :new values and use this package body to get the value from Forms.
Oracle Developer's triggers have about nothing to kind of database triggers. The only similar property is that they are normally not called directly but rather "triggered" by some event. So do not mix up them. In Form's trigger ld and :new (if this trigger does work ) are probably block names used to fully qualify item within form.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.