Stored Procedure invokation
Posted: Mon 12 Mar 2012 20:36
Yes, I am a newbie, but I have looked through the forums, samples, etc, and I think this should be easy to answer:
How do I invoke the stored procedure shown below. I used the E/F wizard and it found my tables, and the stored procedure and I can see the SP in the ModelBrowser (and all the properties seem fine).
Since it seems to use the E/F mappings, I was hoping I could use some sort of Linq syntax, but even not all I want to do is get the table into an array.
I am stuck after the line:
(yes, you can laugh at this newbie, but if you are serious about support, then maybe you can take this as a data point, and provide a starter example!)
How do I invoke the stored procedure shown below. I used the E/F wizard and it found my tables, and the stored procedure and I can see the SP in the ModelBrowser (and all the properties seem fine).
Since it seems to use the E/F mappings, I was hoping I could use some sort of Linq syntax, but even not all I want to do is get the table into an array.
I am stuck after the line:
Code: Select all
GPLCatalog context = new GPLCatalog();
Code: Select all
CREATE OR REPLACE FUNCTION portal.getBoston(param INT) RETURNS TABLE(idx bigint,
product VARCHAR,
size bigint,
DATE TIMESTAMP,
type VARCHAR,
classification VARCHAR,
distributor VARCHAR,
egpl_date TIMESTAMP,
classification_int INT,
handling VARCHAR,
creator VARCHAR,
datum VARCHAR,
elevation_ft INT,
description VARCHAR,
do_location VARCHAR,
bbox VARCHAR,
uniq_id VARCHAR ) AS $$
SELECT
cat.idx,
cat.product,
cat.size_bytes,
cat.date,
cat.type,
cat.classification,
cat.distributor,
cat.egpl_date,
cat.classification_int,
cat.handling,
cat.creator,
cat.datum,
cat.elevation_ft,
cat.description,
cat.do_location,
cat.bbox,
CAST(cat.uniq_id AS VARCHAR)
FROM
portal.catalog AS cat
WHERE
ST_Intersects(ST_GeomFromText('POLYGON((-70 42,-71 42,-71 41,-70 41,-70 42))', 4326),
cat.location) $$ LANGUAGE SQL;