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
2 months agoMiesha
2 months agoClaudio
2 months agoRozella
3 months agoJustine
3 months agoBurma
3 months agoDevorah
4 months agoKatlyn
4 months agoDorothy
4 months agoMari
4 months agoGraciela
4 months agoMiles
4 months agoCecil
5 months agoDottie
5 months agoNieves
5 months agoLigia
5 months agoLashon
5 months agoJesse
5 months agoJerry
6 months agoQueen
6 months agoEzekiel
6 months agoTresa
6 months agoChi
6 months agoGlenn
7 months agoGeorgiana
1 month agoIlene
1 month agoIvette
2 months agoRoyce
2 months agoLisbeth
2 months ago