Question: Given the following function definition: create function dbo.MyFunction ( @num1 decimal(16,4), @code char(1) ) returns decimal(16,4) as begin declare @returnNum decimal(16,4) if (@code = A)

Given the following function definition:

create function dbo.MyFunction

(

@num1 decimal(16,4),

@code char(1)

) returns decimal(16,4)

as

begin

declare @returnNum decimal(16,4)

if (@code = A)

begin

set @returnnum = num1 * .50

end

else if (@code = B)

begin

set @returnnum = num1 * .25

end

else

set @returnnum = num1 (num1 * .50)

return @returnNum

end

GO

What is the output of the query below? (choose one) (10 pts)

Select dbo.MyFunction(20,B) , dbo.MyFunction(30, C)

Error occurs when query is executed

10, 15

5 ,30

5, 15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!