Exception Handling for Oracle

Source: Internet
Author: User

  /**     Write auto-marshal command: "Sync WebService use"     wyg 2017-03-12  *  /PROCEDURE Isdt_vehicle_autolock (P_wid       in VARCHAR2,                                  P_vehicleno in VARCHAR2,                                  p_state out     INT,                                  p_msg off       VARCHAR2) is  BEGIN    INSERT INTO T_isdt_elockautorequest      (RequestID,       wid,       Vehicleno,       operatetype,       created_ Date,       last_updated_date)    values      (Sys_guid (), P_wid, P_vehicleno, 1, sysdate, sysdate);    COMMIT;    P_state: = 1;    P_msg   : = ' success ';  EXCEPTION when OTHERS and then      rollback;      P_state: = 0;      P_msg   : = SUBSTRB (' line: ' | | dbms_utility.format_error_backtrace () | |                         ' occur error; ' | | SQLCODE | | ', ' | | SQLERRM,                         1, (+                         );  END;

  

EXCEPTION when Dup_val_on_index and then inserts into T_isdt_vehicle_track_err (Car_num, Gpstime,         Lon, LAT, speed, direction, odometer, statusstr, Placeroad,         Created_date, created_by) VALUES (P_car_num, P_gpstime, P_lon, P_lat, P_speed, P_direction, P_odometer, P_statusstr, P_placeroad, Sysdate, 1); P_state:=0; P_msg:= SUBSTRB ('Line :'|| Dbms_utility.format_error_backtrace () | |'occur error;'|| SQLCODE | |','||SQLERRM,1,                          $);    COMMIT;      When OTHERS and then ROLLBACK; P_state:=0; P_msg:= SUBSTRB ('Line :'|| Dbms_utility.format_error_backtrace () | |'occur error;'|| SQLCODE | |','||SQLERRM,1,                          $);

Show Results:

ine:ora-06512: In "Employedb.__data_sync", line 512
occur error;-12899,ora-12899: Column "EMS". " T_isdt_elockautorequest "." WID value is too large (actual value: 137, Maximum: 50)

Exception Handling for Oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.