new report for oracle application : insert data from table A to Table B [message #202251] |
Wed, 08 November 2006 20:23 |
voralux
Messages: 72 Registered: January 2006
|
Member |
|
|
I would like to add new report for oracle application;
the report copy data from Table A to Table B
1. SQL Statement;
select (Field_A1, Field_A2, Field_A3)
from TABLE A
where Field_A3 = 1
2. Add : Function Formula CF_1
function CF_1Formula return char is
begin
insert into TABLE B
(Field_B1, Field_B2, Field_B3)
Values
:Field_A1
,:Field_A2
,:Field_A3);
end
If run report,the report show error
REP-1401 'cf_1formula'Fatal PL/SQL error occurred.
ORA-06503 pl/sql function returned without value.
Please help me
|
|
|
|
Re: new report for oracle application : insert data from table A to Table B [message #202342 is a reply to message #202251] |
Thu, 09 November 2006 04:01 |
voralux
Messages: 72 Registered: January 2006
|
Member |
|
|
I changed function "CF_1"
function CF_1Formula return Number is
inv_id number;
begin
select count (*)
into inv_id
from TABLE A
where STATUS = '3';
If inv_id >0
then
return inv_id;
insert into TABLE B
(Field_B1, Field_B2, Field_B3)
Values
:Field_A1
,:Field_A2
,:Field_A3);
commit;
else
return '0';
end if;
end;
report return data but not insert data =====> Why?
|
|
|
|
|
|