模式:
CREATE OR REPLACE TYPE 类型名 as OBJECT (属性名 属性类型,...);
举例:
CREATE OR REPLACE TYPE BITS_IDX_BASE AS OBJECT ( NAME VARCHAR2(4000), FIELDS VARCHAR2(4000), CREATE_DATE VARCHAR2(4000), INCREMENT_DATE VARCHAR2(4000) );
CREATE OR REPLACE TYPE BITS_IDX_BASE_TBL AS TABLE OF BITS_IDX_BASE;
自定义类型可用于函数的返回类型:
FUNCTION LIST_BASE return BITS_IDX_BASE_TBL
as
c utl_tcp.connection; -- TCP/IP connection to the Web server
ret_val pls_integer;
lastRow varchar(3000);
currentRow varchar(3000);
idx_base_table BITS_IDX_BASE_TBL := BITS_IDX_BASE_TBL();
tmp_pos1 number;
tmp_pos2 number;
tmp_pos3 number;
BEGIN
c := utl_tcp.open_connection(remote_host => currentIdxServerAdr,
remote_port => currentIdxServerPort); -- open connection
ret_val := utl_tcp.write_line