Hi Tim,
Thanks for the input. My Oracle-specific knowledge is tiny, so please bear with me... Sorry, but I'm confused.
1) Where does 'user' come from (get its value)? I assume dual is an Oracle System table, which is what Mark queried.
2) Where is this 'preference' you discussed?
TIA,
>Looks like this thread is going pretty well but I'll add my experiences..
>
>First the Code could be simplified a bit:
>
>CREATE OR REPLACE TRIGGER TABLE_NAME_audit_info "
>BEFORE INSERT OR UPDATE ON "'TABLE_NAME"
>FOR EACH ROW
>BEGIN
>IF INSERTING THEN
> :new.user_name := user;
> :new.lastedit := sysdate;
> ELSIF UPDATING THEN
> :new.user_name := user;
> :new.lastedit := sysdate;
>END IF;
>END;
>
>For some reason howver I am not found of these triggers. They tend to add a lot of database IO.
>It surprised me to find that the top two SQL statements on our databases where:
>select sysdate from dual; and
>select user from dual;
>
>I couldn't figure out why because you would think the dual table when queried would not need any IO.
>But from database statistic it seemed to do so. Oracle said it was because the query needs to create temp space.
>
>Anyways I just added a preference to disable the triggers so that DBA didn't complain about the IO if they did a
>TOP SQL query....
>
>Anways the IO should be negligible in my opinion but I had to take the DBA's experiece into consideration that brought this to my attention.
Bill Armbrecht
VFP MCP