What is the correct syntax to define and call a function in Database?
A)

B)

C)

D)

Keyword to ad function in Dataweave transformation is fun. Hence option 2 and 4 are invalid. Also parameters needs to be passed exactly in same order as defined in function definition. Hence correct answer is'
fun addKV( object: Object, key: String, value: Any) =
object ++ {(key):(value)}
---
addKV ( {'hello': 'world'}, 'hola', 'mundo' )
MuleSoft Documentation Reference : https://docs.mulesoft.com/mule-runtime/4.3/dataweave-functions
DataWeave Function Definition Syntax
To define a function in DataWeave use the following syntax:
fun myFunction(param1, param2, ...) = <code to execute>
The fun keyword starts the definition of a function.
myFunction is the name you define for the function.
Function names must be valid identifiers.
(param1, param2, ... , paramn) represents the parameters that your function accepts.
You can specify from zero to any number of parameters, separated by commas (,) and enclosed in parentheses.
The = sign marks the beginning of the code block to execute when the function is called.
<code to execute> represents the actual code that you define for your function.
Pamela
4 months agoMiesha
4 months agoClaudio
4 months agoRozella
4 months agoJustine
4 months agoBurma
5 months agoDevorah
5 months agoKatlyn
5 months agoDorothy
5 months agoMari
6 months agoGraciela
6 months agoMiles
6 months agoCecil
6 months agoDottie
6 months agoNieves
6 months agoLigia
7 months agoLashon
7 months agoJesse
7 months agoJerry
7 months agoQueen
7 months agoEzekiel
8 months agoTresa
8 months agoChi
8 months agoGlenn
8 months agoGeorgiana
3 months agoIlene
3 months agoIvette
3 months agoRoyce
3 months agoLisbeth
3 months ago