Embedded SQL for ADVPL/TLPP

•
63
•

Optimizes SQL query development in TOTVS Protheus by implementing type-safe Embedded SQL blocks and macros.

This skill provides specialized guidance for writing SQL queries within ADVPL and TLPP environments using the modern BeginSQL ... EndSQL syntax. It helps developers move away from error-prone string concatenation by automating table naming, filial filtering, and deletion handling through macros like %table%, %xfilial%, and %notDel%. By utilizing this skill, developers can ensure code readability, prevent SQL injection risks, and simplify result set typing for more robust and maintainable TOTVS Protheus customizations.

주요 기능

01Automated macro expansion for physical table names and branch filtering
02Best practices for migrating legacy TCQuery code to Embedded SQL
03Type-safe column declarations to eliminate manual TCSetField calls
04Standardized patterns for complex JOINs and aggregations in Protheus
05Secure variable binding using %exp% to prevent SQL injection
0663 GitHub stars

사용 사례

01Ensuring database-agnostic table resolution in multi-company environments
02Developing complex multi-table queries with automatic branch and deletion logic
03Refactoring legacy Protheus reports to use readable and maintainable SQL blocks