原码如下:
create or replace procedure AAA
(RESULT OUT CHAR)
ASTEMP1 CHAR(10);
TEMP2 CHAR(4);BEGIN
select lpad(sequence.nextval,6,'0') into temp1 from dual;
select to_char(sysdate,'yy') into temp2 from dual;
result:=temp1 || temp2;
END;上述代码总是出错,提示参数数量或类型不对,不知是何原因???
create or replace procedure AAA
(RESULT OUT CHAR)
ASTEMP1 CHAR(10);
TEMP2 CHAR(4);BEGIN
select lpad(sequence.nextval,6,'0') into temp1 from dual;
select to_char(sysdate,'yy') into temp2 from dual;
result:=temp1 || temp2;
END;上述代码总是出错,提示参数数量或类型不对,不知是何原因???
(RESULT OUT varchar2)
AS
BEGIN
select lpad(sequence.nextval,6,'0')||to_char(sysdate,'yy') into result from dual;
END;
改为varchar2(自动变长)
09:55:20 2 (RESULT OUT CHAR)
09:55:20 3 AS
09:55:20 4
09:55:20 5 TEMP1 CHAR(10);
09:55:20 6 TEMP2 CHAR(4);
09:55:20 7
09:55:20 8 BEGIN
09:55:20 9 select lpad(s_id.nextval,6,'0') into temp1 from dual;
09:55:20 10
09:55:20 11 select to_char(sysdate,'yy') into temp2 from dual;
09:55:20 12
09:55:20 13 result:=temp1 || temp2;
09:55:20 14
09:55:20 15 END;
09:55:20 16 /过程已创建。实际:7370
09:55:29 SQL>
SQL> set time on;
10:30:38 SQL> 你的是不是编译没有问题
执行的时候有问题啊?
详细讲述当前用户有那些权限?或者可以到system下建,看是否出问题
并且也返回了正确的值 过程没有问题的
能够出来结果就对,不能出来就是权限角色的问题。
2 这样的问题没有什么其他原因。