PLSQL, SQL*PLUS get current username?
问题 I know that the show user command return: USER is "SCOTT" But is it possible in a sql query or in a plsql script to only get the username of the current user and store it in a variable? 回答1: The USER built-in function may be used. DECLARE v VARCHAR2(30); BEGIN v := USER; END; 回答2: SYS_CONTEXT( 'USERENV', 'CURRENT_USER' ) 回答3: fnd_profile.value('USERNAME') fnd_profile.value('USER_ID') fnd_flobal.user_id these can be used to get the user details 来源: https://stackoverflow.com/questions/23417522