result
Methods
object
object(
pReturn):void
Returns a value list to a component process.
result.object() does not retrieve JDito variables, i.e. they can only be returned in the return array if you specify vars.get().
Parameters
anyThe value list to be returned.
Returns
voidExample
result.object(db.array(db.COLUMN, "select RELATION_ID from COMM where COMMID = '" + id + "'"));
preparedQuery
preparedQuery(
pQuery,pAlias?):void
This method returns a query as an object structure.
A prepared query is a predefined statement for a database system.
Unlike normal statements, it does not contain parameter values yet.
Instead, placeholders are passed to the database system. invalid input: '<'iinvalid input: '<'>result.preparedQuery() is static.
If you want to use values from JDito variables, you need to retrieve them using vars.get().
Parameters
anyThe SQL query.
string | number | booleanThe alias to be used for further processing the result.
Returns
voidThrows
May throw an exception.
Example
var condition = "";
var preparedValues = new Array();
var status = vars.getString("$comp.Combobox_Status"); if (status != '') condition += " AND STATUS = "+status;
var phase = vars.getString("$comp.Combobox_Phase"); if (phase != '') condition += " AND PHASE = "+phase;
var volOp = vars.getString("$comp.Combobox_Vol");
var vol = vars.getString("$comp.Edit_Vol");
if (volOp != '' && vol != '') condition += " AND VOLUME "+volOp+vol;
var von = vars.getString("$comp.Edit_von");
if (von != '')
{
condition += " and STARTDATE > ? ";
preparedValues.push([von ,SQLTYPES.TIMESTAMP]);
}
var bis = vars.getString("$comp.Edit_bis");
if (bis != '')
{
condition += " and STARTDATE < ? ";
preparedValues.push([bis ,SQLTYPES.TIMESTAMP]);
}
var pm = vars.getString("$comp.Combobox_ProjManager");
if (pm != '') condition += " AND SALESPROJECTID in (select SALESPROJECT_ID from SPMEMBER where RELATION_ID = '"+pm+"')";
result.preparedQuery(["select count(*) from SALESPROJECT where 1=1 "+condition, preparedValues], "AO_DATEN");
query
query(
pReturn,pAlias?):void
Returns the result of an SQL query to a component process.
This value can have one or more dimensions.
result.query is dynamic, i.e. the names of ADITO variables can be integrated into the query.
The result can be an array, or just a simple string.
Parameters
string | number | booleanThe return value for the component process, checking whether this is a query.
string | number | booleanAlias in which the query is to be run.
Returns
voidExample
result.query("select " + yearfromdate("ENTRYDATE") + " from HISTORY group by " + yearfromdate("ENTRYDATE"), db.getCurrentAlias());
string
string(
pReturn):void
Returns a value to a component process.
JDito variables are not retrieved, i.e. they can only be returned in the return string if you specify vars.get().
The value that is returned is not available in a JavaScript context (therefore void), but for the component.
Parameters
string | number | booleanThe return value for the component process.
Returns
voidExample
result.string(vars.get("$sys.date"));
result.string("Input not valid");