EmbeddedSQLExpression
✖
EmbeddedSQLExpression
represents an SQL expression to be evaluated verbatim within an EntityFunction object.
represents an SQL expression string template with arguments provided by args.
Details

- EmbeddedSQLExpression can be used to embed literal SQL expressions within an EntityFunction.
- In the form EmbeddedSQLExpression[template,args], args can either be a list or an association with string keys. If it is a list, the template slots in template are taken to be positional. If args is an association, the slots in template are taken to be named. The syntax for template is the same as the one used in StringTemplate.
- In EmbeddedSQLExpression[template,args], the values in args can take the following forms:
-
n,"string",DateObject[…],… literal values a+b,Sin[x],… compilable expressions x["prop"] properties bound to the surrounding EntityFunction EntityValue[…],EntityClass[…],… full symbolic queries - EmbeddedSQLExpression[template][arg1,arg2,…] is equivalent to EmbeddedSQLExpression[template,{arg1,arg2,…}].
- EmbeddedSQLExpression[template][association] is equivalent to EmbeddedSQLExpression[template,association].
Examples
Basic Examples (1)Summary of the most common use cases
Register a RelationalDatabase-backed EntityStore:

https://wolfram.com/xid/0vu8tibv6e9755kiqhe-ixolk8

EmbeddedSQLExpression can be used to evaluate any SQL expression:

https://wolfram.com/xid/0vu8tibv6e9755kiqhe-w32rzr

Use the second argument to bind literal values:

https://wolfram.com/xid/0vu8tibv6e9755kiqhe-8r7bji


https://wolfram.com/xid/0vu8tibv6e9755kiqhe-mx2710

Bind properties of the outer query:

https://wolfram.com/xid/0vu8tibv6e9755kiqhe-9kolyd

Bind a subquery (possibly correlated):

https://wolfram.com/xid/0vu8tibv6e9755kiqhe-kh0wi5

Wolfram Research (2020), EmbeddedSQLExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html.
Text
Wolfram Research (2020), EmbeddedSQLExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html.
Wolfram Research (2020), EmbeddedSQLExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html.
CMS
Wolfram Language. 2020. "EmbeddedSQLExpression." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html.
Wolfram Language. 2020. "EmbeddedSQLExpression." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html.
APA
Wolfram Language. (2020). EmbeddedSQLExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html
Wolfram Language. (2020). EmbeddedSQLExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html
BibTeX
@misc{reference.wolfram_2025_embeddedsqlexpression, author="Wolfram Research", title="{EmbeddedSQLExpression}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html}", note=[Accessed: 30-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_embeddedsqlexpression, organization={Wolfram Research}, title={EmbeddedSQLExpression}, year={2020}, url={https://reference.wolfram.com/language/ref/EmbeddedSQLExpression.html}, note=[Accessed: 30-April-2025
]}