Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » user id,created date,updated date
user id,created date,updated date [message #466552] Tue, 20 July 2010 02:08 Go to next message
shobhakashyapgmailcom
Messages: 58
Registered: June 2010
Location: India
Member

hi,

i need to store the Single Sign On log in id as created by ,updated by,created date,updated date in the table during insertion of data..please help me to insert data ..

help me please

thanku
sk
Re: user id,created date,updated date [message #466560 is a reply to message #466552] Tue, 20 July 2010 02:49 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
create trigger after insert on for each row ..


Regards
Ved
Re: user id,created date,updated date [message #466606 is a reply to message #466560] Tue, 20 July 2010 05:31 Go to previous messageGo to next message
shobhakashyapgmailcom
Messages: 58
Registered: June 2010
Location: India
Member

could you please tell me how can i extract different :App_USERS and date in every session or every login
Re: user id,created date,updated date [message #466607 is a reply to message #466552] Tue, 20 July 2010 05:34 Go to previous messageGo to next message
shobhakashyapgmailcom
Messages: 58
Registered: June 2010
Location: India
Member

select v('APP_USER') from dual;
SELECT to_char(sysdate,'DD-MON-YY HH:MM')from dual;

i have this code for extracting the required values but dont know how to handle with my case.because in my table some other column values are there which are normally inserted ..

if i discard the created by,updated by,created date and updated date..does it gives error???
Re: user id,created date,updated date [message #466612 is a reply to message #466607] Tue, 20 July 2010 06:15 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
You can create Before Insert and Before Update triggers on the related tables where you want to update those fields

Should be something like:
:NEW.Create_User := nvl(v('APP_USER'),USER);
:NEW.Created_date:=sysdate;


v() function is a function which returns the value of a session item, for example v('APP_USER') would return the name of the currently logged in user. Be careful while handling v() function.Please have a look at the documentation.

Regards
Ved


[Updated on: Tue, 20 July 2010 06:17]

Report message to a moderator

Re: user id,created date,updated date [message #468548 is a reply to message #466612] Fri, 30 July 2010 11:07 Go to previous message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
&APP_USER. will also help
Previous Topic: How to enable /disable apex versions ( Switching Schemas)
Next Topic: Edit page changes
Goto Forum:
  


Current Time: Thu Mar 28 16:59:35 CDT 2024