ora-01403

PLSQL Trigger ORA 01403 no data found

眉间皱痕 提交于 2019-12-25 19:57:08
问题 i am making a trigger in PL-SQL to restrict employees in section/dept on my employee entry form i get ORA-01403: no data found . please anyone help me create or replace trigger DEPT_STRENTH after insert on empmasterinfo for each row DECLARE -- local variables here EMP_Count NUMBER; MAX_Strength NUMBER; V_Mainid VARCHAR2(100); V_orgelementname VARCHAR2(100); BEGIN --taking value from form V_Mainid := :new.mainid; V_orgelementname := :new.orgelementname; --Comparing values with existing select

sql server linked server to oracle returns no data found when data exists

感情迁移 提交于 2019-12-18 08:10:06
问题 I have a linked server setup in SQL Server to hit an Oracle database. I have a query in SQL Server that joins on the Oracle table using dot notation. I am getting a “No Data Found” error from Oracle. On the Oracle side, I am hitting a table (not a view) and no stored procedure is involved. First, when there is no data I should just get zero rows and not an error. Second, there should actually be data in this case. Third, I have only seen the ORA-01403 error in PL/SQL code; never in SQL. This

Oracle: Get a query to always return exactly one row, even when there's no data to be found

China☆狼群 提交于 2019-12-04 03:13:32
问题 I have a query like this: select data_name into v_name from data_table where data_table.type = v_t_id Normally, this query should return exactly one row. When there's no match on v_t_id , the program fails with a "No data found" exception. I know I could handle this in PL/SQL, but I was wondering if there's a way to do this only in a query. As a test, I've tried: select case when subq.data_name is null then 'UNKNOWN' else subq.data_name end from (select data_name from data_table where data

sql server linked server to oracle returns no data found when data exists

半腔热情 提交于 2019-11-29 13:58:48
I have a linked server setup in SQL Server to hit an Oracle database. I have a query in SQL Server that joins on the Oracle table using dot notation. I am getting a “No Data Found” error from Oracle. On the Oracle side, I am hitting a table (not a view) and no stored procedure is involved. First, when there is no data I should just get zero rows and not an error. Second, there should actually be data in this case. Third, I have only seen the ORA-01403 error in PL/SQL code; never in SQL. This is the full error message: OLE DB provider "OraOLEDB.Oracle" for linked server "OM_ORACLE" returned

PL/SQL block problem: No data found error

Deadly 提交于 2019-11-27 11:33:18
SET SERVEROUTPUT ON DECLARE v_student_id NUMBER := &sv_student_id; v_section_id NUMBER := 89; v_final_grade NUMBER; v_letter_grade CHAR(1); BEGIN SELECT final_grade INTO v_final_grade FROM enrollment WHERE student_id = v_student_id AND section_id = v_section_id; CASE -- outer CASE WHEN v_final_grade IS NULL THEN DBMS_OUTPUT.PUT_LINE ('There is no final grade.'); ELSE CASE -- inner CASE WHEN v_final_grade >= 90 THEN v_letter_grade := 'A'; WHEN v_final_grade >= 80 THEN v_letter_grade := 'B'; WHEN v_final_grade >= 70 THEN v_letter_grade := 'C'; WHEN v_final_grade >= 60 THEN v_letter_grade := 'D';

PL/SQL block problem: No data found error

依然范特西╮ 提交于 2019-11-26 22:20:40
问题 SET SERVEROUTPUT ON DECLARE v_student_id NUMBER := &sv_student_id; v_section_id NUMBER := 89; v_final_grade NUMBER; v_letter_grade CHAR(1); BEGIN SELECT final_grade INTO v_final_grade FROM enrollment WHERE student_id = v_student_id AND section_id = v_section_id; CASE -- outer CASE WHEN v_final_grade IS NULL THEN DBMS_OUTPUT.PUT_LINE ('There is no final grade.'); ELSE CASE -- inner CASE WHEN v_final_grade >= 90 THEN v_letter_grade := 'A'; WHEN v_final_grade >= 80 THEN v_letter_grade := 'B';