This commit is contained in:
@@ -45,7 +45,30 @@ TODO: //MIGRATE_OUTSTANDING comment tag
|
|||||||
The tag will contain the description for each
|
The tag will contain the description for each
|
||||||
............................................................
|
............................................................
|
||||||
|
|
||||||
|
****
|
||||||
|
CREATE OR REPLACE FUNCTION PUBLIC.AYGETNAME(IN AYOBJECTID bigint, IN AYOBJECTTYPE integer) RETURNS text AS $BODY$
|
||||||
|
DECLARE
|
||||||
|
aytable TEXT DEFAULT '';
|
||||||
|
aynamecolumn TEXT DEFAULT 'name';
|
||||||
|
returnstr TEXT DEFAULT '';
|
||||||
|
BEGIN
|
||||||
|
-- Object type to table name
|
||||||
|
case ayobjecttype
|
||||||
|
when 8 then
|
||||||
|
aytable = 'acustomer';
|
||||||
|
when 2 then
|
||||||
|
aytable = 'awidget';
|
||||||
|
when 33 then
|
||||||
|
aytable = 'avendor';
|
||||||
|
else
|
||||||
|
-- unknown or not supported just return default string
|
||||||
|
RETURN '-';
|
||||||
|
end case;
|
||||||
|
EXECUTE format('SELECT %I FROM %I WHERE id = %L', aynamecolumn, aytable, ayobjectid) INTO returnstr;
|
||||||
|
RETURN returnstr;
|
||||||
|
END;
|
||||||
|
$BODY$ LANGUAGE PLPGSQL STABLE
|
||||||
|
****
|
||||||
|
|
||||||
currently doing: Reminder - was regular non followup schedulemarker, Review - was follow up schedule marker
|
currently doing: Reminder - was regular non followup schedulemarker, Review - was follow up schedule marker
|
||||||
|
|
||||||
@@ -113,6 +136,11 @@ Preliminary order to get the ball rolling, these are the easiest starting point:
|
|||||||
When do this need to go back and do a bunch of //MIGRATE_OUTSTANDING
|
When do this need to go back and do a bunch of //MIGRATE_OUTSTANDING
|
||||||
i.e. show all
|
i.e. show all
|
||||||
|
|
||||||
|
INVENTORY AND BALANCE STUFF
|
||||||
|
Best implemented as a stored procedure?
|
||||||
|
this example is exactly a bank balance
|
||||||
|
https://www.postgresqltutorial.com/postgresql-create-procedure/
|
||||||
|
|
||||||
|
|
||||||
# V7 objects now TAGS, the following objects are imported as tags and suffixed with a period and then short versions of the object type in the tag name
|
# V7 objects now TAGS, the following objects are imported as tags and suffixed with a period and then short versions of the object type in the tag name
|
||||||
- Region
|
- Region
|
||||||
|
|||||||
Reference in New Issue
Block a user