Is it possible to use UPDATE and DELETE statements(CRUD operations) against a datasource in TIBCO Data Virtualization?
book
Article ID: KB0073719
calendar_today
Updated On:
Products
Versions
TIBCO Data Virtualization
8.2, 8.3, 8.4
Description
When running CRUD operations (for example, Update statement) directly against a datasource, users 'may' notice the following error: "SQL view cannot contain an INSERT, UPDATE, or DELETE statement. Only SELECT statements are allowed."
Here is a screenshot of the error:
Environment
Windows
Resolution
To resolve this error, a SQL procedure\script can be used to execute CRUD operations against a datasource. Users can create a procedure in the TDV instance by right clicking on the desired Folder and selecting "New > New SQL Script" option. Within this procedure, executing any CRUD Operations (INSERT, UPDATE or DELETE) will reflect the changes against the table/view of the selected datasource.
Example: In the following screenshot, a procedure "checkRUN" is used to UPDATE a particular row in "Products" table where a column "productid" which has a value of 1 is updated to a different value.
Here is the sample procedure:
PROCEDURE checkRUN() BEGIN UPDATE /shared/examples/ds_inventory/tutorial/products set productid=99,productname='SanDisk' where productid=1 ; END
Here is the screenshot:
Issue/Introduction
This article explains the process of using UPDATE and DELETE statements(CRUD operations) against a datasource in TIBCO Data Virtualization