DEV Community

Judy
Judy

Posted on

3 1 1 1 1

Search for records containing a specified string group in multi fields #eg90

A table in an Oracle database has multiple string fields.

Image description

Now we need to input a parameter that contains multiple strings separated by spaces. We need to find the records in the table that contain all these strings in the fields, or those records where the set of fields is a superset of the parameter. For example, when the parameter argA="street John Doe", the calculation result is as follows:

Image description

SPL code:
Image description

A1: Query the database through JDBC.

A2: Split the parameter into a string set by spaces.

Open source SPL source address

Free Download

A3: Filter out records where the difference between the parameter and the field set is an empty set, which is equivalent to finding records where the set of fields is a superset of the parameter.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more