Postgres Stored procedures and Entity Developer

Postgres Stored procedures and Entity Developer

Postby TonyV » Tue 04 Oct 2011 18:15

I have an Entity Model for my database. I want to add stored procedures for inserting, updating, and deleting rows from certain tables. I can't get entity developer to list my stored procedures in the Behavior dialog.

Here's a sample of a stored procedure I've written:

Code: Select all
CREATE OR REPLACE FUNCTION "CarSystem"."InsertList"( ListName VARCHAR(50), ListTypeId INT, DomainId INT, Geofencing VARCHAR, Salt VARCHAR(50), WhiteListAlarmClassId INT ) RETURNS VOID AS $$
    INSERT INTO "CarSystem"."Lists"
         ( "ListName", "ListTypeId", "DomainId", "LastUpdate", "Geofencing", "Salt", "WhiteListAlarmClassId" )
    VALUES
        ( $1, $2, $3, NOW(), $4, $5, $6 );
$$ LANGUAGE SQL;


This stored function shows up under "Stored Procedures", but I cannot do anything with it in the model.

What am I doing wrong?

Thanks

Tony
TonyV
 
Posts: 74
Joined: Wed 25 May 2011 15:03

Nevermind

Postby TonyV » Tue 04 Oct 2011 19:19

I've got this working now.

At one point, I had defined the functions as returning a value other than void. To make it work, I had to change the return type on the procedure dialog in Entity Developer to (None). After that, I just had to get the parameters mapped to the properties & it all is fine.

Tony
TonyV
 
Posts: 74
Joined: Wed 25 May 2011 15:03


Return to dotConnect for PostgreSQL