Problems with Oracle Max function usage

Source: Internet
Author: User

When writing another stored procedure, the following SQL statement is used:
Copy codeThe Code is as follows:
Select max (RE_DATE) INTO V_RE_DATE
FROM T_RECORDING
Where id = '000000'

It is reasonable to say that the query result based on this condition should be sqlcode = 1403, But the strange thing is that the following SQL exception is not captured:
Copy codeThe Code is as follows:
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
ERR_CODE: =-2000;
ERR_MSG: = SQLERRM;
RETURN;

No error is returned during execution. If the V_RE_DATE value is found to be null by running the command, the sqlcode = 1405 exception should also be reported since the value is null, however, the oracle execution engine has not reported any error. What is the problem? Write down the problem today and study it later.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.