Examples using stored procedures
In the following example, there is a stored procedure named DoSalaryIncrease with the following parameters:
Employee ID - parm1 - In
Merit Increase (%) - parm2 - Out
Salary - parm3 - In / Out
Effective Date - parm4 - Out
Using the DBLOOKUP function, an example of the syntax used to call DoSalaryIncrease would be:
DBLOOKUP
("call DoSalaryIncrease("
+ EmpID:.:PayrollFile
+ ",?,?/"
+ Salary:.:PayrollFile + ",?)", "AdminDb.mdq", "HR_DB")
If EmpID has a value of SM01930 and Salary has a value of 42,750, the call syntax would expand to:
call DoSalaryIncrease (SM01930, ?, ?/42750, ?)
The output from this call is a single text item in which each field is delimited by the pipe character (|). In this example, there will be three fields in the output-one for each question mark character (?) placeholder. If you do not want to use all of the output parameters, you can use any other character in place of the question mark character. For example, if you did not use the EffectiveDate (parm4), the call could be changed to:
DBLOOKUP
("call DoSalaryIncrease ("+ EmpID:.:PayrollFile
+ ",?,?/" + Salary:.:PayrollFile + ",X)",
"AdminDb.mdq", "HR_DB")
Once again, if EmpID has a value of SM01930 and Salary has a value of 42,750, the call syntax would expand to:
call DoSalaryIncrease (SM01930, ?, ?/42750, X)
In this example, the EffectiveDate (parm4) would not be returned.