skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
thalysjuvenal/advpl-specialist56 installs

embedded-sql

Use when the user needs to write, review, or migrate SQL queries in ADVPL/TLPP using BeginSQL/EndSQL blocks and macro expressions (%table%, %xfilial%, %notDel%, %exp%, %Order%) instead of raw TCQuery string concatenation -- covering INNER/LEFT JOIN patterns, aggregations (SUM/COUNT/GROUP BY/HAVING), subqueries, column type declarations, DML via TCSqlExec, and SQL-injection prevention. Also triggers on Portuguese phrasing like "consulta SQL", "query embutida", "migrar TCQuery para BeginSQL", "escrever SELECT com filial e notDel", or "montar JOIN em ADVPL".

How do I install this agent skill?

npx skills add https://github.com/thalysjuvenal/advpl-specialist --skill embedded-sql
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill provides technical guidelines for writing secure SQL queries in ADVPL/TLPP using Embedded SQL macros. No malicious patterns, obfuscation, or external dependencies were detected.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

Embedded SQL in ADVPL/TLPP

This skill covers writing SQL inside ADVPL/TLPP using BeginSQL ... EndSQL blocks and their special macro expressions -- %table:TABLE% for physical table resolution, %xfilial:TABLE% for branch filtering, %notDel% for logical-deletion filtering, %exp:EXPRESSION% for safe variable binding, and %Order:TABLE% for primary-key ordering. It also covers column type declarations, JOIN and aggregation patterns, subqueries, and migrating legacy TCQuery string-concatenation code to Embedded SQL.

Activate this skill whenever the user is writing a new query, reviewing an existing one for correctness/safety, or converting old concatenated-string SQL to the modern BeginSQL syntax. It also covers the restrictions and gotchas of BeginSQL (no * at line start, always include %notDel% and filial filtering, use GetNextAlias(), close aliases) and when to use TCSqlExec instead for INSERT/UPDATE/DELETE.

It does not cover general native function lookups unrelated to SQL (see protheus-reference), business-process context for which tables/fields to query (see protheus-business), or generating documentation for a routine that happens to contain SQL (see documentation-patterns).

Reference fileRead when
reference.mdAlways -- BeginSQL syntax, macro expressions, JOIN/aggregation/subquery patterns, DML via TCSqlExec, performance tips, and TCQuery migration

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/thalysjuvenal/advpl-specialist/embedded-sql">View embedded-sql on skillZs</a>