Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!agate!sunspot.berkeley.edu!ericco From: ericco@ssl.berkeley.edu (Eric C. Olson) Newsgroups: comp.databases Subject: Sybase <--> Unix C Message-ID: Date: 10 Jan 91 07:09:15 GMT Sender: usenet@agate.berkeley.edu (USENET Administrator) Distribution: comp Organization: CEA @ UC Berkeley, Berkeley, CA, USA. Lines: 25 Has anyone had any experience in attaching C code to Sybase? We are running Sybase on SunOS4.0.3. I've had great success in using the Sybase interface for making SQL calls from C programs. However, I have not been able to figure out how to add a C function to Sybase, although I've heard that this is possible. For example, I'd like to create a stored procedure called "SphericalDistance" which would compute the distance between two points on a sphere. The calculation is somewhat complex, so I'd like to have the efficiency of C. If I had this function available in Sybase, then could I make queries like: select * from points where SphericalDistance (points.alpha,points.delta,42.5,-97.4) < 5.0 to locate points that are within 5 degrees of position (42.5, -97.4)? Thanks in advance, Eric -- Eric ericco@ssl.berkeley.edu