Mybatis executes the query statement and can query data in plsql, but cannot be found in the program. mybatisplsql

Source: Internet
Author: User

Mybatis executes the query statement and can query data in plsql, but cannot be found in the program. mybatisplsql
When you use mybatis to query statements today, the SQL statements output by the console can be correctly executed in plsql, but no data is found.
The original query statement is as follows: (for confidentiality, the sensitive package name is mosaic .)

This SQL statement can be correctly executed in plsql but cannot be queried.

Solution: Replace "#" in the query condition with "$ ".

The reason is as follows: if MyBatis sees # {}, you will think that you are assigning values to the variables in SQL, just like assigning values to question marks in JDBC programming (automatically adding single quotation marks before and after) That is to say, he regards the string you passed in as not multiple values, but as a large string, so no value can be found)

When MyBatis sees $ {}, it will directly replace it with the variable value without any processing.

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.