用户在TSQL中定义的结构类型

时间:2017-12-09 07:48:04

标签: sql sql-server tsql

我找到了一些符合我要求的代码,但是在Oracle SQL中。是否可以在SSMS中执行相同的操作?看看代码:

CREATE OR REPLACE
TYPE obj_address_num AS OBJECT
( street varchar2(50),
numb number,
additionalInfo VARCHAR2(10),
MEMBER FUNCTION get_street RETURN varchar2,
MEMBER FUNCTION get_numb RETURN number,
MEMBER FUNCTION get_aditionalInfo RETURN varchar2
)
INSTANTIABLE NOT FINAL;
CREATE OR REPLACE
TYPE BODY obj_address_numb AS
MEMBER FUNCTION get_street RETURN varchar2 IS
BEGIN
RETURN SELF.street;
END;
MEMBER FUNCTION get_numb RETURN number IS
BEGIN
RETURN SELF.numb;
END;
MEMBER FUNCTION get_additionalInfo RETURN varchar2 IS
BEGIN
RETURN SELF.additionalInfo;
END;
END;

我想这可以通过某种.Net语言来完成,但是可以只使用TSQL来输入此代码吗?

0 个答案:

没有答案