Error with PL/SQL procedure to import data into the database

When you run the procedure below, I get the message:

Compilation failure, line 448
PLS-00103: encountered the symbol "LOOP" when expecting one of the following values: case of the symbol "case" was substituted for the "LOOP" continue. Compilation failure, line 450
PLS-00103: encountered the symbol ";" when expecting one of the following values: case

Can someone help me understand what im missing? Thank you

Deanna

CREATE OR REPLACE PROCEDURE PURSUITS.IMPORT_LEGACY_PURSUIT IS

CURSOR DATA_CURSOR IS
     SELECT * 
     FROM PURSUITS.IMPORT_LEGACY_PURSUIT;

CR DATA_CURSOR%ROWTYPE;


V_PURSUIT_DATE                DATE;
V_ROADWAY_TYPE                VARCHAR2(5);
V_TRAFFIC_FLOW                VARCHAR2(8);
V_REASON_FOR_INITIATION       VARCHAR2(6);
V_VEHICLE_MARKING             VARCHAR2(8);
V_VEHICLE_LIGHTS_ON           VARCHAR2(1);
V_VEHICLE_SIREN_ON            VARCHAR2(1);
V_AIRCRAFT_AVAILABLE             VARCHAR2(1);
V_AIRCRAFT_INVOLVED              VARCHAR2(1);
V_OTHER_AGENCY_INVOLVED          VARCHAR2(1);
V_OTHER_AGENCY_STATUS            VARCHAR2(8);
V_OTHER_AGENCY_COUNT            NUMBER(2,0);
V_SUSPECT_VEHICLE_TYPE          VARCHAR2(2);
V_SUSPECT_RACE                  VARCHAR2(1);
V_SUSPECT_ETHNICITY             VARCHAR2(1);
V_SUSPECT_ID_KNOWN              VARCHAR2(1);
V_SUSPECT_POSSESS_WEAPON        VARCHAR2(1);
V_REASON_FOR_TERMINATION        VARCHAR2(6);
V_REASON_FOR_FLIGHT             VARCHAR2(6);
V_ACCIDENT                      VARCHAR2(1);
V_ACCIDENT_TYPE                 VARCHAR2(8);
V_ACCIDENT_PARTIES_INVOLVED     VARCHAR2(8);

V_CASE_COUNT                    NUMBER;

BEGIN
  OPEN DATA_CURSOR;

  LOOP
       FETCH DATA_CURSOR INTO CR;

       EXIT WHEN DATA_CURSOR%NOTFOUND;

--PURSUIT DATE

--       IF CR.PURSUIT_DATE = 0 THEN
--       V_PURSUIT_DATE :=NULL;
--       ELSE
--            V_PURSUIT_DATE :=TO_DATE(CR.PURSUIT_DATE,CONCAT('MONTH'/'DAY'/'YEAR');
--       END IF;

--ROADWAY TYPE
       CASE
       WHEN CR.ROADWAY = 1 THEN
       V_ROADWAY_TYPE := 'URBAN';
       WHEN CR.ROADWAY = 2 THEN
       V_ROADWAY_TYPE := 'RURAL';
       ELSE
       V_ROADWAY_TYPE := NULL;
       END CASE;

--TRAFFIC FLOW
       CASE
       WHEN CR.TRAFFICFLO = 1 THEN
       V_TRAFFIC_FLOW := 'LIGHT';
       WHEN CR.TRAFFICFLO = 2 THEN
       V_TRAFFIC_FLOW := 'MODERATE';
       WHEN CR.TRAFFICFLO = 3 THEN
       V_TRAFFIC_FLOW := 'HIGH';
       ELSE
       V_TRAFFIC_FLOW := NULL;
       END_CASE;

--INITIATION CODES
       CASE
       WHEN CR.INITREASON = 1 THEN
       V_REASON_FOR_INITIATION := 'SUSACT';
       WHEN CR.INITREASON = 2 THEN
       V_REASON_FOR_INITIATION := 'TRAFVI';
       WHEN CR.INITREASON = 3 THEN
       V_REASON_FOR_INITIATION := 'MISCCR';
       WHEN CR.INITREASON = 4 THEN
       V_REASON_FOR_INITIATION := 'FELONY';
       WHEN CR.INITREASON = 5 THEN
       V_REASON_FOR_INITIATION := 'DUIARR';
       WHEN CR.INITREASON = 6 THEN
       V_REASON_FOR_INITIATION := 'NCICHT';
       WHEN CR.INITREASON = 7 THEN
       V_REASON_FOR_INITIATION := 'OTHERR';
       ELSE
       V_REASON_FOR_INITIATION := NULL;
       END_CASE;

--VEHICLE MARKING
       CASE
       WHEN CR.CARMARKS = 1 THEN
       V_VEHICLE_MARKING := 'MRKLIGHT';
       WHEN CR.CARMARKS = 2 THEN
       V_VEHICLE_MARKING := 'MRKCLEAN';
       WHEN CR.CARMARKS = 3 THEN
       V_VEHICLE_MARKING := 'UNMARKED';
       ELSE
       V_VEHICLE_MARKING := NULL;
       END CASE;

--LIGHTS
       CASE
       WHEN CR.LIGHTS_ON = 1 THEN
       V_VEHICLE_LIGHTS_ON := 'Y';
       WHEN CR.LIGHTS_ON = 2 THEN
       V_VEHICLE_LIGHTS_ON := 'N';
       ELSE
       V_VEHICLE_LIGHTS_ON := NULL;
       END CASE;


--SIREN
       CASE
       WHEN CR.SIREN_ON = 1 THEN
       V_VEHICLE_SIREN_ON := 'Y';
       WHEN CR.SIREN_ON = 2 THEN
       V_VEHICLE_SIREN_ON := 'N';
       ELSE
       V_VEHICLE_SIREN_ON := NULL;
       END CASE;

--AIRCRAFT AVAILABLE
       CASE
       WHEN CR.AIRCRAFTAV = 1 THEN
       V_AIRCRAFT_AVAILABLE := 'Y';
       WHEN CR.AIRCRAFTAV = 2 THEN
       V_AIRCRAFT_AVAILABLE := 'N';
       WHEN CR.AIRCRAFTAV = 3 THEN
       V_AIRCRAFT_AVAILABLE := 'U';
       ELSE
       V_AIRCRAFT_AVAILABLE := NULL;
       END CASE;

--AIRCRAFT INVOLVED
       CASE
       WHEN CR.AIRCRAFTIN = 1 THEN
       V_AIRCRAFT_INVOLVED := 'Y';
       WHEN CR.AIRCRAFTIN = 2 THEN
       V_AIRCRAFT_INVOLVED := 'N';
       ELSE
       V_AIRCRAFT_INVOLVED := NULL;
       END CASE;

--AGENCY INVOLVED
       CASE
       WHEN CR.OTHRAGENCY = 1 THEN
       V_OTHER_AGENCY_INVOLVED := 'Y';
       WHEN CR.OTHRAGENCY = 2 THEN
       V_OTHER_AGENCY_INVOLVED := 'N';
       ELSE
       V_OTHER_AGENCY_INVOLVED := NULL;
       END CASE;

--AGENCY STATUS
       CASE    
       WHEN CR.STATUS = 1 THEN
       V_OTHER_AGENCY_STATUS := 'INITIATE';
       WHEN CR.STATUS = 2 THEN
       V_OTHER_AGENCY_STATUS := 'ASSISTED';
       ELSE
       V_OTHER_AGENCY_STATUS := NULL;
       END CASE;

--SUSPECT VEHICLE TYPE
       CASE
       WHEN CR.VEHICLETYP = 1 THEN
       V_SUSPECT_VEHICLE_TYPE := 'SD';
       WHEN CR.VEHICLETYP = 2 THEN
       V_SUSPECT_VEHICLE_TYPE := 'MC';
       WHEN CR.VEHICLETYP = 3 THEN
       V_SUSPECT_VEHICLE_TYPE := 'VN';
       WHEN CR.VEHICLETYP = 4 THEN
       V_SUSPECT_VEHICLE_TYPE := 'PK';
       WHEN CR.VEHICLETYP = 5 THEN
       V_SUSPECT_VEHICLE_TYPE := 'DS';
       WHEN CR.VEHICLETYP = 6 THEN
       V_SUSPECT_VEHICLE_TYPE := 'OT';
       ELSE
       V_SUSPECT_VEHICLE_TYPE := NULL;
       END CASE;

--SUSPECT RACE AND ETHNICITY
       IF CR.RACE = 'H' THEN
       V_SUSPECT_RACE := 'W';
       ELSE
       V_SUSPECT_RACE := CR.RACE;
       END IF;

--SUSPECT ETHNICITY
       IF CR.RACE = 'H' THEN
       V_SUSPECT_ETHNICITY := 'H'
       ELSE
       V_SUSPECT_ETHNICITY := NULL;
       END IF;

--SUSPECT ID
       CASE
       WHEN CR.ID_KNOWN = 1 THEN
       V_SUSPECT_ID_KNOWN := 'Y';
       WHEN CR.ID_KNOWN = 2 THEN
       V_SUSPECT_ID_KNOWN := 'N';
       ELSE
       V_SUSPECT_ID_KNOWN := NULL;
       END CASE;

--SUSPECT WEAPON
       CASE
       WHEN CR.WEAPON = 1 THEN
       V_SUSPECT_POSSESS_WEAPON := 'Y';
       WHEN CR.WEAPON = 2 THEN
       V_SUSPECT_POSSESS_WEAPON := 'N';
       ELSE
       V_SUSPECT_POSSESS_WEAPON := NULL;
       END CASE;

--TERMINATION REASON
       CASE
       WHEN CR.TERMREASON = 1 THEN
       V_REASON_FOR_TERMINATION := 'DVRVOL';
       WHEN CR.TERMREASON = 2 THEN
       V_REASON_FOR_TERMINATION := 'ALATER';
       WHEN CR.TERMREASON = 3 THEN
       V_REASON_FOR_TERMINATION := 'VEHDIS';
       WHEN CR.TERMREASON = 4 THEN
       V_REASON_FOR_TERMINATION := 'VEHWRK';
       WHEN CR.TERMREASON = 5 THEN
       V_REASON_FOR_TERMINATION := 'ROADBL';
       WHEN CR.TERMREASON = 6 THEN
       V_REASON_FOR_TERMINATION := 'STOPST';
       WHEN CR.TERMREASON = 7 THEN
       V_REASON_FOR_TERMINATION := 'RAMMED';
       WHEN CR.TERMREASON = 8 THEN
       V_REASON_FOR_TERMINATION := 'WEAPON';
       WHEN CR.TERMREASON = 9 THEN
       V_REASON_FOR_TERMINATION := 'DVRINJ';
       WHEN CR.TERMREASON = 10 THEN
       V_REASON_FOR_TERMINATION := 'OFFTER';
       WHEN CR.TERMREASON = 11 THEN
       V_REASON_FOR_TERMINATION := 'SUPTER';
       WHEN CR.TERMREASON = 12 THEN
       V_REASON_FOR_TERMINATION := 'PATDIS';
       WHEN CR.TERMREASON = 13 THEN
       V_REASON_FOR_TERMINATION := 'PATWRK';
       WHEN CR.TERMREASON = 14 THEN
       V_REASON_FOR_TERMINATION := 'LOSTEM';
       WHEN CR.TERMREASON = 15 THEN
       V_REASON_FOR_TERMINATION := 'FLEDAB';
       WHEN CR.TERMREASON = 16 THEN
       V_REASON_FOR_TERMINATION := 'FLEDWK';
       WHEN CR.TERMREASON = 17 THEN
       V_REASON_FOR_TERMINATION := 'OFFINJ';
       WHEN CR.TERMREASON = 18 THEN
       V_REASON_FOR_TERMINATION := 'OTHAGY';
       ELSE
       V_REASON_FOR_TERMINATION := NULL;
       END CASE;

--FLIGHT REASON
       CASE
       WHEN CR.FLI_REASON = 1 THEN
       V_REASON_FOR_FLIGHT := 'SUMMON';
       WHEN CR.FLI_REASON = 2 THEN
       V_REASON_FOR_FLIGHT := 'DUIARR';
       WHEN CR.FLI_REASON = 3 THEN
       V_REASON_FOR_FLIGHT := 'FELONY';
       WHEN CR.FLI_REASON = 4 THEN
       V_REASON_FOR_FLIGHT := 'STOLEN';
       WHEN CR.FLI_REASON = 5 THEN
       V_REASON_FOR_FLIGHT := 'MISDEM';
       WHEN CR.FLI_REASON = 6 THEN
       V_REASON_FOR_FLIGHT := 'DRUGAR';
       WHEN CR.FLI_REASON = 7 THEN
       V_REASON_FOR_FLIGHT := 'FEARPO';
       WHEN CR.FLI_REASON = 8 THEN
       V_REASON_FOR_FLIGHT := 'NODVRL';
       WHEN CR.FLI_REASON = 9 THEN
       V_REASON_FOR_FLIGHT := 'NOINSU';
       WHEN CR.FLI_REASON = 10 THEN
       V_REASON_FOR_FLIGHT := 'PARENT';
       WHEN CR.FLI_REASON = 11 THEN
       V_REASON_FOR_FLIGHT := 'MENTAL';
       WHEN CR.FLI_REASON = 12 THEN
       V_REASON_FOR_FLIGHT := 'OTHERR';
       ELSE
       V_REASON_FOR_FLIGHT := NULL;
       END CASE;

--ACCIDENT
       CASE
       WHEN CR.ACCIDENT = 1 THEN
       V_ACCIDENT := 'Y';
       WHEN CR.ACCIDENT = 2 THEN
       V_ACCIDENT := 'N';
       ELSE
       V_ACCIDENT := NULL;
       END CASE;

--ACCIDENT TYPE
       CASE
       WHEN CR.ACCDNTTYPE = 1 THEN
       V_ACCIDENT_TYPE := 'PROPERTY DAMAGE';
       WHEN CR.ACCDNTTYPE = 2 THEN
       V_ACCIDENT_TYPE := 'INJURY';
       WHEN CR.ACCDNTTYPE = 3 THEN
       V_ACCIDENT_TYPE := 'FATALITY';
       ELSE
       V_ACCIDENT_TYPE := NULL;
       END CASE;

--ACCIDENT PARTIES INVOLVED
       CASE
       WHEN CR.ACCPARTIES = 1 THEN
       V_ACCIDENT_PARTIES_INVOLVED := 'SUSPONLY';
       WHEN CR.ACCPARTIES = 2 THEN
       V_ACCIDENT_PARTIES_INVOLVED := 'THRDONLY';
       WHEN CR.ACCPARTIES = 3 THEN
       V_ACCIDENT_PARTIES_INVOLVED := 'POLIONLY';
       WHEN CR.ACCPARTIES = 4 THEN
       V_ACCIDENT_PARTIES_INVOLVED := 'POLISUSP';
       WHEN CR.ACCPARTIES = 5 THEN
       V_ACCIDENT_PARTIES_INVOLVED := 'POLITHRD';
       WHEN CR.ACCPARTIES = 6 THEN
       V_ACCIDENT_PARTIES_INVOLVED := 'SUSPTHRD';
       WHEN CR.ACCPARTIES = 7 THEN
       V_ACCIDENT_PARTIES_INVOLVED := 'ALLPARTY';
       ELSE
       V_ACCIDENT_PARTIES_INVOLVED := NULL;
       END CASE;

SELECT COUNT(*) INTO V_CASE_COUNT
FROM PURSUITS.IMPORT_LEGACY_PURSUIT
WHERE CASE_NUMBER = CR.LOCCASENUM;

CASE
WHEN V_CASE_COUNT = 0 THEN

DBMS_OUTPUT.PUT_LINE ('DONE');

--INSERT DATA INTO TABLE
       INSERT INTO PURSUITS.IMPORT_LEGACY_PURSUIT(
CASE_NUMBER,            
OFFICER_LNAME,          
OFFICER_FNAME,         
OFFICER_MI,            
OFFICER_NAME_HP261,    
OFFICER_RADIO,          
OFFICER_VEH_UNIT,      
OFFICER_TROOP,         
OFFICER_ZONE,          
OFFICER_YEARS_SERVICE,  
PURSUIT_TIME_BEGAN,  
PURSUIT_DATE,          
PURSUIT_DOW,            
PURSUIT_TIME_ENDED,   
DURATION_MILES,        
DURATION_MINUTES,       
SPEED_MAX,             
ROADWAY_TYPE,         
TRAFFIC_FLOW,          
REASON_FOR_INITIATION,  
REASON_FOR_INITIATION_OTHER,  
VEHICLE_MARKING,        
VEHICLE_LIGHTS_ON,      
VEHICLE_SIREN_ON,       
VEHICLE_COUNT_MARKED_TOPLIGHT,  
VEHICLE_COUNT_UNMARKED, 
VEHICLE_COUNT_MARKED_CLEAN,     
AIRCRAFT_AVAILABLE,        
AIRCRAFT_INVOLVED,         
OTHER_AGENCY_INVOLVED,     
OTHER_AGENCY_STATUS,       
OTHER_AGENCY_COUNT,          
SUSPECT_VEHICLE_TYPE,         
SUSPECT_VEHICLE_TYPE_OTHER,   
SUSPECT_AGE,                  
SUSPECT_GENDER,               
SUSPECT_RACE,               
SUSPECT_ETHNICITY,           
SUSPECT_ID_KNOWN,             
SUSPECT_POSSESS_WEAPON,    
SUSPECT_DUI,                
SUSPECT_BAC,                  
REASON_FOR_TERMINATION,       
REASON_FOR_FLIGHT,            
REASON_FOR_FLIGHT_OTHER,      
ACCIDENT,                    
ACCIDENT_TYPE,                
ACCIDENT_PARTIES_INVOLVED,    
IMMEDIATE_SUPERVISOR,         
TROOP_COMMANDER)

VALUES(
CR.LOCASENUM,
NULL,
NULL,
NULL,
CR.N/A,
CR.RADIO_NUM,
CR.UNIT_NUM,
CR.TROOP,
CR.ZONE,
CR.YRSSERVICE,
CR.TIMEBEGAN,
V_PURSUIT_DATE,
CR.DAYOFWEEK,
CR.TIME_ENDED,
CR.MILES,
CR.MINUTES,
CR.MPH,
V_ROADWAY_TYPE,
V_TRAFFIC_FLOW,
V_REASON_FOR_INITIATION,
CR.OTHER1,
V_VEHICLE_MARKING,
V_VEHICLE_LIGHTS_ON,
V_VEHICLE_SIREN_ON,
CR.MARKED_TL,
CR.UNMARKED,
CR.MARKED_CR,
V_AIRCRAFT_AVAILABLE,
V_AIRCRAFT_INVOLVED,
V_OTHER_AGENCY_INVOLVED,
V_AGENCY_STATUS,
CR.NUM_VEH,
V_SUSPECT_VEHICLE_TYPE,
CR.OTHER2,
CR.AGE,
CR.SEX,
V_SUSPECT_RACE,
CR.N/A,
V_SUSPECT_ID_KNOWN,
V_SUSPECT_POSSESS_WEAPON,
CR.DUI,
CR.BAC_PERCNT,
V_REASON_FOR_TERMINATION,
V_REASON_FOR_FLIGHT,
CR.OTHER3,
V_ACCIDENT,
V_ACCIDENT_TYPE,
V_ACCIDENT_PARTIES_INVOLVED,
NULL,
NULL);

END LOOP;
CLOSE DATA_CURSOR;
END;

Deanna,

Question, I don't understand why you're selecting in import_legacy_pursuit and insertion in the same table?

It would be wonderful if you can display the structure of the table and 1 or 2 fictitious example of records.

 cursor cr is
  SELECT *
      FROM import_legacy_pursuit;
  ...
  ...

 INSERT INTO import_legacy_pursuit
           (
               case_number,
               officer_lname,
                ....
                ..
) values (.....
...);

In any case, I made some changes to the procedure, you must replace the Insert with your statement and post if it worked for you.

DECLARE
   CURSOR data_cursor
   IS
      SELECT *
      FROM import_legacy_pursuit;

   cr                            data_cursor%ROWTYPE;

   v_pursuit_date                DATE;
   v_roadway_type                VARCHAR2 (15);
   v_traffic_flow                VARCHAR2 (18);
   v_reason_for_initiation       VARCHAR2 (16);
   v_vehicle_marking             VARCHAR2 (18);
   v_vehicle_lights_on           VARCHAR2 (11);
   v_vehicle_siren_on            VARCHAR2 (11);
   v_aircraft_available          VARCHAR2 (11);
   v_aircraft_involved           VARCHAR2 (11);
   v_other_agency_involved       VARCHAR2 (11);
   v_other_agency_status         VARCHAR2 (18);
   v_other_agency_count          NUMBER (4, 0);
   v_suspect_vehicle_type        VARCHAR2 (20);
   v_suspect_race                VARCHAR2 (11);
   v_suspect_ethnicity           VARCHAR2 (11);
   v_suspect_id_known            VARCHAR2 (11);
   v_suspect_possess_weapon      VARCHAR2 (11);
   v_reason_for_termination      VARCHAR2 (11);
   v_reason_for_flight           VARCHAR2 (11);
   v_accident                    VARCHAR2 (11);
   v_accident_type               VARCHAR2 (18);
   v_accident_parties_involved   VARCHAR2 (18);

   v_lo_number                   VARCHAR2 (50);

   v_case_count                  NUMBER;
BEGIN
   OPEN data_cursor;

   LOOP
      FETCH data_cursor INTO cr;

      EXIT WHEN data_cursor%NOTFOUND;

      --PURSUIT DATE

      --       IF CR.PURSUIT_DATE = 0 THEN
      --       V_PURSUIT_DATE :=NULL;
      --       ELSE
      --            V_PURSUIT_DATE :=TO_DATE(CR.PURSUIT_DATE,CONCAT('MONTH'/'DAY'/'YEAR');
      --       END IF;

      --ROADWAY TYPE
      CASE
         WHEN cr.roadway = 1
         THEN
            v_roadway_type   := 'URBAN';
         WHEN cr.roadway = 2
         THEN
            v_roadway_type   := 'RURAL';
         ELSE
            v_roadway_type   := NULL;
      END CASE;

      --TRAFFIC FLOW
      CASE
         WHEN cr.trafficflo = 1
         THEN
            v_traffic_flow   := 'LIGHT';
         WHEN cr.trafficflo = 2
         THEN
            v_traffic_flow   := 'MODERATE';
         WHEN cr.trafficflo = 3
         THEN
            v_traffic_flow   := 'HIGH';
         ELSE
            v_traffic_flow   := NULL;
      END CASE;

      --INITIATION CODES
      CASE
         WHEN cr.initreason = 1
         THEN
            v_reason_for_initiation   := 'SUSACT';
         WHEN cr.initreason = 2
         THEN
            v_reason_for_initiation   := 'TRAFVI';
         WHEN cr.initreason = 3
         THEN
            v_reason_for_initiation   := 'MISCCR';
         WHEN cr.initreason = 4
         THEN
            v_reason_for_initiation   := 'FELONY';
         WHEN cr.initreason = 5
         THEN
            v_reason_for_initiation   := 'DUIARR';
         WHEN cr.initreason = 6
         THEN
            v_reason_for_initiation   := 'NCICHT';
         WHEN cr.initreason = 7
         THEN
            v_reason_for_initiation   := 'OTHERR';
         ELSE
            v_reason_for_initiation   := NULL;
      END CASE;

      --VEHICLE MARKING
      CASE
         WHEN cr.carmarks = 1
         THEN
            v_vehicle_marking   := 'MRKLIGHT';
         WHEN cr.carmarks = 2
         THEN
            v_vehicle_marking   := 'MRKCLEAN';
         WHEN cr.carmarks = 3
         THEN
            v_vehicle_marking   := 'UNMARKED';
         ELSE
            v_vehicle_marking   := NULL;
      END CASE;

      --LIGHTS
      CASE
         WHEN cr.lights_on = 1
         THEN
            v_vehicle_lights_on   := 'Y';
         WHEN cr.lights_on = 2
         THEN
            v_vehicle_lights_on   := 'N';
         ELSE
            v_vehicle_lights_on   := NULL;
      END CASE;

      --SIREN
      CASE
         WHEN cr.siren_on = 1
         THEN
            v_vehicle_siren_on   := 'Y';
         WHEN cr.siren_on = 2
         THEN
            v_vehicle_siren_on   := 'N';
         ELSE
            v_vehicle_siren_on   := NULL;
      END CASE;

      --AIRCRAFT AVAILABLE
      CASE
         WHEN cr.aircraftav = 1
         THEN
            v_aircraft_available   := 'Y';
         WHEN cr.aircraftav = 2
         THEN
            v_aircraft_available   := 'N';
         WHEN cr.aircraftav = 3
         THEN
            v_aircraft_available   := 'U';
         ELSE
            v_aircraft_available   := NULL;
      END CASE;

      --AIRCRAFT INVOLVED
      CASE
         WHEN cr.aircraftin = 1
         THEN
            v_aircraft_involved   := 'Y';
         WHEN cr.aircraftin = 2
         THEN
            v_aircraft_involved   := 'N';
         ELSE
            v_aircraft_involved   := NULL;
      END CASE;

      --AGENCY INVOLVED
      CASE
         WHEN cr.othragency = 1
         THEN
            v_other_agency_involved   := 'Y';
         WHEN cr.othragency = 2
         THEN
            v_other_agency_involved   := 'N';
         ELSE
            v_other_agency_involved   := NULL;
      END CASE;

      --AGENCY STATUS
      CASE
         WHEN cr.status = 1
         THEN
            v_other_agency_status   := 'INITIATE';
         WHEN cr.status = 2
         THEN
            v_other_agency_status   := 'ASSISTED';
         ELSE
            v_other_agency_status   := NULL;
      END CASE;

      --SUSPECT VEHICLE TYPE
      CASE
         WHEN cr.vehicletyp = 1
         THEN
            v_suspect_vehicle_type   := 'SD';
         WHEN cr.vehicletyp = 2
         THEN
            v_suspect_vehicle_type   := 'MC';
         WHEN cr.vehicletyp = 3
         THEN
            v_suspect_vehicle_type   := 'VN';
         WHEN cr.vehicletyp = 4
         THEN
            v_suspect_vehicle_type   := 'PK';
         WHEN cr.vehicletyp = 5
         THEN
            v_suspect_vehicle_type   := 'DS';
         WHEN cr.vehicletyp = 6
         THEN
            v_suspect_vehicle_type   := 'OT';
         ELSE
            v_suspect_vehicle_type   := NULL;
      END CASE;

      --SUSPECT RACE AND ETHNICITY
      IF cr.race = 'H'
      THEN
         v_suspect_race   := 'W';
      ELSE
         v_suspect_race   := cr.race;
      END IF;

      --SUSPECT ETHNICITY
      IF cr.race = 'H'
      THEN
         v_suspect_ethnicity   := 'H';
      ELSE
         v_suspect_ethnicity   := NULL;
      END IF;

      --SUSPECT ID
      CASE
         WHEN cr.id_known = 1
         THEN
            v_suspect_id_known   := 'Y';
         WHEN cr.id_known = 2
         THEN
            v_suspect_id_known   := 'N';
         ELSE
            v_suspect_id_known   := NULL;
      END CASE;

      --SUSPECT WEAPON
      CASE
         WHEN cr.weapon = 1
         THEN
            v_suspect_possess_weapon   := 'Y';
         WHEN cr.weapon = 2
         THEN
            v_suspect_possess_weapon   := 'N';
         ELSE
            v_suspect_possess_weapon   := NULL;
      END CASE;

      --TERMINATION REASON
      CASE
         WHEN cr.termreason = 1
         THEN
            v_reason_for_termination   := 'DVRVOL';
         WHEN cr.termreason = 2
         THEN
            v_reason_for_termination   := 'ALATER';
         WHEN cr.termreason = 3
         THEN
            v_reason_for_termination   := 'VEHDIS';
         WHEN cr.termreason = 4
         THEN
            v_reason_for_termination   := 'VEHWRK';
         WHEN cr.termreason = 5
         THEN
            v_reason_for_termination   := 'ROADBL';
         WHEN cr.termreason = 6
         THEN
            v_reason_for_termination   := 'STOPST';
         WHEN cr.termreason = 7
         THEN
            v_reason_for_termination   := 'RAMMED';
         WHEN cr.termreason = 8
         THEN
            v_reason_for_termination   := 'WEAPON';
         WHEN cr.termreason = 9
         THEN
            v_reason_for_termination   := 'DVRINJ';
         WHEN cr.termreason = 10
         THEN
            v_reason_for_termination   := 'OFFTER';
         WHEN cr.termreason = 11
         THEN
            v_reason_for_termination   := 'SUPTER';
         WHEN cr.termreason = 12
         THEN
            v_reason_for_termination   := 'PATDIS';
         WHEN cr.termreason = 13
         THEN
            v_reason_for_termination   := 'PATWRK';
         WHEN cr.termreason = 14
         THEN
            v_reason_for_termination   := 'LOSTEM';
         WHEN cr.termreason = 15
         THEN
            v_reason_for_termination   := 'FLEDAB';
         WHEN cr.termreason = 16
         THEN
            v_reason_for_termination   := 'FLEDWK';
         WHEN cr.termreason = 17
         THEN
            v_reason_for_termination   := 'OFFINJ';
         WHEN cr.termreason = 18
         THEN
            v_reason_for_termination   := 'OTHAGY';
         ELSE
            v_reason_for_termination   := NULL;
      END CASE;

      --FLIGHT REASON
      CASE
         WHEN cr.fli_reason = 1
         THEN
            v_reason_for_flight   := 'SUMMON';
         WHEN cr.fli_reason = 2
         THEN
            v_reason_for_flight   := 'DUIARR';
         WHEN cr.fli_reason = 3
         THEN
            v_reason_for_flight   := 'FELONY';
         WHEN cr.fli_reason = 4
         THEN
            v_reason_for_flight   := 'STOLEN';
         WHEN cr.fli_reason = 5
         THEN
            v_reason_for_flight   := 'MISDEM';
         WHEN cr.fli_reason = 6
         THEN
            v_reason_for_flight   := 'DRUGAR';
         WHEN cr.fli_reason = 7
         THEN
            v_reason_for_flight   := 'FEARPO';
         WHEN cr.fli_reason = 8
         THEN
            v_reason_for_flight   := 'NODVRL';
         WHEN cr.fli_reason = 9
         THEN
            v_reason_for_flight   := 'NOINSU';
         WHEN cr.fli_reason = 10
         THEN
            v_reason_for_flight   := 'PARENT';
         WHEN cr.fli_reason = 11
         THEN
            v_reason_for_flight   := 'MENTAL';
         WHEN cr.fli_reason = 12
         THEN
            v_reason_for_flight   := 'OTHERR';
         ELSE
            v_reason_for_flight   := NULL;
      END CASE;

      --ACCIDENT
      CASE
         WHEN cr.accident = 1
         THEN
            v_accident   := 'Y';
         WHEN cr.accident = 2
         THEN
            v_accident   := 'N';
         ELSE
            v_accident   := NULL;
      END CASE;

      --ACCIDENT TYPE
      CASE
         WHEN cr.accdnttype = 1
         THEN
            v_accident_type   := 'PROPERTY DAMAGE';
         WHEN cr.accdnttype = 2
         THEN
            v_accident_type   := 'INJURY';
         WHEN cr.accdnttype = 3
         THEN
            v_accident_type   := 'FATALITY';
         ELSE
            v_accident_type   := NULL;
      END CASE;

      --ACCIDENT PARTIES INVOLVED
      CASE
         WHEN cr.accparties = 1
         THEN
            v_accident_parties_involved   := 'SUSPONLY';
         WHEN cr.accparties = 2
         THEN
            v_accident_parties_involved   := 'THRDONLY';
         WHEN cr.accparties = 3
         THEN
            v_accident_parties_involved   := 'POLIONLY';
         WHEN cr.accparties = 4
         THEN
            v_accident_parties_involved   := 'POLISUSP';
         WHEN cr.accparties = 5
         THEN
            v_accident_parties_involved   := 'POLITHRD';
         WHEN cr.accparties = 6
         THEN
            v_accident_parties_involved   := 'SUSPTHRD';
         WHEN cr.accparties = 7
         THEN
            v_accident_parties_involved   := 'ALLPARTY';
         ELSE
            v_accident_parties_involved   := NULL;
      END CASE;

      SELECT COUNT ( * )
      INTO v_case_count
      FROM import_legacy_pursuit
      WHERE case_number = cr.loccasenum;

      IF v_case_count = 0
      THEN
         DBMS_OUTPUT.put_line ('DONE');

         -- PLEASE assign all cursor values to some variables ; e.g
         v_lo_number   := cr.loccasenum;

         INSERT INTO import_legacy_pursuit
        (
            case_number, fli_reason
        )
         VALUES (v_lo_number, v_reason_for_flight);
      ELSE
         DBMS_OUTPUT.put_line ('Nothing inserted');
      END IF;
   END LOOP;

   COMMIT;
EXCEPTION
   WHEN OTHERS
   THEN
      ROLLBACK;
      DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 300));
      RAISE;
END;

Concerning

Tags: Database

Similar Questions

  • import data into the different tablespace

    Hello

    I had exported a my schema of production data now I want to import data in the schema of the trial, I had mentioned the tablespace default for the trial scheme, but when I import data is not taking default tablespace of schema of its database taking default tablespace. How to import data into the different tablespace. In remap_tablespace where I can specify the touser.

    my version of oracle database:

    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    AMT for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

    -------------------------------------------------------------------------------------------------------------------------------------------

    Raj wrote:
    Hello

    I had exported a my schema of production data now I want to import data in the schema of the trial, I had mentioned the tablespace default for the trial scheme, but when I import data is not taking default tablespace of schema of its database taking default tablespace. How to import data into the different tablespace. In remap_tablespace where I can specify the touser.

    my version of oracle database:

    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    AMT for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

    -------------------------------------------------------------------------------------------------------------------------------------------

    If your storage source and destination areas are different, you must use the remap_tablespace option.
    example:

    System $impdp / * directory = data_pump_dir dumpfile = logfile = schema_refresh.log remap_schema = Prd_schema:Tst_schema remap_tablespace = prd_TBS:tst:TBS schema_refresh.dmp

  • Cannot insert data into the database

    Hello world

    I stuck with a problem in DB juice. When I try to insert data into the database using DB tool, I get a repeated error message (error 1). Please find the my vifile below and solve say.

    Problem is use Labiew 8.2. So try to answer accordingly

    Try it with a cluster instead of a string or an array.

  • Reading file and dump the data into the database using BPEL process

    I have to read the CSV file and insert data into the database... To do this, I created some asynchronous bpel process. Adapter filed added and associated with the receive activity... Adapter DB has added and associated with the Invoke activity. Receive two total activity are available in the process when trying to Test em, receive only the first activity is complete and awaits the second receive activity. Please suggest how to proceed with...

    Thanks, Maury.

    Hi Maury,

    There is no need in step 2 that u mentioned above. I donot find useless a webservice?

    The process will be launched by the CSV file, then using the processing activity, you can put it in the DB.

    There should be no way where you can manually test it by giving an entry. All you can do to test is to put the file in the folder you mentioned when configuring the file adapter.

    You just need to have the composite as below:

    ReadCSVFile---> BPEL--> DB adapter

    And in your BPEL process:

    Recieve--> Transformation activity--> call activity

    Try to work on some samples listed on the oracle site and go through the below URL:

    The playback of the file adapter feature using

    Thank you

    Deepak.

  • How to insert data into the database using smartview

    Hello
    I am trying to insert data into the database using * "Send data" * button on the Ribbon of Essbase.
    My database is empty.

    I opened an ad hoc network, it returns * "#missing" * in all cells
    I have modified the cells and provided data in the cells that I want to. Now, I supported on * "Send data" * button.
    It just reloaded the adhoc grid instead of submit data, I rechecked the data through data console Administrative Service are not inserted.

    I am following the right way to insert data? If not, could you please suggest me how (Populate) insert default data in the database?

    --
    VINET

    You go about it the right way, once you have submitted if you réactualisiez then data values should be there, if you POV is against members of dynamic calc and then data not written to the database, you need to check the Member properties of your POV.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • import data into the table with the triggers of the sequence

    Hello

    I'm on oracle 11G on OS SPARC.

    I need to import a table from a dump using "imp."

    At the destination table where I have to import a 'insert before' with the sequence as the primary key.

    Suppose if I am importing data that has the sequence from 200... then when I imported the data into the new table, I have to define the sequence to be the same as the boot sequence for the source or it will automatically use this source sequence.


    Please suggest

    concerning
    Kkurkeja

    Disable the trigger prior to importation.

    Thank you

  • Error inserting data into the database of JSF

    Hi all

    I have a form and a button of validation. I created the form using the editable view object created on an entity object. When the student has table (base table of data in which I have to enter data) was empty, I managed to insert the data into the table.when I run the same second time application it shows data that I entered previously. But iam able to modify this data and insert the new record again. What should I do so that it does not show the data I already inserted previously when I run again. I think that iam missing something. Please suggest.

    Thank you.

    Here are two ways to achieve the same thing:

    -If you use taskflows, you can add createInsert action as activity by default and then have a navigation from this at the registration page so that the creation form will be shown on the loading of the page. As a result, you can directly enter and validate.
    -If not, have binding action createInsert in your pagedef and add an executable invokeAction for the same thing with prepareModel so that the registration form empty appears when loading the page

    Jean Lou

  • Reading file from the ftp server and importing data into the table

    Hi experts,

    Well, basically, I text with different layout files have been uploaded to an ftp server. Now, I must write a procedure to recover these files, read and insert data into a table... what to do?

    your help would be greatly helpful.

    Thank you

    user9004152 wrote:
    http://it.Toolbox.com/wiki/index.php/Load_data_from_a_flat_file_into_an_Oracle_table

    See the link, hope it will work.

    It is an old method, using the utl_file_dir parameter that is now obsolete and which is frankly a waste of space when external tables can do exactly the same thing much more easily.

  • How to import Date into the text data file TDR box?

    I have a report template that I use frequently for data tracing files. At the top of the TOR, I have a main title text box that says "Daily Operation" usually followed by the date (entered manually) of this file.

    Q: How do I import/reference the value of the date of the file (photo #1 - black outline) in the text box (photo #2) I use to Date? I appreciate all help.

    Hi man of laboratory.

    Looks like you will need to use the RTT (-real time), which transforms the tiara time real number (fractions of a second from 0 AD) in a date/time string.  There is also a TTR function that goes the other way.

    @@RTT (ChD (1, "[1] / Date"), "" mm/dd/yyyy # hh:nn:ss.fff "') @.

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • 1 form, 2 actions to do: check the captcha and put data into the database

    Hello

    I am trying to create a registration page that puts the data entered by the user in a database. That part works: there is a connection to the database and the information is placed in the database correctly. To avoid spam, I would add captcha on the form. I've been looking at the possibilities of reCaptcha, and the result is the following: the image appears correctly and the image is renewed when you click on the link. But the problem is that this captcha can be controlled without adding "verify.php" action to the form. How can I, in Dreamweaver, add a second action to the form? In other words, what code should I replace the part "$editFormAction"? Or I think entirely in a bad way? This is the first time I use Dreamweaver, I also never worked with php before.

    Here is the code I have now (I'm sorry guys but I'm Dutch ):

    <?php require_once('Connections/Klantenlijst.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    // *** Redirect if username exists
    $MM_flag="MM_insert";
    if (isset($_POST[$MM_flag])) {
      $MM_dupKeyRedirect="www.sint-jorishoeve.be";
      $loginUsername = $_POST['gebruikersnaam'];
      $LoginRS__query = sprintf("SELECT Gebruikersnaam FROM klantenlijst WHERE Gebruikersnaam=%s", GetSQLValueString($loginUsername, "text"));
      mysql_select_db($database_Klantenlijst, $Klantenlijst);
      $LoginRS=mysql_query($LoginRS__query, $Klantenlijst) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      //if there is a row in the database, the username was found - can not add the requested username
      if($loginFoundUser){
        $MM_qsChar = "?";
        //append the username to the redirect page
        if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
        $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
        header ("Location: $MM_dupKeyRedirect");
        exit;
      }
    }
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "registreren")) {
      $insertSQL = sprintf("INSERT INTO klantenlijst (`Voornaam ruiter`, `Familienaam ruiter`, `Geboortedatum dag`, `Geboortedatum maand`, `Geboortedatum jaar`, `E-mailadres 1`, `Telefoon 1`, Gebruikersnaam, Paswoord) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['voornaam_ruiter'], "text"),
                           GetSQLValueString($_POST['voornaam_ruiter'], "text"),
                           GetSQLValueString($_POST['geboortedatum_ddag'], "int"),
                           GetSQLValueString($_POST['geboortedatum_maand'], "text"),
                           GetSQLValueString($_POST['geboortedatum_jaar'], "int"),
                           GetSQLValueString($_POST['e-mailadres_1'], "text"),
                           GetSQLValueString($_POST['telefoon'], "int"),
                           GetSQLValueString($_POST['gebruikersnaam'], "text"),
                           GetSQLValueString($_POST['paswoord'], "text"));
      mysql_select_db($database_Klantenlijst, $Klantenlijst);
      $Result1 = mysql_query($insertSQL, $Klantenlijst) or die(mysql_error());
      $insertGoTo = "aanmelden.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "registratie")) {
      $insertSQL = sprintf("INSERT INTO klantenlijst (`Voornaam ruiter`, `Familienaam ruiter`, `Geboortedatum dag`, `Geboortedatum maand`, `Geboortedatum jaar`, `Opmerkingen / Medisch`, `Voornaam contactpersoon 1`, `Familienaam contactpersoon 1`, `Contactpersoon 1 is`, `Voornaam contactpersoon 2`, `Familienaam contactpersoon 2`, `Contactpersoon 2 is`, `E-mailadres 1`, `E-mailadres 2`, `Telefoon 1`, `Telefoon 2`, `Telefoon 3`, Opmerkingen, Gebruikersnaam, Paswoord) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['voornaam_ruiter'], "text"),
                           GetSQLValueString($_POST['familienaam_ruiter'], "text"),
                           GetSQLValueString($_POST['geboortedatum_dag'], "int"),
                           GetSQLValueString($_POST['geboortedatum_maand'], "text"),
                           GetSQLValueString($_POST['geboortedatum_jaar'], "date"),
                           GetSQLValueString($_POST['opmerkingen_ruiter'], "text"),
                           GetSQLValueString($_POST['voornaam_contactpersoon_1'], "text"),
                           GetSQLValueString($_POST['familienaam_contactpersoon_1'], "text"),
                           GetSQLValueString($_POST['contactpersoon_1_is'], "text"),
                           GetSQLValueString($_POST['voornaam_contactpersoon_2'], "text"),
                           GetSQLValueString($_POST['familienaam_contactpersoon_2'], "text"),
                           GetSQLValueString($_POST['contactpersoon_2_is'], "text"),
                           GetSQLValueString($_POST['emailadres_1'], "text"),
                           GetSQLValueString($_POST['emailadres_2'], "text"),
                           GetSQLValueString($_POST['telefoon_1'], "int"),
                           GetSQLValueString($_POST['telefoon_2'], "int"),
                           GetSQLValueString($_POST['telefoon_3'], "int"),
                           GetSQLValueString($_POST['opmerkingen_contactpersoon'], "text"),
                           GetSQLValueString($_POST['gebruikersnaam'], "text"),
                           GetSQLValueString($_POST['paswoord'], "text"));
      mysql_select_db($database_Klantenlijst, $Klantenlijst);
      $Result1 = mysql_query($insertSQL, $Klantenlijst) or die(mysql_error());
      $insertGoTo = "http://www.sint-jorishoeve.be";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    mysql_select_db($database_Klantenlijst, $Klantenlijst);
    $query_Contactenlijst = "SELECT * FROM klantenlijst";
    $Contactenlijst = mysql_query($query_Contactenlijst, $Klantenlijst) or die(mysql_error());
    $row_Contactenlijst = mysql_fetch_assoc($Contactenlijst);
    $totalRows_Contactenlijst = mysql_num_rows($Contactenlijst);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Manege Sint-Jorishoeve</title>
    <style type="text/css">
    <!--
    body,td,th {
     font-family: Verdana, Geneva, sans-serif;
     font-size: 10px;
     color: #300;
     font-weight: bold;
    }
    body {
     background-color: #FF9;
     font-family: Verdana, Geneva, sans-serif;
     font-size: 12px;
     font-style: normal;
     line-height: normal;
     font-weight: normal;
     font-variant: normal;
     text-transform: none;
     color: #300;
    }
    a {
     font-family: Verdana, Geneva, sans-serif;
     font-size: 12px;
     color: #F90;
    }
    a:visited {
     color: #F90;
    }
    a:hover {
     color: #F90;
    }
    a:active {
     color: #F90;
    }
    h1,h2,h3,h4,h5,h6 {
     font-family: Verdana, Geneva, sans-serif;
    }
    h1 {
     font-size: 14px;
     color: #300;
    }
    -->
    </style>
    <script src="SpryAssets/SpryValidationPassword.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationCheckbox.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryTooltip.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationPassword.css" rel="stylesheet" type="text/css">
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
    <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css">
    <link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css">
    <link href="SpryAssets/SpryValidationCheckbox.css" rel="stylesheet" type="text/css">
    <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css">
    <script type="text/javascript">
    <!--
    function MM_effectHighlight(targetElement, duration, startColor, endColor, restoreColor, toggle)
    {
     Spry.Effect.DoHighlight(targetElement, {duration: duration, from: startColor, to: endColor, restoreColor: restoreColor, toggle: toggle});
    }
    function MM_showHideLayers() { //v9.0
      var i,p,v,obj,args=MM_showHideLayers.arguments;
      for (i=0; i<(args.length-2); i+=3) 
      with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
        if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
        obj.visibility=v; }
    }
    //-->
    </script>
    <link href="SpryAssets/SpryTooltip.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <h1>Registreren</h1>
    <p><em>Let op: Dit is een registratie voor een volledig nieuwe account met nieuwe gebruikersnaam en paswoord.</em><em></em></p>
    <p><em>Indien u een persoon aan uw account wilt toevoegen (met dezelfde gebruikersnaam), doe dit via 'Mijn gegevens'.</em> </p>
    <p> </p>
    <script type="text/javascript">
    var RecaptchaOptions = {
     lang : 'nl',       
     theme : 'custom',
     custom_theme_widget: 'recaptcha_widget'
     };
        </script>
    <form action="<?php echo $editFormAction; ?>" method="POST" enctype="application/x-www-form-urlencoded" name="registratie" id="registratie" onSubmit="MM_showHideLayers('registratie','','hide')">
      <p><strong>GEGEVENS VAN DE TE REGISTREREN PERSOON</strong></p>
      <p>Voornaam*:
        <span id="sprytextfield9">
        <label>
          <input name="voornaam_ruiter" type="text" id="voornaam_ruiter" size="25" maxlength="50">
        </label>
      <span class="textfieldRequiredMsg">Dit veld is verplicht in te vullen!</span><span class="textfieldMaxCharsMsg">Hier kan u max. 50 karakters invullen!</span><span class="textfieldMinCharsMsg">Dit veld is verplicht in te vullen!</span></span> </p>
      <p>Familienaam*: <span id="sprytextfield10">
        <label>
          <input name="familienaam_ruiter" type="text" id="familienaam_ruiter" size="25" maxlength="50">
        </label>
        <span class="textfieldMaxCharsMsg">Hier kan u max. 50 karakters invullen!</span></span> </p>
      <p>Geboortedatum*: 
        <span id="sprytextfield11">
        <label>
          <input name="geboortedatum_dag" type="text" id="geboortedatum_dag" value="00" size="4" maxlength="2">
        </label>
        <span class="textfieldInvalidFormatMsg">Gebruik het aangegeven formaat aub.!</span><span class="textfieldMinCharsMsg">Gebruik het aangegeven formaat!</span><span class="textfieldMaxCharsMsg">Dit is geen geldige dag van de maand!</span><span class="textfieldMinValueMsg">Dit is geen geldige dag van de maand!</span><span class="textfieldMaxValueMsg">Dit is geen geldige dag van de maand!</span></span><span id="spryselect2">
        <label>
          <select name="geboortedatum_maand" id="geboortedatum_maand">
            <option selected> </option>
            <option value="Januari">Januari</option>
            <option value="Februari">Februari</option>
            <option value="Maart">Maart</option>
            <option value="April">April</option>
            <option value="Mei">Mei</option>
            <option value="Juni">Juni</option>
            <option value="Juli">Juli</option>
            <option value="Augustus">Augustus</option>
            <option value="September">September</option>
            <option value="Oktober">Oktober</option>
            <option value="November">November</option>
            <option value="December">December</option>
          </select>
        </label>
    <span class="selectRequiredMsg">Dit veld is verplicht in te vullen!</span></span><span id="sprytextfield12">
    <label>
      <input name="geboortedatum_jaar" type="text" id="geboortedatum_jaar" value="0000" size="8" maxlength="4">
    </label>
    <span class="textfieldRequiredMsg">Dit veld is verplicht in te vullen!</span><span class="textfieldInvalidFormatMsg">Dit is geen geldig geboortejaar!</span><span class="textfieldMinCharsMsg">Gebruik het aangegeven formaat aub.!</span><span class="textfieldMaxCharsMsg">Dit is geen geldig geboortejaar!</span><span class="textfieldMinValueMsg">Dit is geen geldig geboortejaar!</span><span class="textfieldMaxValueMsg">Dit is geen geldig geboortejaar!</span></span></p>
      <p><span id="sprytextfield13">
        <label>Opmerkingen / Medisch te weten:<span class="textfieldMaxCharsMsg">Hier mag u max. 100 karakters invullen!</span></label>
    </span>
        <input name="opmerkingen_ruiter" type="text" id="opmerkingen_ruiter" size="50" maxlength="100">
      </p>
      <p> </p>
      <p><strong>GEGEVENS VAN DE CONTACTPERSOON</strong></p>
      <p>Is de contactpersoon de te registreren persoon zelf *?
        <span id="spryselect4">
        <label>
          <select name="ja_nee" id="ja_nee">
            <option selected> </option>
            <option value="Ja">Ja</option>
            <option value="Nee">Nee</option>
          </select>
        </label>
      <span class="selectRequiredMsg">Dit veld is verplicht in te vullen!</span></span> </p>
      <p><em>Indien nee, specifiëer wie de contactpersoon is / contactpersonen zijn:</em></p>
      <p><strong>Contactpersoon 1: </strong></p>
      <p><em>Voornaam:     <span id="sprytextfield16">
        <input name="voornaam_contactpersoon_1" type="text" id="voornaam_contactpersoon_1" size="25" maxlength="50">
        <span class="textfieldMinCharsMsg">Dit is geen geldige voornaam!</span><span class="textfieldMaxCharsMsg">Hier mag u max. 50 karakters invullen!</span></span><span>
        <label><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></label>
        </span> </em></p>
      <p><em>Familienaam: <span id="sprytextfield15">
        <label>
          <input type="text" name="familienaam_contactpersoon_1" id="familienaam_contactpersoon_1">
        </label>
      <span class="textfieldMinCharsMsg">Dit is geen geldige familienaam!</span><span class="textfieldMaxCharsMsg">Hier mag u max. 50 karakters invullen!</span></span> </em></p>
      <p><em>Contactpersoon 1 is:
          <span id="spryselect3">
          <label>
            <select name="contactpersoon_1_is" id="contactpersoon_1_is">
              <option selected> </option>
              <option value="Ouder">Ouder</option>
              <option value="Andere familie">Andere familie</option>
              <option value="Geen familie">Geen familie</option>
            </select>
          </label>
    </span> </em></p>
      <p><strong>Contactpersoon 2:</strong></p>
      <p><em>Voornaam: <span id="sprytextfield7">
        <label>
          <input name="voornaam_contactpersoon_2" type="text" id="voornaam_contactpersoon_2" size="25" maxlength="50">
          <span class="textfieldMinCharsMsg">Dit is geen geldige voornaam!</span><span class="textfieldMaxCharsMsg">Hier mag u max. 50 karakters invullen!</span></label>
    </span> </em></p>
      <p><em>Familienaam: <span id="sprytextfield8">
        <label>
          <input name="familienaam_contactpersoon_2" type="text" id="familienaam_contactpersoon_2" size="25" maxlength="50">
          <span class="textfieldMinCharsMsg">Dit is geen geldige familienaam!</span><span class="textfieldMaxCharsMsg">Hier mag u max. 50 karakters invullen!</span></label>
    </span> </em></p>
      <p><em>Contactpersoon 2 is:
    <span id="spryselect1">
        <label></label>
        </span><span id="spryselect5">
        <select name="contactpersoon_2_is" id="contactpersoon_2_is">
          <option selected> </option>
          <option value="Ouder">Ouder</option>
          <option value="Andere familie">Andere familie</option>
          <option value="Geen familie">Geen familie</option>
        </select>
    </span><span>  <span class="selectRequiredMsg">Please select an item.</span></span> </em></p>
      <p> </p>
      <p>E-mailadres 1 *:
        <span id="sprytextfield6">
        <label>
          <input name="emailadres_1" type="text" id="emailadres_1" size="25" maxlength="50">
          <strong><em>      Kijk dit aub. na op typfouten!
        </em></strong></label>
        <em><strong><span class="textfieldInvalidFormatMsg">Dit is geen geldig e-mailadres!</span><span class="textfieldRequiredMsg">Dit veld is verplicht in te vullen!</span><span class="textfieldMinCharsMsg">Dit is geen geldig e-mailadres!</span><span class="textfieldMaxCharsMsg">Hier mag u max. 50 karakters invullen!</span></strong></em></span></p>
      <p>E-mailadres 2: 
        <span id="sprytextfield5">
        <label>
          <input type="text" name="emailadres_2" id="emailadres_2">
        </label>
      <span class="textfieldInvalidFormatMsg">Dit is geen geldig e-mailadres!</span><span class="textfieldMinCharsMsg">Dit is geen geldig e-mailadres!</span><span class="textfieldMaxCharsMsg">Hier mag u max. 50 karakters invullen!</span></span> </p>
      <p>Telefoon / GSM 1 *: 
        <span id="sprytextfield4">
        <label>
          <input name="telefoon_1" type="text" id="telefoon_1" size="20" maxlength="10">
        <em><strong>Kijk dit aub.   na op typfouten!</strong></em> </label>
        <span class="textfieldRequiredMsg">Dit veld is verplicht in te vullen!</span><span class="textfieldInvalidFormatMsg">Typ het telefoonnummer zonder streepjes of spaties in!</span><span class="textfieldMinValueMsg">Dit is geen geldig telefoonnummer!</span><span class="textfieldMaxValueMsg">Dit is geen geldig telefoonnummer!</span><span class="textfieldMinCharsMsg">Dit is geen geldig telefoonnummer!</span><span class="textfieldMaxCharsMsg">Typ het telefoonnummer zonder streepjes of spaties!</span></span></p>
      <p>Telefoon / GSM 2: 
        <span id="sprytextfield17">
        <label>
          <input name="telefoon_2" type="text" id="telefoon_2" size="20" maxlength="10">
        </label>
      <span class="textfieldInvalidFormatMsg">Typ het telefoonnummer zonder streepjes of spaties!</span><span class="textfieldMinValueMsg">Dit is geen geldig telefoonnummer!</span><span class="textfieldMaxValueMsg">Dit is geen geldig telefoonnummer!</span><span class="textfieldMaxCharsMsg">Typ het telefoonnummer zonder streepjes of spaties!</span><span class="textfieldMinCharsMsg">Dit is geen geldig telefoonnummer!</span></span> </p>
      <p>Telefoon / GSM 3: 
        <span id="sprytextfield3">
        <label>
          <input name="telefoon_3" type="text" id="telefoon_3" size="20" maxlength="10">
        </label>
      <span class="textfieldInvalidFormatMsg">Typ het telefoonnummer zonder streepjes of spaties!</span><span class="textfieldMinValueMsg">Dit is geen geldig telefoonnummer!</span><span class="textfieldMaxValueMsg">Dit is geen geldig telefoonnummer!</span><span class="textfieldMinCharsMsg">Dit is geen geldig telefoonnummer!</span><span class="textfieldMaxCharsMsg">Typ het telefoonnummer zonder streepjes of spaties!</span></span> </p>
      <p>Opmerkingen ivm. contactpersoon: 
        <span id="sprytextfield2">
        <label>
          <input name="opmerkingen_contactpersoon" type="text" id="opmerkingen_contactpersoon" size="50" maxlength="100">
        </label>
        </span> </p>
      <p> </p>
      <p><strong>ACCOUNTGEGEVENS</strong></p>
      <p>Kies een gebruikersnaam *: 
        <span id="sprytextfield1">
        <label>
          <input name="gebruikersnaam" type="text" id="gebruikersnaam" size="25" maxlength="50">
        <em><strong>Kijk aub.  na op typfouten!</strong></em> </label>
        </span></p>
      <p><em>De gebruikersnaam moet tussen 6 en 50 karakters lang zijn en mag zowel letters als cijfers omvatten. </em></p>
      <p><em>Tip: gebruik uw e-mailadres als gebruikersnaam. Let op: de gebruikersnaam is hoofdlettergevoelig!</em></p>
      <p>Kies een paswoord *: 
        <span id="sprypassword2">
        <label>
          <input name="paswoord" type="password" id="paswoord" size="20" maxlength="15">
        </label>
      <span class="passwordRequiredMsg">Dit veld is verplicht in te vullen!</span><span class="passwordMinCharsMsg">Het paswoord moet min. 6 karakters lang zijn!</span><span class="passwordMaxCharsMsg">Het paswoord mag max. 15 karakters lang zijn!</span><span class="passwordInvalidStrengthMsg">Het paswoord voldoet niet aan de voorwaarden!</span></span> </p>
      <p>Typ het paswoord opnieuw ter verificatie *: <span id="spryconfirm1">
        <label>
          <input type="password" name="paswoord_verificatie" id="paswoord_verificatie">
        </label>
      <span class="confirmRequiredMsg">Dit veld is verplicht in te vullen!</span><span class="confirmInvalidMsg">De paswoorden komen niet overeen!</span></span></p>
      <p><em>Het paswoord moet tussen 6 en 15 karakters lang zijn, moet zowel letters als cijfers bevatten en mag geen</em></p>
      <p><em>speciale tekens bevatten. </em><em>Let op: het paswoord is hoofdlettergevoelig!</em></p>
      <p><em>Tip: schrijf het paswoord ergens op alvorens </em><em>het formulier te verzenden zodat u het niet vergeet. </em></p>
      <p> </p>
      <p>
        <span id="sprycheckbox1">
        <label>
          <input name="akkoord_privacy" type="checkbox" id="akkoord_privacy" value="akkoord">
        </label>
      <span class="checkboxRequiredMsg">Verplicht aan te vinken!.</span></span> Ik bevestig dat zowel de te registreren persoon als de contactpersoon het <a href="http://www.sint-jorishoeve.be/privacy.htm" target="_blank">Privacy Statement</a> gelezen </p>
      <p>hebben en hiermee akkoord gaan. </p>
      <p>
        <?php 
      require_once('recaptchalib.php'); 
      $publickey = "6Lce_ckSAAAAAAGhklRAs1KsXJ7-YxZAaoTldLyQ"; // you got this from the signup page 
      echo recaptcha_get_html($publickey);
      ?>
      <div id="recaptcha_widget" style="display:none">
       <div id="recaptcha_image"></div>
        <div class="recaptcha_only_if_incorrect_sol" style="color:red">Woorden komen niet overeen. Probeer opnieuw.</div>
        <span class="recaptcha_only_if_image">Typ de woorden in de afbeelding over *:</span>
        <span class="recaptcha_only_if_audio">Typ cijfers die u hoort:</span>
        <input type="text" id="recaptcha_response_field" name="recaptcha_response_field" /><div>
        <a href="javascript:Recaptcha.reload()">Ik kan de woorden niet lezen, vernieuw de afbeelding.</a></div>
      </div>
      <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6Lce_ckSAAAAAAGhklRAs1KsXJ7-YxZAaoTldLyQ">
      </script>
      <noscript>
      <iframe src="http://www.google.com/recaptcha/api/noscript?k=6Lce_ckSAAAAAAGhklRAs1KsXJ7-YxZAaoTldLyQ" height="300" width="500" frameborder="0">
      </iframe>
      <span id="sprytextarea2">
      <textarea name="recaptcha_challenge_field" cols="40" rows="3" id="recaptcha_challenge_field"></textarea>
      <em><strong>Kijk  aub. na op typfouten!</strong></em> <span class="textareaRequiredMsg">Dit veld is verplicht in te vullen!</span><span class="textareaMinCharsMsg">Dit veld is verplicht in te vullen!</span></span>
      <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
      </noscript>
       </p>
      <p><em>Tip: Gebruik de link 'Vernieuwen' indien u de woorden niet kunt lezen.</em></p>
      <p> </p>
      <p>
        <label>
          <input name="registreren" type="submit" id="registreren" onFocus="Highlight" onBlur="Highlight" onClick="MM_effectHighlight('registreren', 1000, '#F0F0F0', '#FFCC33', '#FFCC00', true)" value="Registreren">
        </label>
      </p>
      <input type="hidden" name="MM_insert" value="registratie">
    </form>
    <div class="tooltipContent" id="sprytooltip1">&gt; Klik om het formulier te verifiëren en u  te registreren.</div>
    <p> </p>
    <p> </p>
    <script type="text/javascript">
    <!--
    var sprypassword2 = new Spry.Widget.ValidationPassword("sprypassword2", {validateOn:["blur"], minChars:6, maxChars:15, minAlphaChars:1, minNumbers:1, maxAlphaChars:14, maxNumbers:14, minUpperAlphaChars:0, maxUpperAlphaChars:14, minSpecialChars:0, maxSpecialChars:0});
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"], minChars:6, maxChars:50});
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {isRequired:false, validateOn:["blur"], minChars:0, maxChars:100});
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "integer", {validateOn:["blur"], isRequired:false, minValue:0, maxValue:9999999999, minChars:9, maxChars:10});
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "integer", {validateOn:["blur"], minValue:0, maxValue:9999999999, minChars:9, maxChars:10});
    var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "email", {isRequired:false, validateOn:["blur"], minChars:7, maxChars:50});
    var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "email", {validateOn:["blur"], minChars:7, maxChars:50});
    var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "none", {validateOn:["blur"], isRequired:false, minChars:0, maxChars:50});
    var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "none", {validateOn:["blur"], isRequired:false, minChars:0, maxChars:50});
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
    var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "none", {validateOn:["blur"], maxChars:50, minChars:1});
    var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10", "none", {validateOn:["blur"], minChars:1, maxChars:50});
    var sprytextfield11 = new Spry.Widget.ValidationTextField("sprytextfield11", "integer", {validateOn:["blur"], minChars:2, maxChars:2, minValue:1, maxValue:31});
    var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {validateOn:["blur"]});
    var sprytextfield12 = new Spry.Widget.ValidationTextField("sprytextfield12", "integer", {minChars:4, maxChars:4, validateOn:["blur"], minValue:1920, maxValue:2050});
    var sprytextfield13 = new Spry.Widget.ValidationTextField("sprytextfield13", "none", {validateOn:["blur"], isRequired:false, minChars:0, maxChars:100});
    var sprytextfield14 = new Spry.Widget.ValidationTextField("sprytextfield14", "none", {isRequired:false, validateOn:["blur"], minChars:0, maxChars:50});
    var sprytextfield15 = new Spry.Widget.ValidationTextField("sprytextfield15", "none", {minChars:0, maxChars:50, isRequired:false, validateOn:["blur"]});
    var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3", {validateOn:["blur"], isRequired:false});
    var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4", {validateOn:["blur"]});
    var sprytextfield16 = new Spry.Widget.ValidationTextField("sprytextfield16", "none", {validateOn:["blur"], isRequired:false, minChars:0, maxChars:50});
    var spryselect5 = new Spry.Widget.ValidationSelect("spryselect5", {isRequired:false, validateOn:["blur"]});
    var sprytextfield17 = new Spry.Widget.ValidationTextField("sprytextfield17", "integer", {validateOn:["blur"], isRequired:false, minValue:0, maxValue:9999999999, maxChars:10, minChars:9});
    var spryconfirm1 = new Spry.Widget.ValidationConfirm("spryconfirm1", "paswoord", {validateOn:["blur"]});
    var sprycheckbox1 = new Spry.Widget.ValidationCheckbox("sprycheckbox1", {validateOn:["blur"]});
    var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {validateOn:["blur"], minChars:1});
    var sprytooltip1 = new Spry.Widget.Tooltip("sprytooltip1", "#registreren", {useEffect:"fade", hideDelay:2});
    var sprytextarea2 = new Spry.Widget.ValidationTextarea("sprytextarea2", {validateOn:["blur"], minChars:3});
    //-->
    </script>
    </body>
    </html>
    <?php
    mysql_free_result($Contactenlijst);
    ?>
    
    

    In your PHP code, replace-

    }
    $editFormAction = $_SERVER['PHP_SELF'];

    on this subject.

    }

    ?>

    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "registreren")) {

    // add your captcha verification code here ....

    // captcha most likely ends with a header command to relocate failed attempts, so make sure you add

    // an exit() command after that header.  Otherwise, allow the successful captcha to fall into the following

    // block of code.

    }

    do not neglect this closing brace

    ?>

    $editFormAction = $_SERVER['PHP_SELF'];

  • Insert data into the database lines selected in a gridview

    Good night.

    I have a little doubt who would like to see clarified.

    I want / need to select several rows in a gridview and then insert the selected value of the line in the database.

    What should I do to take only the values and send them to the database to help, for example, a stored procedure?

    Thank you.

    Hello

    Assuming that already find you a way to determine the selected line in the gridview, the next steps are as simple as,
    1 loop through the selected lines in gridview
    2. generate the sql insert statement and OracleCommand based on line
    3. open OracleConnection
    4. call the ExecuteNonQuery method

    See you soon,.
    [Nur Hidayat | http://nur-hidayat.net/]

  • Insert data into the database of the text box

    Hi all

    I'm new to ADF. I have 5 text entry fields and a button "submit" in a JSF page. Whenever I click the button submit data entered by the user must be updated in the database. Please view the example code if possible.

    Thank you.

    First, you will need to create EO and then create from VO EO.

    Add create VO to AM using the data model section.

    Refresh data control and create the jsff page and drag - created déposer VO on the page.

    Then select shape > ADF form in the next window check the box include a Submit button.

    You can now enter data in table

    Samples

    http://wiki.Oracle.com/page/ADF+faces+features+examples

    Published by: sameera.sac on June 27, 2011 18:01

    Published by: sameera.sac on June 27, 2011 18:03

  • How to insert data into the database of the fields that have already been assigned values?

    Hi all

    I'm sorry for the question, I'm still new to the OPS

    Here's the thing.

    I have 4 points messageTextInput in my page. each of these 4 field is associated with an attribute of the VO.

    3 of these items have their value already defined in the processRequest of the Commander, like this:

           
          OAMessageTextInputBean factureItem = (OAMessageTextInputBean)webBean.findChildRecursive("factureItem");
          factureItem.setValue(pageContext,pnumfacture);
    
           OAMessageTextInputBean actionItem = (OAMessageTextInputBean)webBean.findChildRecursive("actionItem");
           actionItem.setValue(pageContext,pidaction);
           
          Date sysDate = new Date(); 
           OAMessageDateFieldBean dateSystemItem = (OAMessageDateFieldBean)webBean.findChildRecursive("dateSystemItem"); 
             dateSystemItem.setValue(pageContext,sysDate);       
    

    The user must enter the value of the 4th field.

    I used the classic entry code for data as follows:

    in the AM, I added,

        public void insertRecord(){
        
        OAViewObject vo = getTraceVO1();
        OADBTransaction trans = getOADBTransaction();
        
            if (!vo.isPreparedForExecution()) 
              { 
                    vo.executeQuery(); 
              }
        
        TraceVORowImpl v_row;
        v_row = (TraceVORowImpl)vo.createRow();
        vo.insertRow(v_row);
       v_row.setNewRowState(v_row.STATUS_INITIALIZED);
      }
    public void apply()
       {
          getTransaction().commit();
        }
    

    In the processRequest of the Commander, I added:

          if (!pageContext.isFormSubmission())
            {        
             am.invokeMethod("insertRecord",null);       
            } 
    

    in the processFormRequest of the CO, I added:

          if(pageContext.getParameter("submitButtonItem")!=null){
                         
                am.invokeMethod("apply");
          throw new OAException("Trace Created successfuly",OAException.CONFIRMATION);
          }
    

    When I run my page, I get the error message saying that myVO not records, the records were removed or the view instance has been initialized incorrectly.

    Can someone please tell me what this means?

    Kind regards

    Afaf

    Afaf,.

    Please try to use the code below and see what happens:

    Replace the insertRecord in the AM method with this.

    Import oracle.jbo.domain.Number;

    public void insertRecord(String pnumfacture, String pidaction){ 
    
      System.out.println("been  in insert method");
      OAViewObject traceVO = getTraceVO1();
      OADBTransaction trans = getOADBTransaction(); 
    
      /*if (!traceVO.isPreparedForExecution())
      {
      traceVO.executeQuery();
      }
      */
      traceVO.setWhereClause(null);
      traceVO.setWhereClauseParams(null);
      traceVO.setWhereClause("1=2");
      traceVO.executeQuery();
    
      Number pidAction;
      try{
      pidAction = new Number(pidaction);
      }catch(Exception e) {}
    
      TraceVORowImpl traceVORow;
      traceVORow = (TraceVORowImpl)traceVO.createRow();
      traceVORow.setIdFacture(pnumfacture);
      traceVORow.setIdAction(pidAction);
      traceVORow.DateSysteme(this.getOADBTransaction().getCurrentDBDate());
      traceVO.insertRow(traceVORow);
      //traceVORow.setNewRowState(traceVORow.STATUS_INITIALIZED); 
    
      System.out.println("been  in insert method");
    } 
    

    Replace the processRequest of the second Commander by this:

    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    {
      System.out.println("first time in processForm of CO2");
      String pnumfacture = null;
      String pidaction = null; 
    
      super.processRequest(pageContext, webBean); 
    
      OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean); 
    
      if(pageContext.getParameter("pnumfacture")!=null)
      {
      pnumfacture = pageContext.getParameter("pnumfacture").toString();
      } 
    
      if(pageContext.getParameter("pidaction")!=null)
      {
      pidaction = pageContext.getParameter("pidaction").toString();
      } 
    
        System.out.println("been  in processRequest before assign variables of CO2"); 
    
      System.out.println("pnumfacture :" + pnumfacture);
      System.out.println("pidaction :" + pidaction);
    
    /*assign values to the 3 fields*/
          /*
       Date sysDate = new Date();
          OAMessageTextInputBean factureItem = (OAMessageTextInputBean)webBean.findChildRecursive("factureItem");
          factureItem.setValue(pageContext,pnumfacture); 
    
          System.out.println("been  in processRequest after assign variables of CO2"); 
    
           OAMessageTextInputBean actionItem = (OAMessageTextInputBean)webBean.findChildRecursive("actionItem");
           actionItem.setValue(pageContext,pidaction); 
    
           OAMessageDateFieldBean dateSystemItem = (OAMessageDateFieldBean)webBean.findChildRecursive("dateSystemItem");
           if(dateSystemItem != null)
           {
             dateSystemItem.setValue(pageContext,sysDate);
           }
           */
        Serializable parameters[] = {pnumfacture, pidaction};
        Class paramTypes[] = {String.class, String.class};
    
           am.invokeMethod("insertRecord",parameters, paramTypes);
           System.out.println("been  in processRequest of CO2 after invokeMethod"); 
    
      }
    

    Let us know what happens.

    You can get an error that I have just change this in Textpad and may have syntax errors. If you can't fix those apply here.

    See you soon

    AJ

  • Dreamweaver server behaviors, can not insert data into the database

    Hi, I tried to use server behaviors to add registration information in my database in my registration page.

    (1) that I created a login page, and it works very well. This means that connections and the connection works fine database so it can match the record in my database.

    (2) but when I tried to download the news in the form of database, it does not work. When I clicked on the service behavior to double check the action "insert data", it always jumps the error message: "When executing inspectserverbehavior in InsertRecord.htm, a javascript error occurred."

    I copied my code below. Except the form code and a little jquery is written by me, most of the code generated by Dreamweaver.

    <? php require_once('Connections/MAMPPRO.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }

    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "Register_Form")) {}

    $insertSQL = sprintf ("INSERT INTO"user identity"(Ui_LastName, Ui_Email, Ui_FirstName, Ui_Password) VALUES (%s, %s, %s %s)", ")

    GetSQLValueString ($_POST ['Register_Firstname'], "text").

    GetSQLValueString ($_POST ['Register_Lastname'], "text").

    GetSQLValueString ($_POST ['Register_Email'], "text").

    GetSQLValueString ($_POST ['Register_Password'], "text"));

    @mysql_select_db ($database_MAMPPRO, $MAMPPRO);

    $Result1 = mysql_query ($insertSQL, $MAMPPRO) or die (mysql_error ());

    $insertGoTo = "LoginSuccessful.php";

    If (isset {}

    $insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;

    $insertGoTo. = $_SERVER ['QUERY_STRING'];

    }

    header (sprintf ("location: %s", $insertGoTo));

    }

    @mysql_select_db ($database_MAMPPRO, $MAMPPRO);

    $query_Recordset1 = "SELECT *"IDENTITY of the user;"

    $Recordset1 = mysql_query ($query_Recordset1, $MAMPPRO) or die (mysql_error ());

    $row_Recordset1 = mysql_fetch_assoc ($Recordset1);

    $totalRows_Recordset1 = mysql_num_rows ($Recordset1);

    ? >

    <! doctype html >

    < html >

    < head >

    < meta charset = "UTF-8" >

    Registeration < title > < / title >

    "< link href="jquery-mobile/jquery.mobile-1.3.0.min.css "rel ="stylesheet"type =" text/css">

    "< script src="jquery-mobile/jquery-1.8.3.min.js "type =" text/javascript"> < / script >

    "< script src="jquery-mobile/jquery.mobile-1.3.0.min.js "type =" text/javascript"> < / script >

    < / head >

    < body >

    < div data-role = 'page' id = "registrationpage" >

    < div data-role = "header" >

    < h1 > welcome!    < / h1 >

    < h1 > register yourself! < / h1 >

    < / div >

    < data-role = 'content' div > < / div >

    < do action = "<?" PHP echo $editFormAction;? ">" method = "POST" id = "Register_Form" name = "Register_Form" >

    < p >

    < label > Email < / label >

    < input name = "Register_Email" type = "email" required id = form register_email = "Register_Form" title = "Register_Email" >

    < label > < br >

    Password < / label >

    < input name = "Register_Password" type = "password" required id = form register_password = "Register_Form" title = "Register_Password" value = "" >

    < /p >

    < p >

    < label > name < / label >

    < input name = "Register_Lastname" type = "text" required id = form register_lastname = "Register_Form" title = "Register_lastname" value = "" >

    < label > < br >

    First name < / label >

    < input name = "Register_Firstname" type = "text" required id = form register_firstname = "Register_Form" title = "Register_Firstname" value = "" >

    < /p >

    < name of entry = "MM_insert" type = 'submit' form 'Register_Form' value = 'Registration' = >

    < input type = "hidden" name = "MM_insert" value = "Register_Form" >

    < / make >

    < a href = "index.php" data-role = "button" > return to connection < /a > "

    < div data-role = "footer" >

    footer < h4 > < / h4 >

    < / div >

    < / div >

    < / body >

    < / html >

    <? PHP

    mysql_free_result ($Recordset1);

    ? >

    Finally I found the problem.

    It seems in my setting, MAIL does not work in live mode DW. But if moved to any explores, it works fine.

    Adobe really needs to improve its management of PHP.

  • Error in SQL syntax when inserting data to the table in the form of values using insert record

    Hello

    I was hoping that someone could help me.  I am creating a form of registration on a website to insert data into a database table.  When you try to create the form, I get the following error:


    You have an error in your SQL syntax; consult the manual for your version of the MySQL server for the right syntax to use near ' VALUES (name, regno, reason) leave (has ', 1, 'dddd')' at line 1

    I checked the syntax, but you don't know what's wrong.

    I am running Windows 7 with Dw cs6 and wamp server.

    Leave with the names of column (name, regno, reason) is the name of the table.

    Thank you for your help and please help me.

    The code is as below:

    <? php require_once('Connections/connect.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }

    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "form1")) {}

    $insertSQL = sprintf ("INSERT INTO leave (name, regno, reason) VALUES (%s, %s, %s)',

    GetSQLValueString ($_POST ['name'], "text").

    GetSQLValueString ($_POST ['reg'], "int").

    GetSQLValueString ($_POST ['reason'], "text"));

    @mysql_select_db ($database_connect, $connect);

    $Result1 = mysql_query ($insertSQL, $connect) or die (mysql_error ());

    }

    ? >

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "content-type" content = text/html"; charset = utf-8 "/ >"

    < title > online form let < /title >

    < name meta = "keywords" content = "" / > "

    < name meta = "description" content = "" / > "

    < link href = "styless.css" rel = "stylesheet" type = "text/css" media = "screen" / > "

    < / head >

    < body >

    < div id = 'wrapper' >

    < div id = "header" >

    < div id = 'menu' >

    < ul >

    < class li = "current_page_item" > < a href = "#" > home < /a > < /li >

    < li > < /li >

    < li > < /li >

    < li > < a href = "#" > on < /a > < /li >

    < li > < /li >

    < li > < a href = "#" > Contact < /a > < /li >

    < /ul >

    < / div >

    <!-end #menu->

    < div id = "Search" >

    < / div >

    <!-end #search->

    < / div >

    <!-end #header->

    < div id = "logo" >

    E - SCHOOL of CHRIST < h1 > < / h1 >

    < p > < / p >

    < / div >

    < hr / >

    <!-end #logo->

    <! - end #header - wrapper->

    < div id = "page" >

    < div id = "content" >

    < div class = "post" >

    < h2 class = "title" > leave application online < / h2 >

    < div class = "entry" > < / div >

    < / div >

    < do action = "<?" PHP echo $editFormAction;? ">" method = "POST" name = "form1" id = "form1" >

    < table width = "200" border = "2" cellspacing = "5" cellpadding = "5" >

    < b >

    < scope th 'row' = > name < /th >

    < td > < label for = "name" > < / label >

    < input type = "text" name = "name" id = "name" / > < table >

    < /tr >

    < b >

    < scope = "row" th > Reg No. < /th >

    < td > < label for = "reg" > < / label >

    < input type = "text" name = "reg" id = "reg" / > < table >

    < /tr >

    < b >

    < scope = "row" th > why < /th >

    < td > < label for = "reason" > < / label >

    < name textarea = 'reason' id = cols 'reason' = "45" rows = "5" > < / textarea > < table >

    < /tr >

    < b >

    < scope = "row" th > < /th >

    < td > < input type = "submit" name = "b1" id = "b1" value = "Submit" / > < table >

    < /tr >

    < /table >

    < input type = "hidden" name = "MM_insert" value = "form1" / >

    < / make >

    < / div >

    <!-end #content->

    < div id = "sidebar" >

    < ul >

    < li >

    Notice of < h2 > < / h2 >

    < p > students must present the appropriate documents supporting the reason for leave within 3 working days. < /p >

    < /li >

    < li id = "calendar" >

    Calendar < h2 > < / h2 >

    < div id = "calendar_wrap" >

    < table summary = "Calendar" >

    < caption >

    March 2014

    < / legend >

    < thead >

    < b >

    < th abbr = "Monday" scope = "col" title = "Monday" > M < /th >

    < th abbr = "Tuesday" scope = "col" title = "Tuesday" > T < /th >

    < th abbr = "Wednesday" scope = "col" title = "Wednesday" > W < /th >

    < th abbr = "Thursday" scope = "col" title = 'Thursday' > T < /th >

    < th abbr = "Friday" scope = "col" title = 'Friday' > F < /th >

    < th abbr = "Saturday" scope = "col" title = 'Saturday' > S < /th >

    < th abbr = "Sunday" scope = "col" title = 'Sunday' > S < /th >

    < /tr >

    < / thead >

    < tfoot >

    < b >

    < td abbr = "February" colspan = "3" id = "prev" > < a href = "#" title = "" > & laquo; Feb < /a > < table >

    < class td = "pad" > < table >

    < td abbr = "April" colspan = "3" id = "next" > < a href = "#" title = "" > Apr & raquo; < /a > < table >

    < /tr >

    < / tfoot >

    < tbody >

    < b >

    < td colspan = "5" class = "pad" > < table >

    < td > < table > 1

    < td > < table > 2

    < /tr >

    < b >

    < td > 3 < table >

    < td > < table > 4

    < td > 5 < table >

    < td > < table > 6

    < td > < table > 7

    < td > < table > 8

    < td > < table > 9

    < /tr >

    < b >

    < td > < table > 10

    < td id = 'today' > < table > 11

    < td > < table > 12

    < td > < table > 13

    < td > < table > 14

    < td > < table > 15

    < td > < table > 16

    < /tr >

    < b >

    < td > < table > 17

    < td > < table > 18

    < td > < table > 19

    < td > < table > 20

    < td > < table > 21

    < td > < table > 22

    < td > < table > 23

    < /tr >

    < b >

    < td > < table > 24

    < td > < table > 25

    < td > < table > 26

    < td > < table > 27

    < td > < table > 28

    < td > < table > 29

    < td > < table > 30

    < /tr >

    < b >

    < td > < table > 31

    < class td = "pad" colspan = "6" > < table >

    < /tr >

    < / tbody >

    < /table >

    < / div >

    < /li >

    < li > < /li >

    < /ul >

    < / div >

    <!-end #sidebar->

    < div style = "" clear: both; "> < / div >"

    < / div >

    <!-end #page->

    < div id = "footer" >

    < p > Copyright (c) University of Christ. All rights reserved. < /p >

    < / div >

    <!-end #footer->

    < / div >

    < div align = center > < / div > < / body >

    < / html >

    The LEAVE is a reserved word in MySQL. You can try to quote, but you are better to rename it.

Maybe you are looking for

  • I have the audio voicemail on my iphone 6.  I can change it to Visual Voicemail?

    I have a Straight Talk 6 iphone.  It has audio voicemail.  I had visual voicemail on my Straight Talk iphone 5.  Can I change my audio visual on the iphone 6?

  • 9.3.1 battery drain

    I did the upgrade to 9.3.1 on my 5 c and can not believe that the bad battery life I get.  Never had this problem before. I even put the phone on the Mode of low when battery 100% charged and the morning with no apps open, he has already fallen to 75

  • cursur jumping into windows mail... How to stop

    cursur jumps to different places and inserts it as your typing at random... How to stop this?

  • Center of gravity

    Hello I built optical tweezers, through a home made µscope and I measure the position of the balls of fluorescences (1µm to 200 nm) with function of centre of gravity of labview 8bits. My images are a 16 bit and I have to cast in 8bits Image centroid

  • HP Envy 17-J000eb: update of HP Envy 17-J000eb SSD

    Hello my HP laptop is about 1.5 years now, and I would like to replace my old 1 TB HDD with a SSD (to start windows) while keeping the old HDD in my laptop as a secondary drive. However, I read that for some laptops, it is not possible to change the