summaryrefslogtreecommitdiff
path: root/sql/modules/Entity.sql
diff options
context:
space:
mode:
authoraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2008-08-21 20:05:54 +0000
committeraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2008-08-21 20:05:54 +0000
commiteb497f995016bf851d68ee831cd15228ba15c4c4 (patch)
tree9c48b4f25fc7334a0f3e619695df487ed6399797 /sql/modules/Entity.sql
parent767f00372726c561e86f3b57bf3437ae175dbb0b (diff)
Further fixes to Recon and Admin. In testing.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2296 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql/modules/Entity.sql')
-rw-r--r--sql/modules/Entity.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/modules/Entity.sql b/sql/modules/Entity.sql
index ba98c62a..9c742e4b 100644
--- a/sql/modules/Entity.sql
+++ b/sql/modules/Entity.sql
@@ -37,4 +37,24 @@ CREATE OR REPLACE FUNCTION entity_save(
$$ language 'plpgsql';
+
+CREATE OR REPLACE FUNCTION entity__get_entity (
+ in_entity_id int
+) RETURNS setof entity AS $$
+
+declare
+ v_row entity;
+BEGIN
+ SELECT * INTO v_row FROM entity WHERE id = in_entity_id;
+ IF NOT FOUND THEN
+ raise exception "Could not find entity with ID %", in_entity_id;
+ ELSE
+ return next v_row;
+ END IF;
+END;
+
+$$ language plpgsql;
+
+
+
commit;