Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | sql(datasourceName, sqlstring, [...]) | Package | sql | Alias | | Pkg Usage | sql(datasourceName, sqlstring, [...]) |
|
Description
Excerpt |
---|
|
Executes the SQL phrase over the defined datasource. |
Executes the SQL phrase over the defined datasource. For selects returning multiple rows, it concatenates the values (for instance you select 2 values and the select returns 4 rows, you will have 2*4 = 8 values). For updates, it returns the update count.
...
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
datasourceName | String | Yes | Datasource name or JNDI name. For Jira database, this is set to "jdbc/JiraDS" by default. | sqlstring | String | Yes | SQL string. |
|
Return Type
String []
Error Handling
...
Code Block |
---|
|
struct Person {
string fName;
string lName;
number age;
}
Person [] results = sql ("datasourceName", "SELECT fName, lName, age FROM person WHERE group_member = 'Y'");
//checks to see if there are results there are skipped for brevity, but
//now you can iterate over and use the dot notation, and 'age' is really a number.
string firstResult = results[0].fName + " " + results[0].lName + " " + results[0].age; |
Note |
---|
To configure the data source, check the SQL data sources configuration chapter. |
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "system_routine" and space = currentSpace ( ) |
---|
labels | array_routines |
---|
|