Al crear mi SP en oracle me genera error, el error me lo da en la linea donde asigno a total la Query
Total:=(Select sum(Monto_Total) as suma from TablaC where id = Amount.id_camp);
[Error] PLS-00103 (19: 15): PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + case mod new not null <an identifier>
<a double-quoted delimited-identifier> <a bind variable>
continue
[Error] PLS-00103 (19: 76): PLS-00103: Encountered the symbol ")" when expecting one of the following:
. , @ ; for <an identifier>
<a double-quoted delimited-identifier> group having intersect
minus order partition sta
[Error] PLS-00103 (22: 5): PLS-00103: Encountered the symbol "LOOP" when expecting one of the following: ;
este es mi codigo
CREATE PROCEDURE Cifras AS
Total INT;
BEGIN
for Archivo in
(select File from TablaA where Folio='E7777' and Tipo = 1 group by File
)
loop
for Amount in
(
select id_camp from TablaB where name = Archivo.File
)
loop
Total:=(Select sum(Monto_Total) as suma from TablaC where id = Amount.id_camp);
dbms_output.put_line('Archivo: ' || Total);
end loop;
end loop;
END;