sql

Description

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.

Parameters

Return Type

String []

Error Handling

Throws SqlException

Examples

Example 1

string [] results = sql("datasourceName", "select project_id from project_lookaside where project_code='" + project + "'"); //Note: this example is open to SQL injection if 'project' is not the standard issue project (derived) but a variable supplied by user. Take care.

Example 2