sql - 错误的号码或循环输入
问题描述
收到此错误:
ERROR at line 5:
ORA-06550: line 5, column 19:
PLS-00306: wrong number or types of arguments in call to 'DAYS'
所以这是一个粗体的“天”的问题......为什么?
CREATE OR REPLACE
TYPE lyrics IS OBJECT
( date_name VARCHAR2(8)
, gift_name VARCHAR2(24));
/
DECLARE
TYPE days IS TABLE OF lyrics;
TYPE gifts IS TABLE OF lyrics;
lv_dates DAYS :=
**days**('first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelth');
解决方案
那将是这样的;数组中的元素必须是“对象”,因此您必须lyrics
在代码中指定:
SQL> create or replace
2 type lyrics is object
3 ( date_name varchar2(8)
4 , gift_name varchar2(24));
5 /
Type created.
SQL>
SQL> declare
2 type days is table of lyrics;
3 lv_dates days := days();
4 begin
5 lv_dates := days(lyrics('first', 'second'), lyrics('third', 'fourth'));
6 end;
7 /
PL/SQL procedure successfully completed.
SQL>
推荐阅读
- javascript - HTML 中的共享按钮
- php - PHP没有像我想要的那样解析JSON
- php - Laravel 上传数组
- javascript - Angular ngModel 不使用 ngFor [HTML SELECT INPUT] 选择
- android - 将应用内消息传递 sdk 添加到 gradle 后出错
- vue.js - 在 vue 实例中调用外部 javascript 函数
- c++ - 如何从函数返回多维 Mat 数组
- javascript - 如何在 Loopback 4 中监视文件更改?
- python - 无法使用 python 3.72 连接 firebase
- dart - 嵌套未来中的导航