In the project, multiple methods call the same SQL statement, and resolve the conflicts by resolving different SQL queries for each method.

Source: Internet
Author: User

The SQL statement in the company's code may be called by multiple methods, but some methods will be associated with other tables, so if the modification is inappropriate, the same method of invoking the SQL statement will cause an error.

Recently done a function of the company, there is such a problem, although this feature is completed, but the other methods of calling the SQL, there are serious errors, although can be different methods of different SQL statements, you can solve the method, but the company's code so, pain another way to solve.

The problem arises from the demand background: This requirement is in the logistics system, this time to the foreground page to display the information to add a field, and to display this field, you have to associate two new tables, so in the foreground page to add a hidden field of input.

This adds an if judgment in the SQL statement in the background

Only when the allocate part is empty can you associate the table in the IF, or query the field, or call the Where condition to judge

In the project, multiple methods call the same SQL statement, and resolve the conflicts by resolving different SQL queries for each method.

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.