Method: Transaction user name
Function name: tranusername
Parameter list: none
Return type: CHAR
What the method does: The implied input is the current data row. This method, which has no input arguments, returns a character string containing the name of the DBMS user who executed the transaction that updated (inserted, updated, or deleted) this row. This is really only relevant for rows being sent by a replication request. For a copy request, this method always returns a 0 length string. To see an example of how to code an expression to return a different value than the default, see Code row optype to return a value other than a zero-length string and Code row timestamp to return a value other than a zero-length string.
Note: Only in SQL Server, a user can log in using any mixture of case desired and the login succeeds even if the case does not match the actual login ID.
Though SQL Server ignores the case when validating the login, it preserves the case the user entered when Connect CDC Director retrieves the login ID from the SQL Server system function. The end result is that the case may be unknown when using tranusername( ) with SQL Server as a source.
Therefore, expressions which are case sensitive, such as tranusername( )=='userid' may not behave as expected. For SQL Server, it may be necessary to use the method compareignorecase( ) when validating the value returned from tranusername ( ).