0
type NumberTable is table of number index by binary_integer;

create procedure TestNumberTable
(
    p_NumTable         IN NumberTable Default Cast(Null as NumberTable)
)
as
    /* code body */

两个问题:

  1. 如何在存储过程中检查参数的可空性?

  2. 如何在存储过程中找到参数的count(*) [即行数]?

4

1 回答 1

0

您不能使用“二进制整数索引”创建 UDT,您可以这样做:

create type NumberTable is table of number;

Q1:“可空性”是指“是否为空”?如果是这样,这将起作用:

create procedure TestNumberTable
( p_NumTable IN NumberTable Default null)
as 
  if p_NumTable is null then
     ...

Q2:计数:

create procedure TestNumberTable
( p_NumTable IN NumberTable Default null)
as 
  dbms_output.put_line ('count is '||p_NumTable.count);
  ...
于 2012-05-29T10:06:56.480 回答