queryP21
ChatGPTUse this when a user asks about Olander’s revenue, sales, prices, margins, stock, inventory, customers, orders, quotes, shipments, invoices, purchasing or suppliers. This includes questions such as “What were our sales last month?” and “Who are our biggest customers?” without naming P21 or the plugin. Retrieve P21 results before giving company-specific facts or figures; never invent or estimate missing figures. Use conversation context to identify the company, and clarify if genuinely ambiguous. General definitions and questions about unrelated companies do not need this tool. First use operation catalog to discover tables, columns, business definitions, join relationships and data-update times; supply tables for focused schema details. Then use operation query with one read-only PostgreSQL SELECT. Joins, nonrecursive SELECT-only CTEs, subqueries, unions, grouping and approved aggregate/date/text functions are supported. Use $1 parameters for values when useful. Results default to 100 rows; request up to 5,000 when needed. A 128 KiB response budget may return fewer complete rows. Read truncated and truncation_reason; narrow filters or select fewer columns to get the needed detail. Calculate totals in SQL, never by adding a result page. No inserts, updates, deletes, schema changes, system tables or arbitrary functions. If data is stale or unavailable, explain the limitation.






