我希望ORACLE可以根据T-sql中的以下示例添加对“只是工作”的内容的支持:
CREATE FUNCTION [dbo].[getSomeData] (@PRODID ROWID) RETURNS TABLE AS RETURN SELECT PRODID,A,B,C,D,E FROM MY_TABLE WHERE PRODID = @PRODID
然后选择它如此:
SELECT * FROM dbo.getSomeData(23)
我希望ORACLE可以根据T-sql中的以下示例添加对“只是工作”的内容的支持:
CREATE FUNCTION [dbo].[getSomeData] (@PRODID ROWID) RETURNS TABLE AS RETURN SELECT PRODID,A,B,C,D,E FROM MY_TABLE WHERE PRODID = @PRODID
然后选择它如此:
SELECT * FROM dbo.getSomeData(23)
最近的是
create table my_table (prodid number,a varchar2(1),b varchar2(1),c varchar2(1),d varchar2(1),e varchar2(1)); create type my_tab_type is object (prodid number,e varchar2(1)) . / create type my_tab_type_coll is table of my_tab_type; / create or replace function get_some_data (p_val in number) return my_tab_type_coll pipelined is begin FOR i in (select * from my_table where prodid=p_val) loop pipe row(my_tab_type(i.prodid,i.a,i.b,i.c,i.d,i.e)); end loop; return; end; / SELECT * FROM table(get_Some_Data(3));