我在windows8上的oracle 12c中有以下代码用于表值函数 如下
CREATE TABLE MisJob
( ID RAW(16),
JobTitle VARCHAR2(35 BYTE),
MinSalary NUMBER(6,0),
MaxSalary NUMBER(6,0),
PRIMARY KEY (ID)
)
CREATE TYPE MISJOBType AS OBJECT ( JobTitle VARCHAR2(35 BYTE), MinSalary NUMBER(6,0),MaxSalary NUMBER(6,0));
CREATE TYPE MISJOBTypeCol AS TABLE OF MISJOBType;
CREATE OR REPLACE FUNCTION fEmployee (jobid IN RAW(16))
RETURN MISJOBTypeCol PIPELINED IS
BEGIN
FOR i IN (SELECT * FROM MisJob)LOOP
PIPE ROW(MISJOBType(i.JobTitle, i.MinSalary,i.MaxSalary));
END LOOP;
RETURN;
END;
但是我收到了错误 错误(2,13):PLS-00103:遇到符号“(”当期望下列之一:: =。),@%默认字符符号“:=”代替“(”继续。
我不知道为什么即使我已经按照这个例子 Table-Valued Functions in ORACLE 11g ? ( parameterized views )
出了什么问题
答案 0 :(得分:1)
删除形式参数的大小约束:
CREATE OR REPLACE FUNCTION fEmployee (jobid IN RAW)
...
...您不能在形式参数声明中包含约束