Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

679
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda