@functions
@functions
Character,
Date,
Long text,
or Number.
By default, the type of an object is derived from the column type. To change this
value to another, click the appropriate option in the list box.
Tip: In a universe, several objects can have the same name provided that they all
belong to different classes.
In the SQL editor illustrated on the previous page, the syntax shown is for the
Select statement of the object Revenue. This syntax reads as follows:
sum(Invoice_Line.days*Invoice_Line.nb_guests*Service.price)
The @ functions
DESIGNER provides a number of functions for the SQL definition of objects. By
using these functions, you make the definition of objects dynamic as well as
database-independent. Referred to as @ functions, these functions are as follows:
1• @Aggregate_Aware
2• @Prompt
3• @Script
4• @Select
5• @Variable
6• @Where
1.@Aggregate_Aware:
This function is described in Chapter 6, “Setting Up Aggregate Awareness in a
Universe” on page 195.
2.@Prompt:
The @Prompt function lets you create an interactive object. In the Query Panel,
this type of object causes a message to appear. This message prompts the end user
to enter a specific value.
@Prompt('message','type',
[{'value1'[,'value2',...]},class_nameobject_name'],mono/multi,free/constrained) Creates an
object that prompts users to enter a specific value.
For example, you can create an interactive object that prompts the end user to
enter the name of the country for which he or she wants information.
The syntax of the function is as follows:
@Prompt(‘message’,[‘type’],[lov],[MONO|MULTI],[FREE|CONSTRAIN])
where
3.@Script:
This function recovers the results of Visual Basic for Applications macro (VBA
macro).
@Script('variable','type','script name') Recovers the results of an executed script created in the
BusinessObjects module.
The syntax for this function is as follows:
@Script(‘var_name’, ‘vartype’, ‘script_name’)
where
• var_name is a variable name declared in the script. This name enables the
results of the executed script to be recovered in the SQL definition of an object.
This name must thus be identical in both the VBA macro and in the SQL
definition of the object.
• vartype is the variable type declared in the VBA macro: ‘A’ for alphanumeric,
‘D’ for date, ‘N’ for numeric.
• script_name is the name of the VBA macro to be executed. Script files are
located in the Scripts folder.
Note: The second argument is optional; however, if you omit it you must still
include commas as separators.
4.@Select:
This function enables you to re-use the Select statement of an existing object.
The syntax of this function is the following:
@Select(classname\objectname) Inserts the SQL Select definition of a previously defined object.
@Select(Classname\Objectname)
Thus, the object called Select user-defined city shown above references an object
called User defined city in its Select statement and Country Id in its Where clause.
5.@Variable:
The @Variable is used to reference the value assigned to a name or variable. Its
syntax is as follows:
@Variable('myname') References the value assigned to a prompt or variable.
@Variable(‘myname’)
where myname can be one of the following:
• The text of an interactive object previously created with the @Prompt function;
i.e. the first argument entered in the @Prompt function.
• A Business Objects products system variable such as BOUSER or BOPASS.
These variables represent respectively the user name and password forming
the user identification. System variables also exist for the connection to the
RDBMS. For information on such variables, refer to the BusinessObjects
Database Guide for your RDBMS.
The object below is defined with the @Variable function, which references the
system variable BOUSER. In the Query Panel, this object retrieves customers
having a first name with a value equal to the BOUSER value.
6.@Where:
This function lets you re-use the Where clause of an existing object.
The following is the syntax:
@Where(classname\objectname)
Inserts the SQL Where definition of a previously defined object.
@Where(Classname\Objectname)
Thus, the object called Select country from region shown above references an
object called Country Id in its Where clause.