Hello
I created an oracle function (A_QTECDE) for a sum of some order quantities, if I have a single order it goes through otherwise I get an error message:
select A_QTECDE ((select num_cde from cde_cli_lign where num_cde like '0008%'),1) from dual
ORA-01427: single-row subquery returns more than one row
Here is the function:
CREATE OR REPLACE FUNCTION CREATOR.A_QTECDE (
VNUM_CDE IN VARCHAR2,
VNUM_LIGN IN BINARY_INTEGER
)
RETURN BINARY_INTEGER
AS
qte BINARY_INTEGER;
begin
Select sum (NVL(QTE_T1, 0) + NVL(QTE_T2, 0) + NVL(QTE_T3, 0)) into qte
from CDE_CLI_LIGN
where num_cde in vnum_cde and num_lign=vnum_lign ;
return qte;
end A_qtecde;
Thanks for Your Help