How to return more than one value from a function?

Answer Posted / ravivarman_r

Public Type Income
Wages As Currency
Dividends As Currency
Other As Currency
Total As Currency
End TypeYou can now use this structure as the return
type for a function. In a real situation, the function
would look up your database tables to get the values, but
the return values would be assigned like this:

Function GetIncome() As Income
GetIncome.Wages = 950
GetIncome.Dividends = 570
GetIncome.Other = 52
GetIncome.Total = GetIncome.Wages +
GetIncome.Dividends + GetIncome.Other
End FunctionTo use the function, you could type into
the Immediate Window:

GetIncome().Wages

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of primary key?

535


what is a database lock ? : Sql dba

587


Is there a way to automate sql execution from the command-line, batch job or shell script?

551


What programs use sql?

521


Explain the uses of database trigger.

648






What is the purpose of normalization?

531


How do you select unique values in sql?

494


How does sql*loader handles newline characters in a record? : aql loader

582


What is sql profiling in oracle?

541


What are three advantages to using sql?

545


What is an index in sql with example?

512


How delete all records from table in sql?

548


How many unique keys can a table have?

547


How to change the order of columns in Oracle SQL Plus ?

610


Is oracle and sql same?

565