docs← Back to article

Markdown for LLMs

LDC-Q0002 — The query is missing a clause the language requires

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# LDC-Q0002 — The query is missing a clause the language requires

## What it means

A query is built from clauses in a fixed order: one or more sources first,
an optional filter, then the list of values to return. When the text stops
where the next clause should begin — a source with no variable, a filter
with no condition, no return list at all — the engine reports the exact
spot where it got stuck. Nothing is searched; the shape is wrong before
any data is read.

Read the reported line and column: the token there is the first one the
grammar cannot place. Add the missing clause and keep the rest as written.

## Example

```lawql
select r
```

## Fix

```lawql
from r in rules select r
```

## Engine message

The engine reports this in its own wording:

```text
LDC-Q0002: the query requires at least one from clause (line 1, column 1).
```

## Related

- [Questions to the engine](/constructs/queries/) — what a well-formed query looks like.
- [LDC-Q0001](/diagnostics/LDC-Q0001/) — when the text itself cannot be read.