How do I use pass data to/from stored procedure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rcamarda

    How do I use pass data to/from stored procedure

    Hello,
    I read an article on how to use Yahoos API to GeoCode addresses. Based
    on the article I created a stored procedure that is used as follows:
    SPGeocode '2121 15st north' ,'arlington' ,'va' ,'warehouse-test'
    Returns:
    Latitude Longitude GeoCodedCity GeoCodedState GeoCodedCountry
    Precision Warning
    ----------- ---------- ------------- ------------- ---------------
    --------------- --------
    38.889538 -77.08461 ARLINGTON VA US
    Precision Good No Error



    It returns Latitude and Longitude and other information. Works great.
    In conjunction with Haversine formula, I can compute the distance
    between two locations if I know the Lat and Long of the two points.
    This can start to answer questions like "How many students do we have
    within a 10 mile radius of Location X?"
    (Marketing should go nuts over this :)

    My question is how can i use my data from a table and pass it to the
    SPGeocode via a select statement?
    The table I would use is:

    CREATE TABLE "dbo"."D_BI_Stu dent"
    (
    "STUDENT_ADDRES S1" VARCHAR(50) NULL,
    "STUDENT_ADDRES S2" VARCHAR(50) NULL,
    "STUDENT_CI TY" VARCHAR(50) NULL,
    "STUDENT_ST ATE" VARCHAR(10) NULL,
    "STUDENT_ZI P" VARCHAR(10) NULL
    )
    ;
    This is so new to me, I am not even sure what to search.
    TIA
    Rob

Working...