This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||
|
4D v19
4d_function_call
|
|
||
A 4d_function_call can be used to execute a 4D function that returns a value.
The sql_name of the function is preceded by the FN keyword and followed by one or more arithmetic_expression type arguments. The value returned by the function will be of the type defined by the sql_data_type_name passed.
Here is an example using functions to extract from the MOVIES table the number of actors for each movie having at least 7 actors:
C_LONGINT($NrOfActors)
ARRAY TEXT(aMovieTitles;0)
ARRAY LONGINT(aNrActors;0)
$NrOfActors:=7
Begin SQL
SELECT Movie_Title, {FN Find_Nr_Of_Actors(ID) AS NUMERIC}
FROM MOVIES
WHERE {FN Find_Nr_Of_Actors(ID) AS NUMERIC} >= :$NrOfActors
ORDER BY 1
INTO :aMovieTitles; :aNrActors
End SQL
Product: 4D
Theme: Syntax rules
4D SQL Reference ( 4D v19)