I would follow the below steps to develop a stored procedure to implement pivot or unpivot functionality:
* [Develop a custom stored procedure]() using the [Denodo4E plugin](https://community.denodo.com/docs/html/browse/latest/en/denodo4e/index#denodo4eclipse-plugin-guide) written in JAVA and implement it in a jar file. In this stored procedure, you could invoke the methods provided in [Virtual DataPort API Javadoc]( https://community.denodo.com/docs/html/browse/8.0/en/vdp/javadoc/index) which would help you to implement the functionality of Pivot or Unpivot in Virtual DataPort views.
For example, you could invoke the method **getColumns()** to obtain the columns of a view. Check the sample stored procedures in the directory <DENODO_HOME>/samples/vdp/storedProcedures.
* Import the jar file of the stored procedure into Virtual DataPort by navigate to *File > Extension Management* available in Virtual DataPort Administration tool. You could refer to the section [Importing Stored Procedures](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/stored_procedures/importing_stored_procedures/importing_stored_procedures#importing-stored-procedures) for more information.
* In Virtual DataPort Administration, click the menu *File > New > Stored procedure* and select the jar file that contains the stored procedure. Now, you could provide the required input values to execute this stored procedure. Refer to the section [Executing Stored Procedures](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/stored_procedures/executing_stored_procedures/executing_stored_procedures#executing-stored-procedures) for more information on it.
Hope this helps