Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

685
Visualizações
Error message when data not inserted in oracle apex

I have an insert query in oracle apex, sometimes the data are not inserted because of different reasons (for example writing a text in number field). is there a way to display an error message that check if data is inserted in the database or not?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This is how this can be done for a page process of type pl/sql. Example is on the sample dept table.

  1. Create 2 page hidden page items: P48_SUCCESS_MESSAGE and P48_ERROR_MESSAGE
  2. In the page process that does the update use the following code
DECLARE
  e_invalid_insert exception;
BEGIN
  INSERT INTO dept(dname, loc) VALUES (:P48_DNAME,:P48_LOC);
  :P48_SUCCESS_MESSAGE := 'Insert succesful';
EXCEPTION WHEN OTHERS THEN
  -- below code will also show database error, adjust for your requirements
  :P48_ERROR_MESSAGE := 'Insert failed:' ||SQLERRM; 
  RAISE e_invalid_insert;
END;
  1. For the attribute "Success Message" of the page process put &P48_SUCCESS_MESSAGE., For the attribute "Error Message" of the page process put &P48_ERROR_MESSAGE.

Check the help text for "Error Message" and "Success Message" for available substitution strings.

Note, you state sometimes the data are not inserted because of different reasons (for example writing a text in number field). As a developer you can put in validations to ensure that the data is correct before the insert process is executed. If a validation fails, the insert statement will not be executed (and it should not be executed).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda