2 Replies Latest reply: Jul 24, 2013 10:59 AM by LostInPermuation RSS

    getting invalid identifier...what am I overlooking?

    LostInPermuation

      Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

      PL/SQL Release 11.2.0.3.0 - Production

      CORE    11.2.0.3.0    Production

      TNS for Solaris: Version 11.2.0.3.0 - Production

      NLSRTL Version 11.2.0.3.0 - Production

       

      I'm trying to populate a child table, by querying from the parent.  When I do so, I am getting invalid identifier.  I've looked at this six ways from Sunday and I'm obviously getting cross eyed and missing something.

       

      Here is the parent table build.

       

      CREATE TABLE NRIS_WBETTERS.INDIVIDUAL_DATA

      (

        SITETYPE                   VARCHAR2(10 BYTE),

        AFOREST_CODE               VARCHAR2(6 BYTE),

        SUBUNIT                    VARCHAR2(25 BYTE),

        SAMP_STRATUM               VARCHAR2(6 BYTE),

        ENTERED                    DATE,

        SERIALNUMBER               NUMBER,

        ZIPCODE                    VARCHAR2(5 BYTE),

        HISPANIC                   VARCHAR2(6 BYTE),

        ARNDFAY                    NUMBER,

        NENTGFGA                   VARCHAR2(1 BYTE),

        TRVDIS                     NUMBER,

        INCOME                     VARCHAR2(9 BYTE),

        TRAVDIST                   NUMBER,

        NFARRIV                    NUMBER,

        NFLEAV                     NUMBER,

        NFDAYS                     NUMBER,

        WHEN_LEAVE_GFA             VARCHAR2(11 BYTE),

        WHEN_LEAVE_SITE            VARCHAR2(11 BYTE),

        SITENUMBER                 NUMBER,

        AGREE_TO_INTERVIEW         VARCHAR2(3 BYTE),

        AXLE_COUNT                 NUMBER,

        CLICK_START                NUMBER,

        REC_GFA                    VARCHAR2(3 BYTE),

        PURPOSE_SITE               VARCHAR2(35 BYTE),

        PURPOSE_GFA                VARCHAR2(35 BYTE),

        WHY_ROUTE                  VARCHAR2(5 BYTE),

        ROUND                      NUMBER,

        DATAYEAR                   VARCHAR2(4 BYTE),

        VISITED_OTHER_SITES        VARCHAR2(3 BYTE),

        INTERVIEW_DATE             DATE,

        INTERVIEW_TIME             DATE,

        TIME_LEAVING_SITE          DATE,

        DATE_ARRIVE_SITE           DATE,

        TIME_ARRIVE_SITE           DATE,

        DATE_ARRIVE_NF             DATE,

        TIME_ARRIVE_NF             DATE,

        DATE_DEPART_NF             DATE,

        TIME_LEAVE_NF              DATE,

        DUDS_USED                  NUMBER,

        LODGING_DIF_USED           NUMBER,

        ENTER_WILDERNESS           VARCHAR2(3 BYTE),

        ENTER_GFA                  VARCHAR2(3 BYTE),

        DONT_KNOW_ZIP              VARCHAR2(3 BYTE),

        GFA_HOURS                  NUMBER,

        GFA_MINUTES                NUMBER,

        GFA_DAYS                   NUMBER,

        PEOPLE_IN_VEHICLE          NUMBER,

        NUMBER_UNDER16             NUMBER,

        PERSON1_SEX                VARCHAR2(1 BYTE),

        PERSON2_SEX                VARCHAR2(1 BYTE),

        PERSON3_SEX                VARCHAR2(1 BYTE),

        PERSON4_SEX                VARCHAR2(1 BYTE),

        PERSON1_AGE                VARCHAR2(8 BYTE),

        PERSON2_AGE                VARCHAR2(8 BYTE),

        PERSON3_AGE                VARCHAR2(8 BYTE),

        PERSON4_AGE                VARCHAR2(8 BYTE),

        CROWDING                   NUMBER,

        PARTICIPATE_DOWNHILL_SKI   VARCHAR2(3 BYTE),

        MAIN_DOWNHILL_SKI          VARCHAR2(3 BYTE),

        PARTICIPATE_FISHING        VARCHAR2(3 BYTE),

        MAIN_FISHING               VARCHAR2(3 BYTE),

        PARTICIPATE_HUNTING        VARCHAR2(3 BYTE),

        MAIN_HUNTING               VARCHAR2(3 BYTE),

        PARTICIPATE_VIEW_WILDLIFE  VARCHAR2(3 BYTE),

        MAIN_VIEW_WILDLIFE         VARCHAR2(3 BYTE),

        PARTICIPATE_VIEW_NATURE    VARCHAR2(3 BYTE),

        MAIN_VIEW_NATURE           VARCHAR2(3 BYTE),

        PARTICIPATE_HISTORY        VARCHAR2(3 BYTE),

        MAIN_HISTORY               VARCHAR2(3 BYTE),

        PARTICIPATE_NATURE_STUDY   VARCHAR2(3 BYTE),

        MAIN_NATURE_STUDY          VARCHAR2(3 BYTE),

        PARTICIPATE_NATURE_CENTER  VARCHAR2(3 BYTE),

        MAIN_NATURE_CENTER         VARCHAR2(3 BYTE),

        PARTICIPATE_HIKING         VARCHAR2(3 BYTE),

        MAIN_HIKING                VARCHAR2(3 BYTE),

        PARTICIPATE_HORSE          VARCHAR2(3 BYTE),

        MAIN_HORSE                 VARCHAR2(3 BYTE),

        PARTICIPATE_BIKING         VARCHAR2(3 BYTE),

        MAIN_BIKING                VARCHAR2(3 BYTE),

        PARTICIPATE_NONMOT_WATER   VARCHAR2(3 BYTE),

        MAIN_NONMOT_WATER          VARCHAR2(3 BYTE),

        PARTICIPATE_XC_SKI         VARCHAR2(3 BYTE),

        MAIN_XC_SKI                VARCHAR2(3 BYTE),

        PARTICIPATE_OTHER_NONMOT   VARCHAR2(3 BYTE),

        MAIN_OTHER_NONMOT          VARCHAR2(3 BYTE),

        PARTICIPATE_DRIVING        VARCHAR2(3 BYTE),

        MAIN_DRIVING               VARCHAR2(3 BYTE),

        PARTICIPATE_MOTOR_TRAIL    VARCHAR2(3 BYTE),

        MAIN_MOTOR_TRAIL           VARCHAR2(3 BYTE),

        PARTICIPATE_OHV_USE        VARCHAR2(3 BYTE),

        MAIN_OHV_USE               VARCHAR2(3 BYTE),

        PARTICIPATE_SNOWMOBILE     VARCHAR2(3 BYTE),

        MAIN_SNOWMOBILE            VARCHAR2(3 BYTE),

        PARTICIPATE_MOT_WATER      VARCHAR2(3 BYTE),

        MAIN_MOT_WATER             VARCHAR2(3 BYTE),

        PARTICIPATE_OTHER_MOT      VARCHAR2(3 BYTE),

        MAIN_OTHER_MOT             VARCHAR2(3 BYTE),

        PARTICIPATE_DEV_CAMPING    VARCHAR2(3 BYTE),

        MAIN_DEV_CAMPING           VARCHAR2(3 BYTE),

        PARTICIPATE_PRIM_CAMPING   VARCHAR2(3 BYTE),

        MAIN_PRIM_CAMPING          VARCHAR2(3 BYTE),

        PARTICIPATE_BACKPACK       VARCHAR2(3 BYTE),

        MAIN_BACKPACK              VARCHAR2(3 BYTE),

        PARTICIPATE_RESORTS        VARCHAR2(3 BYTE),

        MAIN_RESORTS               VARCHAR2(3 BYTE),

        PARTICIPATE_GATHERING      VARCHAR2(3 BYTE),

        MAIN_GATHERING             VARCHAR2(3 BYTE),

        PARTICIPATE_RELAX          VARCHAR2(3 BYTE),

        MAIN_RELAX                 VARCHAR2(3 BYTE),

        PARTICIPATE_PICNIC         VARCHAR2(3 BYTE),

        MAIN_PICNIC                VARCHAR2(3 BYTE),

        PARTICIPATE_OTH_ACTIV      VARCHAR2(3 BYTE),

        MAIN_OTH_ACTIV             VARCHAR2(3 BYTE),

        HOURS_MAIN_ACTIVITY        NUMBER,

        OVERALL_SATISFACTION       VARCHAR2(7 BYTE),

        PROXY_RE1Q1                NUMBER,

        PROXY_RE1Q2                NUMBER,

        PROXY_FR1Q1                VARCHAR2(9 BYTE),

        PROXY_FR1Q2                NUMBER,

        PROXY_RE4Q1                NUMBER,

        PROXY_RE4Q2                NUMBER,

        PROXY_MA2Q1                NUMBER,

        PROXY_MA2Q2                NUMBER,

        FROM_CANADA                VARCHAR2(3 BYTE),

        FROM_MEXICO                VARCHAR2(3 BYTE),

        FROM_SAMERICA              VARCHAR2(3 BYTE),

        FROM_ASIA                  VARCHAR2(3 BYTE),

        FROM_EUROPE                VARCHAR2(3 BYTE),

        FROM_OTH_COUNTRY           VARCHAR2(3 BYTE),

        NFVISITS_MAINACT_YEAR      NUMBER,

        TRAVEL_DISTANCE            NUMBER,

        NF_ARRIVE_SAMETIME         VARCHAR2(3 BYTE),

        NF_DEPART_SAMETIME         VARCHAR2(3 BYTE),

        PRIMARY_PURPOSE            VARCHAR2(16 BYTE),

        IMPORT_CLEANLINESS         NUMBER,

        IMPORT_DEVFACILITIES       NUMBER,

        IMPORT_DISPLAYS            NUMBER,

        IMPORT_HELPFULNESS         NUMBER,

        IMPORT_NATENVR             NUMBER,

        IMPORT_PARKING             NUMBER,

        IMPORT_PARKINGLOT          NUMBER,

        IMPORT_RECINFO             NUMBER,

        IMPORT_ROADS               NUMBER,

        IMPORT_SAFETY              NUMBER,

        IMPORT_SIGNAGE             NUMBER,

        IMPORT_TOTALROADS          NUMBER,

        IMPORT_TOTALSIGNS          NUMBER,

        IMPORT_TRAILS              NUMBER,

        IMPORT_VALUE               NUMBER,

        IMPORT_SCENERY             NUMBER,

        SATIS_CLEANLINESS          VARCHAR2(7 BYTE),

        SATIS_DEVFACILITIES        VARCHAR2(7 BYTE),

        SATIS_DISPLAYS             VARCHAR2(7 BYTE),

        SATIS_HELPFULNESS          VARCHAR2(7 BYTE),

        SATIS_NATENVR              VARCHAR2(7 BYTE),

        SATIS_PARKING              VARCHAR2(7 BYTE),

        SATIS_PARKINGLOT           VARCHAR2(7 BYTE),

        SATIS_RECINFO              VARCHAR2(7 BYTE),

        SATIS_ROADS                VARCHAR2(7 BYTE),

        SATIS_SAFETY               VARCHAR2(7 BYTE),

        SATIS_SIGNAGE              VARCHAR2(7 BYTE),

        SATIS_TOTALROADS           VARCHAR2(7 BYTE),

        SATIS_TOTALSIGNS           VARCHAR2(7 BYTE),

        SATIS_TRAILS               VARCHAR2(7 BYTE),

        SATIS_VALUE                VARCHAR2(7 BYTE),

        SATIS_SCENERY              VARCHAR2(7 BYTE),

        SOMEONE_DISABLED           VARCHAR2(3 BYTE),

        DONT_KNOW_TOTALTRIP        VARCHAR2(3 BYTE),

        DONT_KNOW_EXP              VARCHAR2(3 BYTE),

        REFUSE_EXP                 VARCHAR2(3 BYTE),

        REFUSE_TOTALTRIP           VARCHAR2(3 BYTE),

        DONT_KNOW_INC              VARCHAR2(3 BYTE),

        REFUSE_INCOME              VARCHAR2(3 BYTE),

        DONT_KNOW_MILES            VARCHAR2(3 BYTE),

        SUBST_DISTANCE_FROMHOME    NUMBER,

        SPEND_MOTEL                NUMBER,

        SPEND_CAMPING              NUMBER,

        SPEND_GASOIL               NUMBER,

        SPEND_GROCERIES            NUMBER,

        SPEND_LOCALTRANSP          NUMBER,

        SPEND_RESTBAR              NUMBER,

        SPEND_SOUVOTHER            NUMBER,

        SPEND_SPGOODS              NUMBER,

        SPEND_RECENT               NUMBER,

        SPEND_RECFEES              NUMBER,

        SPEND_TOTAL_TRIP           NUMBER,

        SUB_GOELSEWHERE_SAMEACT    VARCHAR2(3 BYTE),

        SUB_COMEBACK               VARCHAR2(3 BYTE),

        SUB_GOELSEWHERE_DIFFACT    VARCHAR2(3 BYTE),

        SUB_STAYHOME               VARCHAR2(3 BYTE),

        SUB_WORK                   VARCHAR2(3 BYTE),

        SUB_OTHERREASON            VARCHAR2(3 BYTE),

        LODGING_CABIN_NF           VARCHAR2(3 BYTE),

        LODGING_CAMP_NF            VARCHAR2(3 BYTE),

        LODGING_CAMP_UNDEV         VARCHAR2(3 BYTE),

        LODGING_CAMP_PVT           VARCHAR2(3 BYTE),

        LODGING_OTHER_PUB_CAMP     VARCHAR2(3 BYTE),

        LODGING_RENTED_NOTNF       VARCHAR2(3 BYTE),

        LODGING_PVTHOME            VARCHAR2(3 BYTE),

        LODGING_OWNHOME            VARCHAR2(3 BYTE),

        LODGING_OTHER              VARCHAR2(3 BYTE),

        RACE_ASIAN                 VARCHAR2(3 BYTE),

        RACE_BLACK                 VARCHAR2(3 BYTE),

        RACE_NATIVAM               VARCHAR2(3 BYTE),

        RACE_PACISLAND             VARCHAR2(3 BYTE),

        RACE_WHITE                 VARCHAR2(3 BYTE),

        USED_BYWAY                 VARCHAR2(3 BYTE),

        USED_FISHSITE              VARCHAR2(3 BYTE),

        USED_INFOSITE              VARCHAR2(3 BYTE),

        USED_INTSITE               VARCHAR2(3 BYTE),

        USED_MOTORTRAIL1           VARCHAR2(3 BYTE),

        USED_MOTORTRAIL2           VARCHAR2(3 BYTE),

        USED_NONE                  VARCHAR2(3 BYTE),

        USED_ORVAREA               VARCHAR2(3 BYTE),

        USED_ROADS                 VARCHAR2(3 BYTE),

        USED_SWIM                  VARCHAR2(3 BYTE),

        USED_VISCENTER             VARCHAR2(3 BYTE),

        SCAN_HEADER                VARCHAR2(40 BYTE),

        FACILITIES_ACCESSIBLE      VARCHAR2(3 BYTE),

        LASTNIGHT_INFOREST         VARCHAR2(3 BYTE),

        NIGHTS_AWAY                NUMBER,

        NIGHT_50MILES              NUMBER,

        NONITES_50MILES            VARCHAR2(3 BYTE),

        LAST_EXIT_REC              NUMBER,

        GFA_VIEWING                NUMBER,

        SVEXPAND                   NUMBER,

        NV_VISITS_12MONTHS         NUMBER,

        PURPOSE_GFA_BATHROOM       VARCHAR2(3 BYTE),

        PURPOSE_GFA_OTHREASN       VARCHAR2(3 BYTE),

        PURPOSE_GFA_PASSTHRU       VARCHAR2(3 BYTE),

        PURPOSE_GFA_RECREATE       VARCHAR2(3 BYTE),

        PURPOSE_GFA_WORKING        VARCHAR2(3 BYTE),

        PURPOSE_SITE_BATHROOM      VARCHAR2(3 BYTE),

        PURPOSE_SITE_OTHREASN      VARCHAR2(3 BYTE),

        PURPOSE_SITE_PASSTHRU      VARCHAR2(3 BYTE),

        PURPOSE_SITE_RECREATE      VARCHAR2(3 BYTE),

        PURPOSE_SITE_WORKING       VARCHAR2(3 BYTE),

        FORM                       VARCHAR2(7 BYTE),

        OVERNIGHT                  VARCHAR2(2 BYTE),

        NVEXPAND                   NUMBER,

        ADMIN_UNIT                 VARCHAR2(50 BYTE)

      )

      TABLESPACE USERS

      RESULT_CACHE (MODE DEFAULT)

      PCTUSED    0

      PCTFREE    10

      INITRANS   1

      MAXTRANS   255

      STORAGE    (

                  INITIAL          80K

                  NEXT             1M

                  MINEXTENTS       1

                  MAXEXTENTS       UNLIMITED

                  PCTINCREASE      0

                  BUFFER_POOL      DEFAULT

                  FLASH_CACHE      DEFAULT

                  CELL_FLASH_CACHE DEFAULT

                 )

      LOGGING

      NOCOMPRESS

      NOCACHE

      NOPARALLEL

      MONITORING;

       

      Here is the child table build

       

      CREATE TABLE nris_wbetters.NRN_BASIC_VISIT

      (

        BASIC_VISIT_CN           VARCHAR2(40 BYTE)    DEFAULT sys_guid()            NOT NULL,

        ADMIN_CN_FK              VARCHAR2(40 BYTE)    NOT NULL,

        NV_VISITS_12MONTHS       NUMBER(8),

        NF_NIGHTS                NUMBER(8),

        VISITED_OTHER_SITES      VARCHAR2(1 BYTE),

        VISITED_TOT_SITES        NUMBER(8),

        DUDS_USED                NUMBER(8),

        LODGING_DIF_USED         NUMBER(8),

        GFA_DIFF_DAYS            NUMBER(4),

        ENTER_GFA                VARCHAR2(1 BYTE),

        WILDERNESS_DIFF_DAYS     NUMBER(4),

        ENTER_WILDERNESS         VARCHAR2(1 BYTE),

        WILDERNESS_GUIDE         VARCHAR2(1 BYTE),

        NF_ARRIVE_SAMETIME       VARCHAR2(1 BYTE),

        NF_DEPART_SAMETIME       VARCHAR2(1 BYTE),

        PEOPLE_IN_VEHICLE        NUMBER(8),

        TRAVEL_DISTANCE          NUMBER(8),

        PRIMARY_PURPOSE          VARCHAR2(13 BYTE),

        GFA_HOURS                NUMBER(8),

        GFA_DAYS                 NUMBER(8),

        GFA_MINUTES              NUMBER(8),

        DATE_ARRIVE_SITE         DATE,

        DATE_ARRIVE_NF           DATE,

        DATE_DEPART_NF           DATE,

        SUB_GOELSEWHERE_DIFFACT  VARCHAR2(1 BYTE),

        SUB_COMEBACK             VARCHAR2(1 BYTE),

        SUB_STAYHOME             VARCHAR2(1 BYTE),

        SUB_WORK                 VARCHAR2(1 BYTE),

        SUB_OTHERREASON          VARCHAR2(1 BYTE),

        SUB_GOELSEWHERE_SAMEACT  VARCHAR2(1 BYTE),

        DAYS_AWAY                NUMBER(8),

        NFVISITS_MAINACT_YEAR    NUMBER(8),

        NF_PRIMARYDEST           VARCHAR2(1 BYTE),

        OVERNIGHT                VARCHAR2(1 BYTE),

        NIGHTS_AWAY              NUMBER(8),

        NIGHT_50MILES            NUMBER(8),

        NONITES_50MILES          VARCHAR2(1 BYTE),

        HOURS_AWAY               NUMBER(8),

        JUST_HERE                VARCHAR2(12 BYTE),

        WHAT_ASSISTANCE          VARCHAR2(120 BYTE),

        OVERALL_SATISFACTION     VARCHAR2(25 BYTE),

        LASTNIGHT_INFOREST       VARCHAR2(1 BYTE),

        VPDUNIT_ID               VARCHAR2(10 BYTE)    NOT NULL,

        LAST_UPDATE              TIMESTAMP(6) WITH TIME ZONE DEFAULT systimestamp NOT NULL

      )

      NOCOMPRESS

      TABLESPACE USERS

      PCTUSED    0

      PCTFREE    10

      INITRANS   1

      MAXTRANS   255

      STORAGE    (

                  MINEXTENTS       1

                  MAXEXTENTS       UNLIMITED

                  PCTINCREASE      0

                  BUFFER_POOL      DEFAULT

                 )

      LOGGING

      PARTITION BY HASH (ADMIN_CN_FK)

        PARTITION P01

          TABLESPACE USERS, 

        PARTITION P02

          TABLESPACE USERS, 

        PARTITION P03

          TABLESPACE USERS, 

        PARTITION P04

          TABLESPACE USERS, 

        PARTITION P05

          TABLESPACE USERS, 

        PARTITION P06

          TABLESPACE USERS, 

        PARTITION P07

          TABLESPACE USERS, 

        PARTITION P08

          TABLESPACE USERS

      )

      NOCACHE

      NOPARALLEL

      MONITORING

      ENABLE ROW MOVEMENT;


      And here is my inset statement..it wipes out the table first of the old data, and then inserts the new.


      truncate table NRIS_WBETTERS.nrn_basic_visit;

       

      insert into NRIS_WBETTERS.nrn_basic_visit

      (basic_visit_cn,

      admin_cn_fk,

      nv_visits_12months,

      nf_nights,

      visited_other_sites,

      visited_tot_sites,

      duds_used,

      lodging_dif_used,

      gfa_diff_days,

      enter_gfa,

      wilderness_diff_days,

      enter_wilderness,

      wilderness_guide,

      nf_arrive_sametime,

      nf_depart_sametime,

      people_in_vehicle,

      travel_distance,

      primary_purpose,

      gfa_hours,

      gfa_days,

      gfa_minutes,

      date_arrive_site,

      date_arrive_nf,

      date_depart_nf,

      sub_goelsewhere_diffact,

      sub_comeback,

      sub_stayhome,

      sub_work,

      sub_otherreason,

      sub_goelsewhere_sameact,

      days_away,

      nfvisits_mainact_year,

      nf_primarydest,

      overnight,

      nights_away,

      night_50miles,

      nonites_50miles,

      hours_away,

      just_here,

      what_assistance,

      overall_satisfaction,

      lastnight_inforest,

      vpdunit_id,

      last_update)

      select sys_guid()

      ,admin_cn

      ,to_number(nv_visits_12months)

      ,null nf_nights -- Round 1 only

      ,decode(upper(visited_other_sites),'NO','N','YES','Y','DK','D',null) visited_other_sites

      ,null visited_tot_sites  -- Round 1 only

      ,duds_used

      ,lodging_dif_used

      ,null gfa_diff_days  -- Round 1 only

      ,decode(upper(enter_gfa),'NO','N','YES','Y','*',null,null) enter_gfa

      ,null wilderness_diff_days  -- Round 1 only

      ,decode(upper(enter_wilderness),'NO','N','YES','Y',null) enter_wilderness

      ,null wilderness_guide  -- Round 1 only

      ,decode(upper(nf_arrive_sametime),'NO','N','YES','Y',nf_arrive_sametime) nf_arrive_sametime

      ,decode(upper(nf_depart_sametime),'NO','N','YES','Y',nf_depart_sametime) nf_depart_sametime

      ,people_in_vehicle

      ,travel_distance

      ,decode(upper(primary_purpose),null,null

                                    ,'NOT REC-SIDETRIP','BusFam'

                                    ,'OTHER REASON','Other'

                                    ,'REC AT THIS NF','RecAtNF'

                                    ,'REC- OTHER DEST','RecOther'

                                    ,'INVALID PRIMARY_PURPOSE') primary_purpose

      ,gfa_hours

      ,gfa_days

      ,gfa_minutes

      ,date_arrive_site

      ,date_arrive_nf

      ,date_depart_nf

      ,decode(upper(sub_goelsewhere_diffact),'NO','N','YES','Y',sub_goelsewhere_diffact) sub_goelsewhere_diffact

      ,decode(upper(sub_comeback),'NO','N','YES','Y',sub_comeback) sub_comeback

      ,decode(upper(sub_stayhome),'NO','N','YES','Y',sub_stayhome) sub_stayhome

      ,decode(upper(sub_work),'NO','N','YES','Y',sub_work) sub_work

      ,decode(upper(sub_otherreason),'NO','N','YES','Y',sub_otherreason) sub_otherreason

      ,decode(upper(sub_goelsewhere_sameact),'NO','N','YES','Y',sub_goelsewhere_sameact) sub_goelsewhere_sameact

      ,null days_away  -- Round 1 only

      ,nfvisits_mainact_year

      ,null nf_primarydest  -- Round 1 only

      ,decode(upper(overnight),'NO','N','YES','Y','4','Y','6','N',overnight) overnight

      ,nights_away

      ,night_50miles

      ,decode(upper(nonites_50miles),'NO','N','YES','Y',nonites_50miles) nonites_50miles

      ,null hours_away  -- Round 1 only

      ,null just_here  -- Round 1 only

      ,null what_assistance  -- Round 1 only

      ,decode(upper(overall_satisfaction),null,null

                                         ,'NEITHER','Neither'

                                         ,'SOMEDIS','SomeDis'

                                         ,'SOMESAT','SomeSat'

                                         ,'VERYDIS','VeryDis'

                                         ,'VERYSAT','VerySat'

                                         ,'005',null

                                         ,'INVALID OVERALL_SATISFACTION') overall_satisfaction

      ,decode(upper(lastnight_inforest),'NO','N','YES','Y','*',null,lastnight_inforest) lastnight_inforest

      ,substr(AForest_Code,2,2)||substr(AForest_Code,5,2) vpdunit_id

      ,sysdate

      from NRIS_WBETTERS.individual_data

      order by admin_cn;

       

      -- now delete the empty records

       

      delete from NRIS_WBETTERS.nrn_basic_visit

      where nv_visits_12months is null

         and nf_nights is null

         and visited_other_sites is null

         and visited_tot_sites is null

         and duds_used is null

         and lodging_dif_used is null

         and gfa_diff_days is null

         and enter_gfa is null

         and wilderness_diff_days is null

         and enter_wilderness is null

         and wilderness_guide is null

         and nf_arrive_sametime is null

         and nf_depart_sametime is null

         and people_in_vehicle is null

         and travel_distance is null

         and primary_purpose is null

         and gfa_hours is null

         and gfa_days is null

         and gfa_minutes is null

         and date_arrive_site is null

         and date_arrive_nf is null

         and date_depart_nf is null

         and sub_goelsewhere_diffact is null

         and sub_comeback is null

         and sub_stayhome is null

         and sub_work is null

         and sub_otherreason is null

         and sub_goelsewhere_sameact is null

         and days_away is null

         and nfvisits_mainact_year is null

         and nf_primarydest is null

         and overnight is null

         and nights_away is null

         and night_50miles is null

         and nonites_50miles is null

         and hours_away is null

         and just_here is null

         and what_assistance is null

         and overall_satisfaction is null

         and lastnight_inforest is null;

       

      commit;

       

      When I try to run the insert, it tells me:

      ORA-00904: "ADMIN_CN": invalid identifier