import data into the table with the triggers of the sequence
HelloI'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
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:
HelloI 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
-
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 youuser9004152 wrote:
http://it.Toolbox.com/wiki/index.php/Load_data_from_a_flat_file_into_an_Oracle_tableSee 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.
-
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
-
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
-
Importing data into tables to grant access (developer sql 3.2)
Hello
I want to import data into a table PAY_BALANCE_BATCH_LINES which is an array of interface. I am connected to a schema (APPS) and this table belongs to the HR schema. However, if you look at the grants, the APPS schema has all access to this particular table. A TOAD, this used to work great.
But in sqldeveloper, when I filter drop-down list of tables, I'm not able to find the table. Since it is my main means of downloading data I don't know how I can get access to download data in this table. I do not know the password for the schema HR incidentally.
Is there a way out?
Thank you very muchScroll to the bottom of the tree to the 'Other users' node, expand it, and then descend into HR > Tables. Then do your import.
To another browser, right-click on your connection in the tree and open a browser schema.
-
Importing data into Tables - by using the Import Wizard - Null values
Hi all
I would like to use the data import wizard to import data into existing intermediate tables, that are already filled with data.
However, when you import my CSV file, while the import completes without error, all of the empty cells are filled with (null)"- is anyway to prevent this?
For example, ColumnA contains data for lines 1-11 and 12-14 15-30 but row are empty, when you download the wizard of column rows 12-14 are wired populated "(null)". I would like to prevent this
Thanks a lot for your help
ROssYes, it shows a (null), but there is nothing there.
If you go to sqlplus and do a query on the table, it shows a white.If you want to get rid of the (null), then go to Tools - Preferences - Database - Advanced - display Null value like: remove the (null)
You can even display a different background color when it is null if you wish.Michael
-
Insert data into the source of destinator Table
Hi all
Need to insert data in sample_table1 table xxc_source_table sample_table2
create table xxc_source_table (DESCRIPTION varchar2 (10));
Insert the table xxc_source_table values('A201.) ABC.4084.GR');
create table sample_table1 (col_1 varchar2 (10), col_2 varchar2 (10), col_3 varchar2 (10), col_4 varchar2 (10));
create table sample_table2 (col_1 varchar2 (10), col_2 varchar2 (10), col_3 varchar2 (10), col_4 varchar2 (10), moved_flag varchar2 (2));
col_1 = A201
col_2 = ABC
col_3 = 4084
col_4 = GR
Note: Insert data into the col_1, the col_3, the col_4 of the xxc_source_table sample_table1
(2) if the next (form xxc_source_table) data is exist in the sample_table2, and then set the moved_flag as Y in this column
3) xxc_source_table has 17000 lines
Thank you.
Post edited by: Rajesh123 please do not consider cross the line message
Hi Renon,
Why you don't want substr and instr? For best performance, you should go with substr and instr instead of regexp_substr. However you asked me to provide the code instead of substr and InStr. Then try the below...
INSERT ALL
IN VALUES sample_table1 (col1, col2, col3, col4)
IN sample_table2 VALUES (col1, col2, col3, col4, 'Y')
SELECT REGEXP_SUBSTR (DESCRIPTION,'[^.] +', 1, 1) col1,.
REGEXP_SUBSTR (DESCRIPTION,'[^.] +', 1, 2) col2.
REGEXP_SUBSTR (DESCRIPTION,'[^.] +' 1, 3) col3.
REGEXP_SUBSTR (DESCRIPTION,'[^.] +' 1, 4) col4
OF xxc_source_table;
Thank you
Ann
-
What trigger to use to insert data into the table db forms
Hello
My form is current having a block of database with the table reference. When you enter data into the form field and click Save. Automatically record is inserted in the database table.
I want to do this under manual insert. I changed the block of data to a data non-base. Where should I write the insert statement to insert data into the table.
Is - shutter release key of the form-level validation?
Please notify.
Thank you
Didi.You can guide me how to remove the message FRM-40401 no changes to save and instead, I wanted to put 1 transaction record successful... some like it like that.
Hi didi.
And this is my last post I'll sleep. ;)
Take form level trigger named preform
and write on it:SYSTEM.MESSAGE_LEVEL := 5;
I hope this works...
Hamid
Mark correct/good to help others to get the right answers. *
-
How to insert data into the table by using the expression builder in the assign activity
How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
Can someone help me pleaseHello
I don't think that oraext:query-database() can insert data into the table.
What are your needs?
Can not you plan to use the DB adapter with the insert operation?Kind regards
Neeraj Sehgal -
Hi all
I use forms [32 bit] Version 6.0.8.24.1 (Production)
Oracle Database 10g Release 10.2.0.1.0 - Production
I have settings such as the (optional) emp_code and the year (mandatory field - four digits).
Based on the setting that I have to get the detail of a table and these must be inserted at the other table with columns of additions (to hardcode the additional columns).
To achieve this, I intend to get a cursor by selecting the required fields in the table by the way the where clause of the cursor parameters.
by making a loop through the cursor I will insert the records in the other table.
Here, the thing is that the data is going to be huge (since the year is the parameter).
so my approach causes the performance issue.
I heard that there is a different method of insetions
can anyone suggest me the best way (performance wise) other than what I mentioned (if you are aware of)...
Thank you...user13329002 wrote:
Thanks for everyone.
I have to take the data from the table as e_name, e_code, of the table and insert it into another table with some other values such as
e_name, e_code, as well as I add 'n', 'o'.
its something likeinsert into e_emp(emp_name,emp_code,emp_add,emp_status,emp_type) select e_name,e_code,e_add,'O','N') from e_table where e_date = Parameter.
in other words, the values for Emp_status, emp_type I have no values in the e_table.so table and enter in e_table I have to hard code it.
CAL I hard code as I mentioned in my statement examplecan someone clear me of the foregoing.
Thank you...
Published by: user13329002 on February 15, 2011 20:11
Yes... You can hardcode the values for Emp_status, emp_type.
SQL> CREATE TABLE e_emp(emp_code NUMBER(10),emp_status VARCHAR2(1),emp_type VARCHAR2(1)); Table created. SQL> create table e_table as (select * from e_emp); Table created. SQL> INSERT INTO e_table(emp_code) VALUES('1111'); 1 row created. SQL> insert into e_table(emp_code) values('2222'); 1 row created. SQL> select * from e_table; EMP_CODE E E ---------- - - 1111 2222 SQL> insert into e_emp(emp_code,emp_status,emp_type) (select emp_code,'0','N' from e_table); 2 rows created. SQL> select * from e_emp; EMP_CODE E E ---------- - - 1111 0 N 2222 0 N SQL>
I hope this helps.
Kind regards
Claudy -
ADF progress indicator to insert the data into the file table.
I have a requirement where the progress bar should indicate the percentage of completion to insert the data into the tables of database files in a given folder path. I found an article that explains how to get the progress indicator when downloading a file in
http://www.gebs.ro/blog/Oracle/Oracle-ADF-progress-indicator-in-Fusion-Middleware-11g/. I believe that I must first get the total number of files in the folder and then begin to compare with the number of files that are inserted into the table similar to what is done by downloading (getting the file size and download size), but I don't know how to do this. Can anyone help?May be that this example allows you to
* 042. Dynamically change the color of progress bar based on its current value *.
http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html
-
Hi all
I have an XML (emp.xml) with data below:
-< root >
-< row >
< name > steve < / lastname >
< 30 > < / Age >
< / row >
-< row >
< name > Paul < / lastname >
<>26 < / Age >
< / row >
< / root >
I would like to create a stored procedure to store the xml data into the EMP table.
EMP
LastName age
Steve 30
Paul 26
I tried to watch all threads related to this forum, but cannot find the right wire. Any help is greatly appreciated. Thank youWith
SQL> select * from xmltable('root/row' passing xmltype('
steve 30 Paul 26 You can now just make a
Insert into emp as select...
-
How to insert the legacy data into the QP_RLTD_MODIFIERS table?
How insert Legacy data into the QP_RLTD_MODIFIERS table in the instance of R12.
I would use the QP_Modifiers_PUB API. Process_Modifiers to push the old data on prices in R12. QP_RLTD_MODIFIERS is only used for certain types of discounts (in my prod environment, only the promos are given in this table).
-
How to insert 10,000 records test data into the emp table
Hi I am new to oracle can someone please help me write a program so that I can insert the test data into the emp tableSELECT LEVEL empno, DBMS_RANDOM.string ('U', 20) emp_name, TRUNC (DBMS_RANDOM.VALUE (10000, 100000), 2) sal, DBMS_RANDOM.string ('U', 10) job, TO_DATE ('1990-01-01', 'yyyy-mm-dd') + TRUNC (DBMS_RANDOM.VALUE (1, 6000), 0) hiredate, CASE WHEN LEVEL > 10 THEN TRUNC (DBMS_RANDOM.VALUE (1, 11), 0) ELSE NULL END mgr, TRUNC (DBMS_RANDOM.VALUE (1, 5), 0) deptno FROM DUAL CONNECT BY LEVEL <= 10000
Maybe you are looking for
-
Site XFINITY Speed Test, no results.
I'm going on the XFINITY Speed Test site and try to get my test results, but start the speed Test does not appear? I used this site many times in the past.
-
Crash when you press BACKSPACE.
Whenever I press the BACKSPACE key firefox just goes down, it seems not serious if I type in the address bar or on a Web page. He sits for a few days, I haven't installed firefox or windows 8 (No 8.1) updates, at least not to my knowledge.
-
3.46Ghz mac Pro 12-Core (hot rodded) should I buy?
Hello There seems to be a lot of Mac 12-core for sale... at reasonable prices. I'm looking for advice on/to their topic. (1) are they all models 2009 and later? (2) are motherboards bottlenecked? (3) is there a difference between a world adopted 2009
-
How to change audit in two steps of two factor authentication
Hello I already have the two-step verification implemented on all my devices (iPhone, iPad, MacBook). How to move to two-factor authentication? Even how to know he's ready for me? Thank you
-
I recently bought the video game Rift via online download, and at the end of my installation it says "Your DirectX9 must be updated," I proceeded, agreed to the terms in the DirectX Wizard and was brought to a page that says "Installation: initializi