RSQLTABLE
Passes a SQL SELECT statement to a predefined database connection. This function would allow SQL statements to generate data for a <TABLE> to be accessed with the LOOKUP() function for dynamic content.
This function will not be used with the <SQL> tag in the <TABLE> tag group as it is an alternative to the <SQL> in the group and allows the run-time definition of a SQL SELECT statement.
Syntax
RSQLTABLE(table:tablename, string)
Arguments
| Argument | Description | Default |
|---|---|---|
| Tablename | Name corresponding to the <NAME> used in a <TABLE>. | None |
| string | SQL SELECT statement. | None |
Results
| Result | Description | |
|---|---|---|
| Return | Size of result set - number of rows | |
| %%RC | One of the following: | |
| 0 | success. | |
| 1 | SQL already defined in <TABLE>. 2 - the SQL statement is not a SELECT statement. -1 - fail. |
|
| 2 | the SQL statement is not a SELECT statement. | |
| -1 | fail. | |
| %%RM | SQL Message. | |
| %%RV | Always set to 0. | |
Examples
| Function Call | Return |
|---|---|
RSQLTABLE(table:developers, "SELECT id, developer FROM developers") |
4 |