Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

686
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!