文章列表
Subscript_beyond_count(ora-06533)
使用嵌套表或varray集合时,如果引用下标超过last。
Subscript_outside_limit(ora-06532)
使用嵌套表或varray集合时,如果引用下标小于first。
CREATE OR REPLACE TYPE SPLIT_TBL IS TABLE OF VARCHAR2(32767);
要返回整个集合 return SPLIT_TBL
要返回集合中某个元素 return VARCHAR2 而不是SPLIT_TBL( t )
/* File on web: justonce.sql */
CREATE OR REPLACE PACKAGE BODY justonce
IS
TYPE desc_t IS TABLE OF hairstyles.description%TYPE
INDEX BY BINARY_INTEGER;
descriptions desc_t;
FUNCTION description (code_in IN hairstyles.code%TYPE)
RETURN hairs ...
1.Using an associative array 1 DECLARE
2 TYPE list_of_names_t IS TABLE OF person.first_name%TYPE
3 INDEX BY PLS_INTEGER;
4 happyfamily list_of_names_t;
5 l_row PLS_INTEGER;
6 BEGIN
7 happyfamily (2020202020) := 'Eli';
...
CREATE OR REPLACE FUNCTION SPLIT1
(
P_LIST VARCHAR2,
P_DEL VARCHAR2 := ','
) RETURN SPLIT_TBL
IS
l_idx PLS_INTEGER;
l_list VARCHAR2(32767) := P_LIST;
v_table SPLIT_TBL := SPLIT_TBL(); 少了红色代码会报错ORA-06531
v_temp PLS_INTEGER := 1;
BEGIN
LOOP
l_idx := INSTR(l_list,p_del);
IF l_idx > ...
表A指向(reference)表B,表A的外键为表B主键,表A是子表,表B是父表。
注意:插入数据时,表A的外键值不能插入表B中所没有的主键值,他们之间存在约束。
--------------------------------------------------------------------------------------------------------------------------------------------
注意:插入varchar类型的字段数据时别忘了了加 ''
---------------------------------- ...