我已經嘗試了一些答案,並且無法讓我的代碼工作: 以下是我想要的,這裏是我所做的: 我有一個表,它是兩列類型,我想查詢該表使用函數返回完全相同的表路由到VB.NET,以便我可以在DatagridView控件中顯示它。 我是PL/SQL的新手,這對我來說是個問題。 我打算解決的第一個問題是創建函數。如何從oracle中的函數返回值表
-- DECLARE A RECORD TYPE
create or replace type shipper_type AS OBJECT
(
shipper_id number, shipper_name varchar2(7)
);
/
CREATE TYPE t_shipper as table of shipper_type;
/
create or replace function get_shipper return t_shipper is
temp_list t_shipper:= t_shipper();
is
-- shipper_record shipper_type;
begin
for i in ( (select shipper.shipper_id, shipper.shipper_name) list from shipper)
loop
temp_list.extend;
temp_list(temp_list.last):= t_shipper(list);
end loop;
return(temp_list);
end get_shipper;
/
當我嘗試編譯此代碼我收到以下錯誤: 誤差的功能GET_SHIPPER:
LINE/COL ERROR
-------- -----------------------------------------------------------------
3/1 PLS-00103: Encountered the symbol "IS" when expecting one of the
following:
begin function pragma procedure subtype type <an identifier>
<a double-quoted delimited-identifier> current cursor delete
exists prior
6/63 PLS-00103: Encountered the symbol ")" when expecting one of the
following:
. (, * @ % & - +/at mod remainder rem <an identifier>
<a double-quoted delimited-identifier> <an exponent (**)> as
from || multiset
非常感謝它的工作。 – Surya
如果這解決了你的問題,你應該接受它作爲正確的解決方案。 [瞭解如何](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) – APC