Can't import Postgres stored procedure

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
rgillingham
Posts: 5
Joined: Sun 06 Feb 2005 16:14

Can't import Postgres stored procedure

Post by rgillingham » Mon 10 Jan 2011 13:19

Hi

This applied to Devart and MS Entity models. Why can't I import a stored procedure with the following DDL? It means I have to use Linq or ADO.net to dispatch these.

Thanks

Richard

CREATE OR REPLACE FUNCTION "vhn_external"."public_live_location_list" (
out "location_short_id" char,
out "address_name" varchar,
out "location_type" varchar,
out "line_1" varchar,
out "line_2" varchar,
out "line_3" varchar,
out "town" varchar,
out "county" varchar,
out "postcode" varchar,
out "country_code" varchar,
out "weekday_start" time,
out "weekday_end" time,
out "saturday_open" boolean,
out "saturday_start" time,
out "saturday_end" time,
out "sunday_open" boolean,
out "sunday_start" time,
out "sunday_end" time,
out "email" varchar,
out "phone" varchar
)
RETURNS SETOF record AS
$body$
BEGIN
RETURN QUERY
SELECT etc etc
END;
$body$
LANGUAGE 'plpgsql'
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
COST 100 ROWS 1000;

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 11 Jan 2011 15:42

Could you please specify the exact error message and your steps before encountering the error?

rgillingham
Posts: 5
Joined: Sun 06 Feb 2005 16:14

Post by rgillingham » Tue 11 Jan 2011 18:48

It's simple to create

Try and drop the stored procedure onto the design surface

For Entity Framework (EDMX) and we get a message saying that we cannot import a composable function

For Entity Developer (EDML) (postgres) and I get

"Cannot create model object for 'public_location_list'. Cannot create method for storage function 'public_location_list' that can be composed. Only stored procedures may be mapped.

Richard

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 12 Jan 2011 10:11

Take a look at the workaround I have provided in this post.
Please let us know if anything goes wrong.

Post Reply