Skip to main content

In the following tutorial, we will describe how to modify an existing User Defined View. For this example, we are using the CData ODBC Driver for Salesforce. The list of the User Defined Views can be found in the DSN configuration window after navigating to the Data Model tab, just as shown in the screenshot below: 

 

 

To apply changes to your User Defined View you can choose to follow one of the two methods below: 

 

Method 1: Using DDL statements 

The driver is capable of creating and altering the schema via DDL Statements such as CREATE LOCAL VIEW, ALTER LOCAL VIEW, and DROP LOCAL VIEW: https://cdn.cdata.com/help/RFJ/odbc/pg_userviews.htm  

To alter an existing view in the tool that you are using the driver, provide the name of an existing view alongside the new query you would like to use instead. 

You can find below an example executed in SqlDbx tool: 

ALTER LOCAL VIEW CMyTestView] AS SELECT Name FROM Account; 

 

 

Method 2: Modifying the UserDefinedViews.json file 

The existing User Defined Views are stored inside a JSON file which is located at the path specified in the Location property. By opening this file, you can apply changes directly to your queries. In order to modify the User Defined View in Windows OS, you can follow the steps below:  

1. Open the DSN Configuration Window of the driver. Go to the Advanced Tab and navigate to the Schema section. In the Location property you should be able to find the default value: %APPDATA%\CData\Salesforce Data Provider\Schema 

 

 

 

2. Go to your Windows Search box and type Run. Click the app to launch it. 

 

 

 

3. A small window will pop up where you should type %appdata% just like in the screenshot below: 

 

 
 

 

4. Open the CData folder and then navigate to your Data Provider. In our example we are opening Salesforce Data Provider. 

 

 

5. Navigate inside the Schema folder and you should be able to find a JSON file called UserDefinedViews.json. Open this file with a text editor application, such as Notepad, Notepad++ etc. 

6. Inside the UserDefinedViews.json file you will find the views that you had already created with their respective queries.  

 

 

 

Change the queries as per your requirements and then save the changes.