The IBM® Database Add-Ins for Visual Studio provide partial support for user-defined data types (UDTs) and spatial data types that are defined in DB2® databases.
UDTs that are defined in a DB2 database and DB2 spatial data types are represented in the add-ins by their corresponding DB2 built-in data types.
Any information that the add-ins pass directly to the DB2 server can contain UDT and spatial-data-type data. However, any data on which the add-ins operate must be DB2 built-in data types. UDT or spatial-data-type data that is displayed in the IBM designers is shown by its corresponding DB2 built-in data types. A UDT or spatial data type can consist of multiple data elements. Data of such a data type is displayed in the add-ins as the individual elements and is treated and passed to the DB2 server as separate elements.
For example, consider a UDT with the name LOCALE that is created in a DB2 database. The LOCALE UDT consists of two elements: the first element, which represents the city, is of type VARCHAR, and the second element, which represents the state, is of type CHAR. If the INTERESTS table is defined in the DB2 database and one of the columns in INTERESTS is of type LOCALE, when you review the definition of INTERESTS in the IBM Table Designer, you see that LOCALE is represented by two separate columns, the first of type VARCHAR and the second of type CHAR.
Note: In the following descriptions, wherever you can create or update the definition of a database object by using a script in the Visual Studio Code Editor, an IBM database project must be open in the Solution Explorer and the project must be connected to a DB2 data server.
The following information describes how you can work with a table that contains a column of UDT or spatial data type.
You can use the Visual Studio Code Editor to write an SQL script that, when built, creates the table.
You can use the Visual Studio Code Editor to edit the script that defines the table, and then rebuild the table.
The following information describes how you can work with a view that contains a column of UDT or spatial data type.
You can use the Visual Studio Code Editor to write an SQL script that, when built, creates the view.
You can use the Visual Studio Code Editor to edit the script that defines the view, and then rebuild the view.
The following information describes how you can work with a procedure or a function that contains a parameter of UDT or spatial data type.
You can use the Visual Studio Code Editor to write an SQL script that, when built, creates the procedure or the function.
You can use the Visual Studio Code Editor to edit the script that defines the procedure or the function, and then rebuild the procedure or the function.
You must specify a separate value for each element in an input parameter of a UDT or spatial data type.
If an output parameter is a UDT or spatial data type, the result set contains a separate value for each element in the parameter.
If you write a Windows® or an ASP.NET application in Visual Studio that implements DB2 Spatial Extender, you must know how data of spatial data types is stored in a DB2 database so that you can programmatically manipulate the data by its separate elements.
For detailed information about DB2 spatial data types, refer to the About DB2 Spatial Extender section of the IBM DB2 Database for Linux®, UNIX®, and Windows Information Center.
You can drag objects with data of other data types from the Server Explorer to an application that you are developing. However, dragging objects with data of UDT or spatial data types to an application is not supported. Unpredictable results occur if you attempt drag operations on objects with data of UDT or spatial data types.
Creating Tables | Creating Views | Creating SQL and SPL Procedures | Creating SQL and SPL Functions | Editing the Source Code of Procedures, Functions, or Objects | Changing Table and View Data | Importing Data to Tables and Views | Running Procedures or Functions