You can translate the question and the replies:

Api Post with session user

I would like to find out if we have Api to post and put , do you know a way how we can pass the session user and time to the table to capture who created and when For example if we have table Id Name Updatedby UpdatedDate If I post a record with the api , I want to pass the username and system date And the same when the record gets updated
25-11-2019 03:21:11 -0500

1 Answer

Hi, To pass the session’s username and date when submitting a POST or PUT request, you would need to develop a custom stored procedure. Virtual DataPort has a Java API, the [Denodo4E]( plug-in for Eclipse, that can be used to develop these custom components. I would suggest first creating a view in Virtual DataPort with the following query: `CREATE VIEW test AS SELECT GETSESSION('user'), CURRENT_DATE();` This view will return the current session’s username and date by utilizing the [GET_SESSIONS]( stored procedure and [CURRENT_DATE]( function. Your custom stored procedure should get this view’s output and pass those values into the POST or PUT request to be inserted or updated in the table. You can read [Developing Stored Procedures]( in the Virtual DataPort Developer Guide for more information on this topic. Hope this helps!
Denodo Team
26-11-2019 18:19:45 -0500
You must sign in to add an answer. If you do not have an account, you can register here