+ -
当前位置:首页 → 问答吧 → SqlServer 自定义函数转换成Oracle(急,在线等)

SqlServer 自定义函数转换成Oracle(急,在线等)

时间:2011-09-02

来源:互联网

哪位大哥帮忙把下面一个SqlServer中的自定义函数 转换成Oracle中自定义函数,紧急!!!在线等,谢谢了!
SQL code

--根据上级编号获得分类设置树
create function [dbo].[fBWA_Lookup_Config_GetChildrenByParentID]
(
    @Lcg_Parent_ID uniqueidentifier
)returns @t table(
                    [Lcg_ID] [uniqueidentifier],
                    [Lcg_System_Type] [tinyint],
                    [Lcg_Sub_System_Type] [tinyint],
                    [Lcg_Parent_ID] [uniqueidentifier],
                    [Lcg_Code] [varchar](100),
                    [Lcg_Name] [nvarchar](50),
                    [Lcg_Value] [nvarchar](100),
                    [Lcg_Order_No] [smallint],
                    [Lcg_Is_Default_Selected] [tinyint],
                    [Lcg_Description] [nvarchar](200),
                    [Lcg_Status] [tinyint],
                    [Lcg_Creater] [nvarchar](50),
                    [Lcg_Create_Time] [datetime],
                    [Lcg_Last_Modifier] [nvarchar](50),
                    [Lcg_Last_Modify_Time] [datetime]
                    ,[Level] int
                )
as
begin
    

    return
end 


作者: flying_ade   发布时间: 2011-09-02

SQL code

先创建返回类型
create or replace type obj_table as object
(
  id int,
  name varchar2(50)
)

然后创建函数
create or replace function f_pipe(s number)
return t_table pipelined
as
    v_obj_table obj_table;   
begin    
for i in 1..s loop 
    v_obj_table :=  obj_table(i,to_char(i*i));
    pipe   row(v_obj_table);   
end loop;
return;
end f_pipe;


作者: szc108   发布时间: 2011-09-02