docs← Back to article

Markdown for LLMs

LDC-Q2002 — The query reads from a computation that was never declared

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

Download this articlePlain text ↗
# LDC-Q2002 — The query reads from a computation that was never declared

## What it means

A query can first run a named computation over a package and a case, then
read the resulting document as if it were a relation. The reading source
names that computation, so the engine can check the name against the
computations the query declares. A name with no matching declaration stops
the query before any row is read.

Either declare the computation under that name at the head of the query,
or fix the source to name the computation that is actually declared.

## Example

```lawql
from r in m.rows select r
```

## Fix

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

## Engine message

The engine reports this in its own wording:

```text
LDC-Q2002: materialization 'm' is not declared.
```

## Related

- [Questions to the engine](/constructs/queries/) — how a query declares a computation.
- [LDC-Q3001](/diagnostics/LDC-Q3001/) — the cap a declared computation requires.