user-defined-types

SQL UDT Type parameter pass in C#

时光毁灭记忆、已成空白 提交于 2020-01-05 02:59:01
问题 I have a SQL UDT Type as CREATE TYPE [dbo].[UDTName] FROM nvarchar(50) NULL GO and I using it in a procedure to insert data into my DB. My procedure is something like this CREATE PROCEDURE [dbo].[proc_name] ( @param1 int, @param2 int, @param3 UDTName, @param4 UDTComment, @param5 UDTType = '' output, @param6 UDTType = '' output ) When I am calling this procedure from my C# code, UDT type data is not any saving in the table. My C# code: private IDictionary<string, string> RunQuery(string

SQL Server 2008: Can a multi-statement UDF return a UDT? [duplicate]

谁说胖子不能爱 提交于 2020-01-04 05:46:29
问题 This question already has answers here : SQL Server 2008 - How do i return a User-Defined Table Type from a Table-Valued Function? (4 answers) Closed 4 years ago . Is it possible that a multi-statement UDF return a User Defined Table Type, instead of a table that is defined within it's return param? So instead of: CREATE FUNCTION MyFunc ( @p1 int, @p2 char ) RETURNS @SomeVar TABLE ( c1 int ) AS I would like to do: CREATE FUNCTION MyFunc ( @p1 int, @p2 char ) RETURNS @SomeVar MyTableType AS

Cannot find user defined datatype 'empnum' in SQL Server 2014

别说谁变了你拦得住时间么 提交于 2020-01-04 02:57:08
问题 When I run the following query in SQL Server 2014 to create a temporary table: CREATE TABLE #temp ( location char(16) null, location_desc varchar(25) null, Emp_Num EMPNUM null ) I receive the error: Cannot find the data type empnum. empnum is a user-defined data type. But the same user-defined data type is working fine in other stored procedures. Why am I receiving this error? 回答1: It looks like user defined types are defined at database level , not instance level , so they must be defined

How do I reinitialise a UDT in VB6?

馋奶兔 提交于 2020-01-03 11:30:09
问题 I've got a loop, which is reading in a stack of XML files, for each one, it validates the data that was in the XML and loads it into some UDTs and then does some work on the data. Then it gets back to the beginning of the loop and the UDTs still have data in from the previous XML. If that tag is defined in the new one, it overwrites, but if that tag isn't defined, then that element in the UDT is left alone. But I can't reset the UDT by the technique I'd use for a variable ( Let X = 0 ) unless

Subclassing numpy scalar types

此生再无相见时 提交于 2020-01-03 11:12:27
问题 I'm trying to subclass numpy.complex64 in order to make use of the way numpy stores the data, (contiguous, alternating real and imaginary part) but use my own __add__ , __sub__ , ... routines. My problem is that when I make a numpy.ndarray , setting dtype=mysubclass , I get a numpy.ndarray with dtype='numpy.complex64' in stead, which results in numpy not using my own functions for additions, subtractions and so on. Example: import numpy as np class mysubclass(np.complex64): pass a =

Subclassing numpy scalar types

牧云@^-^@ 提交于 2020-01-03 11:11:11
问题 I'm trying to subclass numpy.complex64 in order to make use of the way numpy stores the data, (contiguous, alternating real and imaginary part) but use my own __add__ , __sub__ , ... routines. My problem is that when I make a numpy.ndarray , setting dtype=mysubclass , I get a numpy.ndarray with dtype='numpy.complex64' in stead, which results in numpy not using my own functions for additions, subtractions and so on. Example: import numpy as np class mysubclass(np.complex64): pass a =

Select directly into hierarchical user type

自闭症网瘾萝莉.ら 提交于 2020-01-02 08:36:10
问题 Is it possible to do a select directly into a hierarchical user type? Imagine a table structure like this: PARENT ------ ID NAME CHILD ----- ID PARENT_ID NAME Additionally, I have user types like this: create or replace type child_item as object ( ID NUMBER(10), NAME VARCHAR(255) ); create or replace type children_table as table of child_item; create or replace type parent_item as object ( ID NUMBER(10), NAME VARCHAR(255), CHILDREN CHILDREN_TABLE ); create or replace type parent_table as

std::map Requirements for Keys (Design Decision)

半世苍凉 提交于 2020-01-01 08:25:31
问题 When I make a std::map<my_data_type, mapped_value> , what C++ expects from me is that my_data_type has its own operator< . struct my_data_type { my_data_type(int i) : my_i(i) { } bool operator<(const my_data_type& other) const { return my_i < other.my_i; } int my_i; }; The reason is that you can derive operator> and operator== from operator< . b < a implies a > b , so there's operator> . !(a < b) && !(b < a) means that a is neither less than b nor greater than it, so they must be equal. The

oracle nested table select

一曲冷凌霜 提交于 2019-12-31 07:39:05
问题 How can I write a query that lists the first and last names of all drivers, along with the vehicle identification number of the car they drive? This is what I have so far: Create type DRIVER_TY as object (first_name VARCHAR2(20), last_name VARCHAR2(20), date_of_birth VARCHAR2(20)); Create type OWNER_TY as object (first_name VARCHAR2(20), last_name VARCHAR2(20), date_purchased VARCHAR2(25)); Create type OWNERS_NT is table of OWNER_TY; Create table AUTOMOBILE (vehicle_identification_number

Spark SQL referencing attributes of UDT

风格不统一 提交于 2019-12-28 03:09:14
问题 I am trying to implement a custom UDT and be able to reference it from Spark SQL (as explained in the Spark SQL whitepaper, section 4.4.2). The real example is to have a custom UDT backed by an off-heap data structure using Cap'n Proto, or similar. For this posting, I have made up a contrived example. I know that I could just use Scala case classes and not have to do any work at all, but that isn't my goal. For example, I have a Person containing several attributes and I want to be able to