# Calling Mysql Sproc return no results

**URL:** <https://community.dreamfactory.com/t/calling-mysql-sproc-return-no-results/2255>\
**Category:** REST API\
**Created:** [February 23, 2016, 10:41pm UTC](https://community.dreamfactory.com/t/calling-mysql-sproc-return-no-results/2255 "2016-02-23T22:41:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vargasbo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/vargasbo/32/618_2.png) [@vargasbo](https://community.dreamfactory.com/u/vargasbo)\
**Post date:** [February 23, 2016, 10:41pm UTC](https://community.dreamfactory.com/t/calling-mysql-sproc-return-no-results/2255/1 "2016-02-23T22:41:27Z")

</div>

Hi,

I have the following sp in mysql.

CREATE DEFINER=`dreamfactory`@`%` PROCEDURE `sp_distance_from_clinic`(IN service\_id int, IN orig\_lat float,IN orig\_long float)  
BEGIN

set @bounding\_distance=1;

SELECT  
distinct(location\_id), latitude, longitude,  
((ACOS(SIN(@orig\_lat \* PI() / 180) \* SIN(`latitude` \* PI() / 180)  
+ COS(@orig\_lat \* PI() / 180) \*  
COS(`latitude` \* PI() / 180) \*  
COS((@orig\_long - `longitude`)  
\* PI() / 180)) \* 180 / PI()) \* 60 \* 1.1515)  
AS `distance`  
FROM `filter_service`  
WHERE  
(  
`latitude` BETWEEN (@orig\_lat - @bounding\_distance) AND (@orig\_lat + @bounding\_distance) AND service\_id = service\_id  
AND `longitude` BETWEEN (@orig\_long - @bounding\_distance) AND (@orig\_long + @bounding\_distance) AND service\_id = service\_id  
)  
ORDER BY `distance` ASC  
limit 20;  
END

Can test that it’s working by calling

CALL `dreamfactory`.`sp_distance_from_clinic`(17, -37.869563,144.99604); in the datatabase

When I try to make the call vis the restul IO docs. Here’s my input body…

{  
“params”: [  
{  
“name”: “service\_id”,  
“param\_type”: “IN”,  
“value”: 1  
},  
{  
“name”: “orig\_lat”,  
“param\_type”: “IN”,  
“value”: -37.869563  
},  
{  
“name”: “orig\_long”,  
“param\_type”: “IN”,  
“value”: 144.99604  
}  
]  
}

I’m getting back a 200; but no data.

---

<div class="post-metadata">

**Author:** ![vargasbo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/vargasbo/32/618_2.png) [@vargasbo](https://community.dreamfactory.com/u/vargasbo)\
**Post date:** [February 24, 2016, 6:35pm UTC](https://community.dreamfactory.com/t/calling-mysql-sproc-return-no-results/2255/2 "2016-02-24T18:35:54Z")

</div>

Fixed. Should not have been using “@” for params.
