0% found this document useful (0 votes)
87 views

Using SQL Definitions With SQLExec

SQLExec is a function that can execute SQL statements and return a single row of data, making it suitable for certain single-operation tasks. While SQLExec traditionally required hardcoded SQL, it now supports SQL definitions, allowing the SQL statement to be reused by referencing the definition name. This improves performance and maintainability by avoiding duplicate SQL code.

Uploaded by

shery2710
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Using SQL Definitions With SQLExec

SQLExec is a function that can execute SQL statements and return a single row of data, making it suitable for certain single-operation tasks. While SQLExec traditionally required hardcoded SQL, it now supports SQL definitions, allowing the SQL statement to be reused by referencing the definition name. This improves performance and maintainability by avoiding duplicate SQL code.

Uploaded by

shery2710
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Using SQL Definitions with SQLExec

There are times when SQLExec is the appropriate function to use. If you only need a single row,use SQLExec, which can only SELECT a single row of data. If your SQL statement retrieves more than one row of data, SQLExec outputs only the first row to its output variables and discards subsequent rows. This can improve single-operation performance. However, you don't have to hardcode your SQL statement. SQLExec is enhanced to accept the SQL definitions, and the new meta-SQL, so you can reuse your SQL statements. For example, consider the following statement: SQLExec("Update %Table(:1) set %UpdatePairs(:1) where %KeyEqual(:2)", &REC,&FIELD); If you have created a SQL definition with this SQL statement and named it MYUPDATE, you can use it with SQLExec as follows: SQLExec(SQL.MYUPDATE, &REC, &FIELD);

You might also like