Oracle problems (1)

Source: Internet
Author: User
2005/07/22

Event: I first checked the stored procedure and carefully read the PL/SQL code to find that there was no error, this made me very strange. At this time, I did not dare to directly use toad debugging on the user's system, so I asked the project manager for help, after debugging the code on the user system, he found that the calculation could not be completed because one of my comparison statements throws an exception.

Problem: This comparison statement compares the "date" variable with the "string" variable. The string stores a date string in the yyyymmdd format. In the code, the to_char conversion date variant string variable is used too much to complete the date comparison method. I was confused when I modified the code and kept this obfuscation during the code check, without seeing the problem.

Experience: During Variable comparison, the type should be converted in actual comparison. For example, when comparing dates, both sides of the comparison should be date variables (conversion allowed). Although the comparison results may be correct, do not use string in date format for comparison.

All faces are lost.

Supplement: on April 9, July 27, I communicated with the project manager and learned that the comparison of date strings in Oracle time-based partition tables has higher performance.

========================================================== ==========================================================

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.