Why my function is not returning a value using another function as input?

30
January 11, 2019, at 1:40 PM

I have written two functions. The first one utilized a select query and returns a value. While my second function uses the returned value from the first function as input and after certain operation should return its own value. Though I am getting'OK' Message but not getting any output

DELIMITER //
DROP FUNCTION IF EXISTS walkerCubicAreaWeight;
CREATE FUNCTION walkerCubicAreaWeight (WType1 CHAR(5))
RETURNS DECIMAL(5,2)
BEGIN 
DECLARE Cubic_Area_Weight  FLOAT;
SELECT Weight INTO @A FROM imperial_walker_type WHERE WType = WType1;
SELECT Height INTO @B FROM imperial_walker_type WHERE WType = WType1;
SELECT Length INTO @C FROM imperial_walker_type WHERE WType = WType1;
SELECT Width INTO @D FROM imperial_walker_type WHERE WType = WType1;
SET Cubic_Area_Weight = @A/(@B*@C*@D) ;
RETURN Cubic_Area_Weight;
END //
DELIMITER ;
Function 2
DELIMITER //
DROP FUNCTION IF EXISTS walkerFuelCapacity;
CREATE FUNCTION walkerFuelCapacity (WType1 varCHAR(20))
RETURNS DECIMAL(10,2)
BEGIN 
DECLARE Walker_Fuel_Capacity FLOAT;
SELECT OpRange INTO @E FROM imperial_walker_type WHERE WType = WType1;
SET Walker_Fuel_Capacity = walkerCubicAreaWeight(WType1) *@E ;
RETURN Walker_Fuel_Capacity;
END  //
DELIMITER ;

My First function is returning value 0.40. In the second function it should utilize 0.40 and multiple it with oprange(in this case it is 720) and should return 288. However I am getting message OK and no value

READ ALSO
Display results from multiple groupings in one query

Display results from multiple groupings in one query

I have a queries similar to below:

49
How do query and update MySQL hosted on AWS RDS from POSTMAN before sending a post request [on hold]

How do query and update MySQL hosted on AWS RDS from POSTMAN before sending a post request [on hold]

I am trying to query Database to check if the user has a certain restriction before sending a Create/Post request from Postman

48
Isset works on Local server, but it doesn't on live server

Isset works on Local server, but it doesn't on live server

I'm developing website on my local using Xampp v32

66
doubts about write barrier as for java garbage collection

doubts about write barrier as for java garbage collection

I'm reading articles about Java GCI know write barrier is used when reference updated

143