Error with PL/SQL code
I get several errors trying to insert data into a table through the declaration of pl/sqlHere are the errors:
--Procedure to insert the values into section table(ex1.sql)
declare
v_section %type;
begin
v_section.SECTIONNO:=&no;
v_section. DESCRIPTION:='&desc';
v_section.SECTION_HEAD_EMPNO:=&empno
insert into section values v_section;
end;
/
When I execute the pl/sql program above I get errors:SQL> @ex1
Enter value for no: 10
old 4: v_section.SECTIONNO:=&no;
new 4: v_section.SECTIONNO:=10;
Enter value for desc: Sales
old 5: v_section. DESCRIPTION:='&desc';
new 5: v_section. DESCRIPTION:='Sales';
Enter value for empno: 1005
old 6: v_section.SECTION_HEAD_EMPNO:=&empno
new 6: v_section.SECTION_HEAD_EMPNO:=1005
v_section %type;
*
ERROR at line 2:
ORA-06550: line 2, column 12:
PLS-00103: Encountered the symbol "%" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char time timestamp interval date binary national character
nchar
The symbol "<an identifier>" was substituted for "%" to continue.
ORA-06550: line 7, column 1:
PLS-00103: Encountered the symbol "INSERT" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
between || multiset member SUBMULTISET_
The s
BTW, * section table is:SQL> desc section;
Name Null? Type
----------------------------------------------------------------- -------- -----------------------------------
---------
SECTIONNO NOT NULL NUMBER(2)
DESCRIPTION VARCHAR2(30)
SECTION_HEAD_EMPNO NUMBER(4)
Kindly, correct me where I am doing wrongThanks in advance!
I've updated my post above. Just follow and copy paste the code.
You are missing the semicolon after
v_section.DESCRIPTION :=&empno
It should be
v_section.DESCRIPTION :=&empno;
This is what you need
declare
v_section SECTION%ROWTYPE;
begin
v_section.SECTIONNO:=&no;
v_section. DESCRIPTION:='&desc';
v_section.SECTION_HEAD_EMPNO:=&empno;
insert into SECTION values v_section;
end;
/
G.
Tags: Database
Similar Questions
-
What is missing with Pl SQL code?
Hey guys,.
I'm learning to get out of this book and the guy has that little bit of Pl/sql...
It runs organist.
create table zed (z varchar2 (30);)
declare the procedure thisway1
(p_data in varchar2)
is
Start
immediate execution
"insert into zed (z) values(:z) '.
using p_data; end thisway1;
The code is correct?
Hello
XevBellringer wrote:
Hey guys,.
I'm learning to get out of this book and the guy has that little bit of Pl/sql...
It runs organist.
create table zed (z varchar2 (30);)
declare the procedure thisway1
(p_data in varchar2)
is
Start
immediate execution
"insert into zed (z) values(:z) '.
using p_data; end thisway1;
The code is correct?
No code is absolutely correct. The code may be correct for a specific purpose, which means that it will be incorrect for other purposes. If this code was copied from a book, the book probably explains the context and why the author chose to use EXECUTE IMMEDIATE when it is not needed. (You must use dynamic SQL, such as EXECUTE IMMEDIATE, only when you really need to. This is one of the most important things to know about dynamic SQL statements. Perhaps the book uses this code to make this point.)
In itself, the PL/SQL code you have posted will get a compilation error. The DECLARE statement must have matching BEGIN and END statements. (The BEGIN and END statements above are for the thisway1 procedure, which is nested in the DECLARE section). I suspect that you copied only part of the book pulled code.
The CREATE TABLE statement includes a mistake; "He has 2 left ' (of, but only 1 right ' ')'. You must have an equal number of each...
-
Hello!
I need help, I don't know why I get errors with my code:
declare
xMin number (3) NOT NULL: = 50;
xMax number (3) NOT NULL: = 70;
yMin number (3): = 0;
yMax number (3): = 20;
Start
XMin CASE <-400 THEN
xMin = - 400;
ELSIF xMax > 400 THEN
xMax = 400;
ELSEIF yMin <-400 THEN
yMin = - 400;
ELSEIF yMax > 400 THEN
yMax = 400;
END IF;
Select sum (population) populacija
of naselje
where x BETWEEN xMin xMax AND
and is BETWEEN yMin AND yMax;
end;
error I get is:
ORA-06550: line 10, column 15:
Thanks for your help!
PLS-00103: encountered the symbol "=" when expecting one of the following conditions:
:= . ( @ % ;
The symbol ': = was inserted before '=' to continue. '
ORA-06550: line 12, column 15:
PLS-00103: encountered the symbol "=" when expecting one of the following conditions:
:= . ( @ % ;
1 declare
2 xMin number (3) NOT NULL: = 50;
3 xMax number (3) NOT NULL: = 70;
Kind regards
DraganFirst ELSEIF is incorrect, it must be ELSIF
AH, Yes, '=' must be ': = '.
Published by: Bob37 on May 16, 2012 12:10
-
Need help with PL/SQL code
Hi I am writing this code in pl/SQL:
create or replace
PROCEDURE 'TESTPRI '.
(NUMBER pCYC_DT)
AS
vTGT_TABL VARCHAR2 (25);
vSTG_TABL varchar2 (30);
vsql varchar2 (200);
BEGIN
vTGT_TABL: = 'TESTTABL ';
vSTG_TABL: = vTGT_TABL | » _'|| pCYC_DT;
vsql: = 'TRUNCATE TABLE ' | vTGT_TABL;
EXECUTE IMMEDIATE vsql;
RUN IMMEDIATELY "INSERT" | vTGT_TABL | ' SELECT * FROM '. vSTG_TABL;
COMMIT;
-IMMEDIATE 'TRUNCATE TABLE ' | vSTG_TABL;
END TESTPRI;
When executing this procedure it gives me following error:
ORA-03290: Invalid command truncate - lack of key word TABLE or CLUSTER
ORA-06512: at "DBR. TESTPRI', line 11
ORA-06512: at line 6
But I think that the TRUNCATE TABLE statement is correct. Is there a problem with the variable?
Any help would be appreciated.
Thank you.vsql: = 'TRUNCATE TABLE ' | vTGT_TABL;
You need space after the TABLE
vsql:= 'TRUNCATE TABLE ' ||vTGT_TABL ;
EXECUTE IMMEDIATE vsql;
RUN IMMEDIATELY "INSERT" | vTGT_TABL | ' SELECT * FROM '. vSTG_TABL;Sapce here after INTO, before SELECT and FROM
EXECUTE IMMEDIATE 'INSERT INTO '|| vTGT_TABL||' SELECT * FROM '|| vSTG_TABL;
-
error in dynamic sql code:
When I'm adding this code dynamically is error rechaussaient. Please can you find the error and tell me please
v_sql := v_sql||'tl.type = ''1'' and TL.TYPE IN (SELECT DECODE (LENGTH (tc.id),2,''AP''||tc.tagid,tc.tagid) tagid FROM traninfo tc, trancogroup tg WHERE tc.id = tg.id AND tc.req = tg.req AND tc.status = ''Y'' AND tg.smstype IN (SELECT SUBSTR (channel_desc,''1'',''2'') FROM deliverychannelinfo) AND tc.description ='||v_txntype||')';
980560 wrote:
When I'm adding this code dynamically is error rechaussaient. Please can you find the error and tell me pleasev_sql := v_sql||'tl.type = ''1'' and TL.TYPE IN (SELECT DECODE (LENGTH (tc.id),2,''AP''||tc.tagid,tc.tagid) tagid FROM traninfo tc, trancogroup tg WHERE tc.id = tg.id AND tc.req = tg.req AND tc.status = ''Y'' AND tg.smstype IN (SELECT SUBSTR (channel_desc,''1'',''2'') FROM deliverychannelinfo) AND tc.description ='||v_txntype||')';
The most important thing to consider when you use dynamic SQL statements, is to ensure that you are using Bind variables and not the value of filler directly as you did it tc.description ='| v_txntype |') ' ; + It is very bad.
Secondly, when you generate a string which uses apostrophes Q use notation that would be easier and more readable.
And on the error you get, that could be cause of there is no space before t1.type, then try this
v_sql := v_sql || q'[ tl.type = '1' and tl.type in (select decode (length (tc.id),2,'AP'||tc.tagid,tc.tagid) tagid from traninfo tc, trancogroup tg where tc.id = tg.id and tc.req = tg.req and tc.status = 'Y' and tg.smstype IN (SELECT SUBSTR (channel_desc,1,2) FROM deliverychannelinfo) and tc.description = :txn_type)]'
-
Hello
I wrote a package specification given below:
create or replace PACKAGE BILL_PACKAGE AS
storeId varchar2 (5);
startDate varchar2 (10);
FUNCTION boolean RETURN F_Bill (str_id IN tel_tr_ltm_bl_py.id_str_rt%TYPE,ws_id IN tel_tr_ltm_bl_py.id_ws%TYPE,v_date IN tel_tr_ltm_bl_py.dc_dy_bsn%TYPE);
END BILLPAYPACKAGE;
I wrote the body of package also. Now when I call the F_Bill function, I get this error:
PLS-00201: identifier ' BILL_PACKAGE. STARTDATE' must be declared
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
ORA-06550: line 3, column 1:
PLS-00201: identifier ' BILL_PACKAGE. STOREID' must be declared
ORA-06550: line 3, column 1:
PL/SQL: Statement ignored
This same package works well on another local data base.
What could be the reason for this?
What is an access problem? In db, which we get an error, we use a user "ConUser" to connect to a schema 'b_owner '.
How can we verify this if it is a question of privilege.
Thank you!>
...This same package works well on another local data base.
What could be the reason for this?
What is an access problem? In db, which we get an error, we use a user "ConUser" to connect to a schema 'b_owner '.
How can we verify this if it is a question of privilege.
The 'ConUSer' user needs to execute privileges for the package.
Also, it depends on what he calls the package or the variables in it.You can check the privs with
select * from all_tab_privs where table_name = 'BILL_PACKAGE';
This must be run as a user ConUser.
You may also have a problem with name resolution. The package name is not BILL_PACKAGE. It's 'b_owner. BILL_PACKAGE ".
If you omit the schema name, then the current user is tried. So if you call BILL_PACKAGE, then this translates into "ConUSer.BILL_PACKAGE".You can change this by creating a synonym as
create synonym bill_package for b_owner.bill_package;
-
Management of errors with the return code
Hello
I set up an email notification which is the last step in case of failure and success. As I am manages all stages with a link (red arrow) KO, ODI handles any error that occurs and so there is never a return code different from 0 (success). It's great because the administrator receives an email with detailed error information, but the process is performed by an external Scheduler and IT operations wants the Scheduler must be notified by the return code if an error occurs.
How can I do both: manage a mistake and will continue to receive a return code other than 0 on the command line?
Thank you
MattIn your package.
For the final step before sending the mail.
Create 2 steps (which will be the same), with both the same send email step.
Put the green arrow of your last treatment for the first shipment of e-mail, it will be your end if no error.
Put the red arrow of your last treatment for the second e-mail was sent, it will be your end if there is an error.
After the mail error put another step which end in error every time, as a procedure that calls a ' select * of fgfhfju "(if you don't have a table of fgfhfju) and bind this step with a green arrow at the stage of email from error.You can now separate finishing way in your package, one for the error and another for the right side.
Hoping to help.
Kind regards
Brice
-
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
-
Hello
Dose anyone know how to fix the error with the code: 0xe7210001, message: unable to load powrprof, object: CLSD-no-it is found;
OR: Fingerprintsoftware OR error: replicas THotkey.exe message window and the computer freezesMaleware scanned and virus, also in safe mode, found no infection, reinstalled driver fingerprint, but nothing has changed.
grateful for the help!
Hello
> message: unable to load powrprof, object: CLSD-no-it is found;
In my view, this would mean that there is a problem with Toshiba Power Saver
What laptop Toshiba, you have exactly?Maybe reinstall Power Saver could help. You can find it on the official website of Toshiba.
-
Please PLEASE help - I have Genuine Windows but had 2 re - install it n now I can't validate cuz this---> Validation incomplete: ActiveX error with error code [0 x 80080296].
What can I do? Thank you n God bless.Quote your full version of Windows (for example, WinXP SP3;) Vista SP1; Vista 64 - bit SP2; Win7; Win7 64 bit) when you post in a forum or a newsgroup. Please do it in your next reply.
What problems do you think that reinstalling Windows can solve?
Did you do a repair installation, or you format and do a clean install?
=================================
Please go to http://www.microsoft.com/genuine/ and click on the button to validate Windows, and then restart your computer.
If you were not able to validate, follow these steps:
1. Download this diagnostic tool, save it to your desktop: http://go.microsoft.com/fwlink/?linkid=56062
-Online Windows XP: double-click the executable file to run the tool.
-Online Vista & Win7: right-click on the executable and select run as administrator to run the tool.
2. after running the tool, click the Windows tab, and then click the copy button (on the Clipboard).
NB: You can open a new file in Notepad, paste the contents of the Clipboard in it & keep for future reference.
3 start a new post in the appropriate forum of Microsoft Genuine Advantage and paste the results of the WGA diagnostic data in a detailed post: http://social.microsoft.com/Forums/en-US/category/genuine
4 Troubleshooting specialist will analyze the data and recommend an appropriate solution.
~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft
-
I am currently using Windows vista. I face a problem that I can't remove all the files in the form of MPEG-4. And the error with code 0x800704C8. What should I do so that I can delete these files? Please kindly help me to solve this problem. Thank you.
original title: Code 0x800704C8...Hello
Did you change your computer?
Method 1:
Step 1:
I suggest you follow the link and check.
What are the permissions?
http://Windows.Microsoft.com/en-us/Windows-Vista/what-are-permissions
Step 2;
Why can't I delete a file or a folder?
http://Windows.Microsoft.com/en-us/Windows-Vista/why-cant-I-delete-a-file-or-folder
Diagnose and repair Windows files and folders problems automatically
http://support.Microsoft.com/mats/windows_file_and_folder_diag/
Method 2:
I suggest to download and install the Microsoft safety scanner and run the scan and check.
http://www.Microsoft.com/security/scanner/en-us/default.aspx
WARNING: There could be a loss of data while performing an analysis using the Microsoft safety scanner to eliminate viruses as appropriate
-
you receive an update with the 80243004 code error
whenever I'm trying to update windows, you receive an error with the code 80243004.plz to help to get rid of this problem.
My operating system is windows vista.Hello
1. What are the updates do not install?
2 did you change on your computer?
I suggest you to follow the methods and check.
Method 1:
Problems with installing updates
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updates
Method 2:
I suggest to perform the clean boot, try to installed updates and control.
How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
http://support.Microsoft.com/kb/929135
Note: After a repair, be sure to set the computer to start as usual as mentioned in step 7 in the above article.
Method 3:
How to reset the Windows Update components?
-
'ink system failure' error with code oxc19e0023 on a HP Photosmart Premium all-in-One Printer - C309
'ink system failure' error with code oxc19e0023 on have a HP Photosmart Premium all-in - One Printer - C309g - did all resets and reinstall the ink also tried to replace ink with new carts HP... frustrated please help
Have you tried the steps outlined in this article:
http://support.HP.com/us-en/document/c03081973If not try the steps and tell us if it helps.
Good luck!
-
Original title: an error occurred in SQL server?
Hello, I just wanted to go to this site, but this error pops up: error SQL
An error occurred in SQL server:This isn't a problem with intellectual property. Board of Directors, but rather with your SQL Server. Please contact your host and copy the above message.
Please help me, I just moved my computer so I had to disconnect from the internet, but now he has problems.
Is the site I tried to go to: http://www.minecraftforum.net/topic/227822-166-millenaire-npc-village-076c-duplicate-villager-fix/
Hey Brainiac,
1. are you encounter problems with this site?
2. are you able to connect to this site from a different computer?
3. were you able to connect to this website before?
4. you remember to make changes to the computer before this problem?
The problem seems to be, with the site that you are visiting. You can check if you can access the site from another computer.
Hope this information is useful.
-
Get "I/o Error" with the 0x8078002A error code when I start a backup.
* Original title: IO Error Message - I am an amateur
When I start a backup of my hard drive to my external hard drive, I get an error that reads "I/o Error" with the 0x8078002A error code. I am a real novice. I can do either fix it or work around this problem?
Hello
Welcome to the Microsoft community.
Try the steps in these articles:
Error message when you try to perform a full backup on a Windows Vista-based computer: "" the request could not be performed because of an i/o device error".
http://support.Microsoft.com/kb/952272
Note: It is applicable for Windows 7 as well.Perform a clean boot:
How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
http://support.Microsoft.com/kb/929135
Note: After a repair, be sure to set the computer to start as usual as mentioned in step 7 in the Knowledge Base article.
Maybe you are looking for
-
After the recent upgrade of the outgoing message header changed completely. He is now a huge block with four lines over bar tools. I can't seem to figure out how to get several 'to' address spaces, and it is also difficult to find the cc: and bcc: a
-
Hello! I just bought a generic dongle that I can plug my iPhone 6 to add 32 GB of memory (http://bit.ly/1YCFNx9), I was very surprised to see that I could download their app outside the App Store, at the address pre.im. Then, to make it work, I just
-
Why writer not write CD really z500
Hello WHEB I was writing cd with nero and ashampoo after a minute writing of half of it, but at the end of writing cdrom say error in writing on CD and say his problem for windows... my windows in 8.1 and sign up right! Please help me my laptop compu
-
Iconia W3 Recovery DVD could not perform the complete installation
Hi, my Acer Iconia W3-810 comes with a recovery DVD. When I try to reinstall Window 8 on tablet PC using Acer recovery media, he could not complete the installation. The system of updating the restore process finished about 33% before moving to 100%
-
Win 7 error of Upgrade Advisor all trying to run on 32-bit xp
It is now November 4, and yet I didn't find answer to my question on windows 7 upgrade advisor. I have a clean install of windows xp pro. all the current updates from tonight. No hardware conflict; nothing that would allow me to run Windows 7 upgrade