Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL contains EL expressions, such as #{id}, how to parse them #2002

Closed
SkyLight1234 opened this issue May 6, 2024 · 4 comments
Closed

SQL contains EL expressions, such as #{id}, how to parse them #2002

SkyLight1234 opened this issue May 6, 2024 · 4 comments

Comments

@SkyLight1234
Copy link

SQL contains EL expressions, such as #{id}, how to parse them

@manticore-projects
Copy link
Contributor

Greetings.

For getting help you would need to provide much more information:

  1. what is an EL expression
  2. what Database System
  3. what is the Grammar/Specification for this particular entity (since its not standard SQL)

@SkyLight1234
Copy link
Author

I need to parse a sql statement, such as: select * from good_spu where store_id=#{storeId}, ‘#{storeId}’ is a parameter placeholder, and the condition cannot be parsed in the execution code

@manticore-projects
Copy link
Contributor

This is not really SQL, but an SQL Template.
You have 2 options:

  1. replace the Template Variables by yourself (using the template engine) and the parse the filled/rewritten SQL result, e.g.:
select * from good_spu where store_id=:storeId, :storeId
  1. provide or sponsor an implementation for parsing those template variables.

@manticore-projects
Copy link
Contributor

Explained and not further questions have been asked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants