Home » Developer & Programmer » Forms » Use :New & :Old qualifier in Oracle Forms 10g
Use :New & :Old qualifier in Oracle Forms 10g [message #312596] Wed, 09 April 2008 06:59 Go to next message
ahmad_uaf
Messages: 68
Registered: March 2006
Location: Pakistan
Member

Hi dears,
can any body tell me , how to use New & Old qualifier which we use at database level Triggers on Insert , delete or Update.
Any clue & idea which help me to track Old and new Field's value which i 've to use in History File.
waiting response...............
Regards,
Ahmad
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #312599 is a reply to message #312596] Wed, 09 April 2008 07:03 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell, you can't do that; Forms don't know ":old" and ":new" (by the way, as you obviously know how to use them in a database trigger, why don't you do it that way - in the database level (instead of application one))?

You'll have to do it manually: store "old" item value into a parameter (or a global variable) and manipulate with this value (as well as a new one) in one of Forms triggers (PRE-COMMIT, for example).
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #312602 is a reply to message #312599] Wed, 09 April 2008 07:16 Go to previous messageGo to next message
ahmad_uaf
Messages: 68
Registered: March 2006
Location: Pakistan
Member

Yes dear you are right i should use database trigger.
here is my situation:-
I want to know which Applicaton user change the salary Field. so how i can track Application User Information in that way.I am using Oracle DS 10g.I can track the DB user inforamtion in that way.
Hope u understand my problem .
Thanks in Advance.
Regards,
Ahmad
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #312603 is a reply to message #312602] Wed, 09 April 2008 07:21 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you consider possibility of AUDITING the database?
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #312857 is a reply to message #312603] Wed, 09 April 2008 23:24 Go to previous messageGo to next message
ahmad_uaf
Messages: 68
Registered: March 2006
Location: Pakistan
Member

Dear i jus track the Application UserID when user change a specific field.I cant use DB Level Trigger to Track Apps UserID.
Regards,
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #312858 is a reply to message #312857] Wed, 09 April 2008 23:37 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
You can. Run the following code and see what comes back.
   select upper(osuser), upper(terminal)
     into v_osuser, v_terminal
     from v$session
    where sid = (select distinct sid
                            from v$mystat);

David
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #312870 is a reply to message #312858] Thu, 10 April 2008 00:22 Go to previous messageGo to next message
ahmad_uaf
Messages: 68
Registered: March 2006
Location: Pakistan
Member

Hello David,
This is output Of the query u send:
SQL>
1 select upper(osuser), upper(terminal)
2 from v$session
3 where sid = (select distinct sid
4* from v$mystat)
SQL> /

UPPER(OSUSER) UPPER(TERMINAL)
------------------------------ ----------------
MUHAMMAD.AHMAD ERP01-28

Actually the situation here is that we are using a table in which all user informaiton is reside.when user logon to the application , User authenticate from that table mean his username & password.Now after Logon to the appliation , i just want to track which application User change the field to mantain the history Of any table.when user change a field value , how i will keep track old value & new value Of that field to maintain the history.????
that is my question .
I cant pass any parameter to database trigger
hope so u better understand the scenrio now.
warm Regards,
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #312911 is a reply to message #312870] Thu, 10 April 2008 01:48 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Do you use the 'osuser' to access this table of user information? What DO you use to identify a user in this table?

To get this to work at the database level pass some identifier of the user who made the changes (irrespective of whether it is the field in which you are interested) in a field of the record. Then, in the trigger, see if the NEW and OLD version of the field in which you are interested is different. You would not appear to need to worry about the other fields. If it is different then either use the information passed in the 'user' field of the table or possibly the 'osuser' if the 'user table' is keyed on that information. Remember, the user/invoker of the trigger is YOU, not Oracle. It is YOUR transaction. You can test this by using a test trigger on a test table.

David
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #313227 is a reply to message #312911] Fri, 11 April 2008 02:39 Go to previous messageGo to next message
ahmad_uaf
Messages: 68
Registered: March 2006
Location: Pakistan
Member

Dear David ,
this is my User table from which i authenticate the user


USER_ID
USER_NAME
EMAIL
ENCRYPTED_PASSWORD
CREATED_BY
CREATION_DATE
LAST_UPDATED_BY
LAST_UPDATE_DATE
EMPLOYEE_ID
IS_ACTIVE


Now i want to use "User_id" reference in History table to track DML operation on trasactional Tables.
OSUSEr is also helpful and use in my history table as well but i specifically require User_id reference in that history table.
Warm Regards ,
Ahmad
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #313586 is a reply to message #313227] Sun, 13 April 2008 19:39 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Then add a 'mod_by_user_id' to the table in which you are interested and in your database trigger, if the field of interest has been changed, use the 'mod_by_user_id' field to populate your history file.

David
Re: Use :New & :Old qualifier in Oracle Forms 10g [message #313945 is a reply to message #313586] Tue, 15 April 2008 04:56 Go to previous message
ahmad_uaf
Messages: 68
Registered: March 2006
Location: Pakistan
Member

Thx so much david for your response.
Previous Topic: Can I close all the opened Forms in my application with one statement?
Next Topic: database links
Goto Forum:
  


Current Time: Sun Dec 04 06:33:42 CST 2016

Total time taken to generate the page: 0.13733 seconds