cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify default current_user in HDBDD table definition just as CURRENT_TIMESTAMP

former_member215561
Participant
0 Kudos
namespace XXX;
@Schema: 'XXX'
@Catalog.tableType:#COLUMN
entity ZLOGILITY_FC {
KEY WEEKEND_DATE 	: LocalDate;
KEY MATNR 			: String(18);
KEY PLANT			: String(4);
LOGLEVEL 		: String (1);
AUDIT_USER	 	: String(100) DEFAULT CURRENT_USER; // Giving error
AUDIT_TIME		: UTCTimestamp default CURRENT_TIMESTAMP ; // This works
};
agentry_src
Active Contributor
0 Kudos

What is your version of HANA? Have you been successful in the following query:

SELECT CURRENT_USER "current user" FROM DUMMY;

?

Accepted Solutions (0)

Answers (1)

Answers (1)

pruthvi_r
Contributor
0 Kudos

Please refer the reply in below link.

https://answers.sap.com/questions/11989521/populate-a-column-in-table-with-system-user-by-def.html

As per the thread, CURRENT_USER is no support in Create or Alter statements.

The thread is from year 2015, i believe still the current_user is not supported.

I recreated your code and tried different options and always get the error,

Error: Expressions as constants or default values are not supported yet

Error: Expression is not constant