0
I have this plsql code and I must run at the same time:
/*Testar se o codigo é valido*/
CREATE OR REPLACE FUNCTION TESTE1(cod number)
RETURN BOOLEAN IS
begin
if(cod>0)then
return true;
end if;
return false;
end;
/*varrer o banco de acordo com o codigo*/
CREATE OR REPLACE PROCEDURE BUSCA1(cod number) is
nomeT VARCHAR2(20);
begin
/* testa1*/
if(TESTE1(cod)=true)then
select *
into nomeT
from turma
where CD_TURMA = cod;
dbms_output.put_line(nomeT);
else
dbms_output.put_line('Codigo invalido');
end if;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Não foi possível verificar');
end
TEST THE CODE
RUN BUSCA1(3);
Erro a partir da linha : 38 no comando -
EXECUTE BUSCA1(3)
Relatório de erros -
ORA-06550: line 1, column 7:
PLS-00905: object DBAMV.BUSCA1 is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Simultaneous use of functions and procedures in the code ?
– alexjosesilva