Good Afternoon TOAD Team,
Not to surprising, that post had no takers; very detailed. Well I've had no issues since that post until today, Version 13.0.0.66; I generated hundred thousands of records. This may be a user input error, too. Ill try again in the morning. Today's error (I only edited the comment): Error message following script...
/************************************************************
** Table: CMS.CMS_CASE_DEMOGRAPHIC__100.sql
** Number of Records: 100
************************************************************/
DECLARE
SUBTYPE MAXVARCHAR2 IS VARCHAR2(32767);
TYPE Used_Array IS TABLE OF MAXVARCHAR2 INDEX BY MAXVARCHAR2;
TYPE CASEID_Array IS TABLE OF CMS.CMS_CASE_DEMOGRAPHIC.CASE_ID%TYPE INDEX BY PLS_INTEGER;
l_CASEID CASEID_Array;
l_CASEID_Used Used_Array;
v_CASEID CMS.CMS_CASE_DEMOGRAPHIC.CASE_ID%TYPE;
t_seed NUMBER(20);
t_exists BOOLEAN;
BEGIN
-- Initialize Random Number Generator
SELECT TO_NUMBER(TO_CHAR(SYSDATE, 'MMDDHH24MISS'))
INTO t_seed
FROM Dual;
DBMS_RANDOM.INITIALIZE(t_seed);
-- Bulk Collect existing values into arrays
SELECT CASE_ID BULK COLLECT INTO l_CASEID FROM CMS.CMS_CASE_DEMOGRAPHIC;
FOR t_counter IN 1..l_CASEID.COUNT LOOP
l_CASEID_Used(TO_CHAR(l_CASEID(t_counter))) := TO_CHAR(l_CASEID(t_counter));
END LOOP;
-- Generate Random Data
FOR t_counter IN 1..100 LOOP
-- Generate random value for CASE_ID and compare against existing list
LOOP
v_CASEID := (SELECT CASE_ID FROM (SELECT CASE_ID FROM CMS.CMS_CASE ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1);
t_exists := l_CASEID_Used.EXISTS(TO_CHAR(v_CASEID));
IF NOT t_exists THEN
l_CASEID_Used(TO_CHAR(v_CASEID)) := TO_CHAR(v_CASEID);
END IF;
EXIT WHEN (NOT t_exists);
END LOOP;
INSERT INTO CMS.CMS_CASE_DEMOGRAPHIC (
CASE_ID, INDIVIDUAL_WITH_DISABILITY_ID, CATEGORY_OF_DISABILITY_ID, DISABILITY_WORK_SETTING_ID,
DISABILITY_EMPLOYMENT_SRVC_ID, DISABILITY_FINANCIAL_CPBLT_ID, HISPANIC_LATINO_ID,
AMERICAN_INDN_OR_ALSKN_NTV_ID, ASIAN_ID, BLACK_ID, NATIVE_HAWAIAN_ID, WHITE_ID,
RESERVATION_ID, TRIBE_ID, DISTRICT_ID, FIELD_OFFICE_ID, DISABILITY_IEP_ID, IS_DISABILITY_SDDA_SERVICES,
IS_DISABILITY_LSMHA_SERVICES, IS_DISABILITY_HCBS_SERVICES, CREATED_DATE, CREATED_BY,
MODIFIED_DATE, MODIFIED_BY, INDV_DISABILITY_REPORT_ID
) VALUES (
( SELECT CASE_ID FROM (SELECT CASE_ID FROM "CMS"."CMS_CASE" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT RESERVATION_ID FROM (SELECT RESERVATION_ID FROM "CMS"."CMS_R_RESERVATION" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT TRIBE_ID FROM (SELECT TRIBE_ID FROM "CMS"."CMS_R_TRIBE" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT DISTRICT_ID FROM (SELECT DISTRICT_ID FROM "CMS"."CMS_R_DISTRICT" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT FIELD_OFFICE_ID FROM (SELECT FIELD_OFFICE_ID FROM "CMS"."CMS_R_FIELD_OFFICE" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
(SELECT IS_DISABILITY_SDDA_SERVICES FROM (SELECT IS_DISABILITY_SDDA_SERVICES FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
(SELECT IS_DISABILITY_LSMHA_SERVICES FROM (SELECT IS_DISABILITY_LSMHA_SERVICES FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
(SELECT IS_DISABILITY_HCBS_SERVICES FROM (SELECT IS_DISABILITY_HCBS_SERVICES FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
TOAD_DATAGEN.RandomDate(2457389, 2458209, 0), (SELECT CREATED_BY FROM (SELECT CREATED_BY FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
TOAD_DATAGEN.RandomDate(2457389, 2458209, 0), (SELECT MODIFIED_BY FROM (SELECT MODIFIED_BY FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
( SELECT BUSINESS_DATA_ID FROM (SELECT BUSINESS_DATA_ID FROM "CMS"."CMS_R_BUSINESS_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 )
);
END LOOP;
DBMS_RANDOM.TERMINATE;
END;
/
COMMIT;
/
___________________________________________ Error Message ___________________________________________________________
DECLARE
SUBTYPE MAXVARCHAR2 IS VARCHAR2(32767);
TYPE Used_Array IS TABLE OF MAXVARCHAR2 INDEX BY MAXVARCHAR2;
TYPE CASEID_Array IS TABLE OF CMS.CMS_CASE_DEMOGRAPHIC.CASE_ID%TYPE INDEX BY PLS_INTEGER;
l_CASEID CASEID_Array;
l_CASEID_Used Used_Array;
v_CASEID CMS.CMS_CASE_DEMOGRAPHIC.CASE_ID%TYPE;
t_seed NUMBER(20);
t_exists BOOLEAN;
BEGIN
-- Initialize Random Number Generator
SELECT TO_NUMBER(TO_CHAR(SYSDATE, 'MMDDHH24MISS'))
INTO t_seed
FROM Dual;
DBMS_RANDOM.INITIALIZE(t_seed);
-- Bulk Collect existing values into arrays
SELECT CASE_ID BULK COLLECT INTO l_CASEID FROM CMS.CMS_CASE_DEMOGRAPHIC;
FOR t_counter IN 1..l_CASEID.COUNT LOOP
l_CASEID_Used(TO_CHAR(l_CASEID(t_counter))) := TO_CHAR(l_CASEID(t_counter));
END LOOP;
-- Generate Random Data
FOR t_counter IN 1..100 LOOP
-- Generate random value for CASE_ID and compare against existing list
LOOP
v_CASEID := (SELECT CASE_ID FROM (SELECT CASE_ID FROM CMS.CMS_CASE ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1);
t_exists := l_CASEID_Used.EXISTS(TO_CHAR(v_CASEID));
IF NOT t_exists THEN
l_CASEID_Used(TO_CHAR(v_CASEID)) := TO_CHAR(v_CASEID);
END IF;
EXIT WHEN (NOT t_exists);
END LOOP;
INSERT INTO CMS.CMS_CASE_DEMOGRAPHIC (
CASE_ID, INDIVIDUAL_WITH_DISABILITY_ID, CATEGORY_OF_DISABILITY_ID, DISABILITY_WORK_SETTING_ID,
DISABILITY_EMPLOYMENT_SRVC_ID, DISABILITY_FINANCIAL_CPBLT_ID, HISPANIC_LATINO_ID,
AMERICAN_INDN_OR_ALSKN_NTV_ID, ASIAN_ID, BLACK_ID, NATIVE_HAWAIAN_ID, WHITE_ID,
RESERVATION_ID, TRIBE_ID, DISTRICT_ID, FIELD_OFFICE_ID, DISABILITY_IEP_ID, IS_DISABILITY_SDDA_SERVICES,
IS_DISABILITY_LSMHA_SERVICES, IS_DISABILITY_HCBS_SERVICES, CREATED_DATE, CREATED_BY,
MODIFIED_DATE, MODIFIED_BY, INDV_DISABILITY_REPORT_ID
) VALUES (
( SELECT CASE_ID FROM (SELECT CASE_ID FROM "CMS"."CMS_CASE" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT RESERVATION_ID FROM (SELECT RESERVATION_ID FROM "CMS"."CMS_R_RESERVATION" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT TRIBE_ID FROM (SELECT TRIBE_ID FROM "CMS"."CMS_R_TRIBE" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT DISTRICT_ID FROM (SELECT DISTRICT_ID FROM "CMS"."CMS_R_DISTRICT" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT FIELD_OFFICE_ID FROM (SELECT FIELD_OFFICE_ID FROM "CMS"."CMS_R_FIELD_OFFICE" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
( SELECT PIRL_DATA_ID FROM (SELECT PIRL_DATA_ID FROM "CMS"."CMS_R_PIRL_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 ),
(SELECT IS_DISABILITY_SDDA_SERVICES FROM (SELECT IS_DISABILITY_SDDA_SERVICES FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
(SELECT IS_DISABILITY_LSMHA_SERVICES FROM (SELECT IS_DISABILITY_LSMHA_SERVICES FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
(SELECT IS_DISABILITY_HCBS_SERVICES FROM (SELECT IS_DISABILITY_HCBS_SERVICES FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
TOAD_DATAGEN.RandomDate(2457389, 2458209, 0), (SELECT CREATED_BY FROM (SELECT CREATED_BY FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
TOAD_DATAGEN.RandomDate(2457389, 2458209, 0), (SELECT MODIFIED_BY FROM (SELECT MODIFIED_BY FROM CMS.CMS_CASE_DEMOGRAPHIC ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1),
( SELECT BUSINESS_DATA_ID FROM (SELECT BUSINESS_DATA_ID FROM "CMS"."CMS_R_BUSINESS_DATA" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 )
);
END LOOP;
DBMS_RANDOM.TERMINATE;
END;
Error at line 6
ORA-06550: line 29, column 20:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + case mod new not null
continue avg count current exists max min prior sql stddev
sum variance execute forall merge time timestamp interval
date
pipe
<an alternat
ORA-06550: line 29, column 118:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
- & - + ; / at for mod remainder rem <an exponent (**)> and
or group having intersect minus order start union where
connect || multiset
ORA-06550: line 39, column 5:
PLS-00103: Encountered the symbol "INSERT" when expecting one of the following:
end not pragma final instantiable order overriding static
member constructor map
ORA-06550: line 47, column 9:
lumn 9:
r map
ORA-06550: line 47, column 9:
lumn 9:
Script Terminated on line 6 of \eta-940-01\home\Wickliffe.Larry\My Documents\EBSS\CMS\CMS.CMS_CASE_DEMOGRAPHIC_100.sql.