You can translate the question and the replies:

Single WS call needs to execute 2 separate update statements.

hi there I have a single web service call that needs to execute 2 store procedures on 2 separate sql services. Is this possible? Thank you in advance. Regards

3 Answers

Hi, I followed the below-mentioned steps and it worked fine for me: * I had two stored procedures from two different data sources. * I created two base views in the Virtual DataPort using the *‘Create from query’* option by invoking the respective stored procedures. * Now, I created a UNION view of the two base views and published it as a REST web service. * When I called the web service, the two stored procedures from the respective data sources were executed and the results were retrieved as expected. For your scenario, you can similarly create a UNION of stored procedures that would hit the respective data sources. You may refer to [Creating Base Views from a JDBC Data Source](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/creating_data_sources_and_base_views/jdbc_sources/jdbc_sources#creating-base-views-from-a-jdbc-data-source) and [Creating Union Views](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/creating_derived_views/creating_union_views/creating_union_views#creating-union-views) sections of the Virtual DataPort Administration Guide for more information. Hope this helps!
Denodo Team
25-02-2020 08:08:47 -0500
code
Hi there Thank you for that approach. It works as you stated and updating the 2 environments. I have an additional request to this. The application that calls the web services is only concerned about the results from the 1st procedure. The calling application interrupts the 1st procedure results. The 2nd procedure writes the data into an audit table so the calling procedure does not need to know about this results. My question is, is there a method to not return any results from the 2nd procedure? When you call the WS 2 records are returned. is it possible to only return 1 record? Please let me know if you require additional information.
user
27-02-2020 03:00:02 -0500
Hi, I followed the above-mentioned steps in a slightly different manner and hope it would help you in this scenario: * I had two stored procedures from two different data sources. * I created two base views in the Virtual DataPort by invoking the respective stored procedures. * I further created a selection view over the two base views and added a new field ‘filter_column1’ and ‘filter_column2’ with field expressions like ‘1’ and ‘2’ respectively. * Now, I created a UNION view of the two selection views and created a selection view of the UNION view to filter out the ‘filter_column2’ and remove it from the output schema. * When I called the web service, the two stored procedures from the respective data sources were executed, returning the results only from the first stored procedure as I applied a filter condition. *Note: The two stored procedures will be executed parallelly.* Hope this helps!
Denodo Team
17-03-2020 07:34:14 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here