Sproc with a webservice
Sproc with a webservice
- Subject: Sproc with a webservice
- From: email@hidden
- Date: Mon, 8 Aug 2005 14:13:29 EDT
I have been using a zip code db with a PHP script to find the nearest zip codes to the one entered. I am trying to turn this into a webservice via MS SQL and WO. Here is the PHP (pretty useful):
//get the nearest salons from a given zip code
function getNearestSalons($code, $limit) {
global $db;
$query = "select z2.*,
truncate(
acos(
( sin(z1.latitude * 0.017453293)*sin(z2.latitude * 0.017453293) )
+
( cos(z1.latitude * 0.017453293) *
cos(z2.latitude * 0.017453293) *
cos((z2.longitude*0.017453293)-(z1.longitude*0.017453293))
)
) * 3956,1) as distance
from US_Zip_Codes z1, Salons z2
where z1.zip = '".$code."'
ORDER BY distance ASC LIMIT 0, ".$limit;
$salons = $db->Execute($query);
return $salons;
}
I have adapted this code to run on MS SQL via Stored Procedure to return the nearest 10 and it works fine. How do I access a stored procedure via WO webservice? Were is some additional documentation on using WO Webservices?
--Mat
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden