What problem does it solve?
This Skill helps developers write SQL queries directly within ADVPL/TLPP code, replacing error-prone string concatenation with a safer, more readable, and maintainable approach using BeginSQL blocks and special macros.
Core Features & Use Cases
- Safe SQL Querying: Use
BeginSQL with macros like %table%, %xfilial%, %notDel%, and %exp% for secure and efficient data retrieval.
- Readability & Maintainability: Write SQL in a natural, readable format, making code easier to understand and modify.
- Use Case: When developing a Protheus report that needs to join tables SE2 (Expenses) and SA2 (Suppliers), use this Skill to construct a robust
BeginSQL query that correctly handles filial filtering, logical deletions, and variable binding.
Quick Start
Use the embedded-sql skill to generate a BeginSQL block for selecting data from the SA1 table, filtering by filial and non-deleted records.