it-rex
asked on
ORA-01403: no data found
what is wrong with this code it gives
ORA-01403: no data found
ORA-06512: at line 21
//* Formatted on 3/17/2011 11:21:40 AM (QP5 v5.126.903.23003) */
DECLARE
CURSOR a_cur
IS
SELECT *
FROM myschema.order_tab pc;
a_rec a_cur%ROWTYPE;
f1 DATE;
f2 DATE;
r1 DATE;
r2 DATE;
BEGIN
OPEN a_cur;
LOOP
BEGIN
FETCH a_cur INTO a_rec;
EXIT WHEN a_cur%NOTFOUND;
SELECT FFS_BASELINE_START_DT_USER ,
FFS_BASELINE_END_DT_USER,
RX_BASELINE_START_DT_USER,
RX_BASELINE_END_DT_USER
INTO f1,
f2,
r1,
r2
FROM myschema_reports.ca_baseli ne
WHERE project_number = a_rec.project_number;
UPDATE myschema.order_tab
SET FFS_BASELINE_START_DATE = f1,
FFS_baseline_end_date = f2,
RX_BASELINE_START_DATE = r1,
RX_BASELINE_END_DATE = r2
WHERE project_number = a_rec.project_number;
END;
END LOOP;
CLOSE a_cur;
END;
ORA-01403: no data found
ORA-06512: at line 21
//* Formatted on 3/17/2011 11:21:40 AM (QP5 v5.126.903.23003) */
DECLARE
CURSOR a_cur
IS
SELECT *
FROM myschema.order_tab pc;
a_rec a_cur%ROWTYPE;
f1 DATE;
f2 DATE;
r1 DATE;
r2 DATE;
BEGIN
OPEN a_cur;
LOOP
BEGIN
FETCH a_cur INTO a_rec;
EXIT WHEN a_cur%NOTFOUND;
SELECT FFS_BASELINE_START_DT_USER
FFS_BASELINE_END_DT_USER,
RX_BASELINE_START_DT_USER,
RX_BASELINE_END_DT_USER
INTO f1,
f2,
r1,
r2
FROM myschema_reports.ca_baseli
WHERE project_number = a_rec.project_number;
UPDATE myschema.order_tab
SET FFS_BASELINE_START_DATE = f1,
FFS_baseline_end_date = f2,
RX_BASELINE_START_DATE = r1,
RX_BASELINE_END_DATE = r2
WHERE project_number = a_rec.project_number;
END;
END LOOP;
CLOSE a_cur;
END;
I know I am asking a stupid question. pls check if you have data in your table :order_tab
It's probably the ca_baseline table. There is probably no rows for one of the projects in the cursor.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all; very good