pglogger

functions/GET_PROPERTY_VALUE_DATE.pg_sql

Functions

GET_PROPERTY_VALUE_DATE
Returns the date value of given property.
Private
Just used internally.
Syntax:
GET_PROPERTY_VALUE_DATE (I_PROPERTY_NAME)
Parameters:
ParameterIn/OutData TypeDescription
I_PROPERTY_NAMEINTEXTName of the property.
Return values:
  • DATE Value: of the property.
Copyright:
Thiemo Kellner, 2018 -
Webpage:
https://www.sourceforge.net/projects/pglogger
Version Info:
$Id: GET_PROPERTY_VALUE_DATE.pg_sql 16 2018-06-15 20:23:26Z thiemo $
Additional Info:
  • This function is meant to be private. Its use outside pglogger is very limited at most. That's why it is marked as private eventhough it is visible to the outside. All of this is due to the fact that PostgreSQL 10 and earlier does not support packages.
  • License LGPLv3
TODO:
  • Once PostgreSQL supports packages, integrate this function into one. For the time being, it should get installed within a schema on its own and no execution grants should be given on it.
  • Once HyperSQL supports a license tag, convert the corresponding info tag into one.

Source

001: \echo Start functions/GET_PROPERTY_VALUE_DATE.pg_sql
002: 
003: /** Returns the date value of given property.
004:  *
005:  *  @function GET_PROPERTY_VALUE_DATE
006:  *  @param in text I_PROPERTY_NAME Name of the property.
007:  *  @return date Value of the property.
008:  *  @private
009:  *  @info This function is meant to be private. Its use outside pglogger is
010:  *        very limited at most. That's why it is marked as private eventhough
011:  *        it is visible to the outside. All of this is due to the fact that
012:  *        PostgreSQL 10 and earlier does not support packages.
013:  *  @version $Id: GET_PROPERTY_VALUE_DATE.pg_sql 16 2018-06-15 20:23:26Z thiemo $
014:  *  @todo Once PostgreSQL supports packages, integrate this function into one.
015:  *        For the time being, it should get installed within a schema on its
016:  *        own and no execution grants should be given on it.
017:  *  @todo Once HyperSQL supports a license tag, convert the corresponding
018:  *        info tag into one.
019:  *  @copyright Thiemo Kellner, 2018 -
020:  *  @info License LGPLv3
021:  *  @webpage https://www.sourceforge.net/projects/pglogger
022:  */
023: create or replace function GET_PROPERTY_VALUE_DATE(I_PROPERTY_NAME text)
024:   returns date
025:   language plpgsql
026:   stable
027:   -- Include the hosting schema into search_path so that dblink
028:   -- can find the pglogger objects. There is no need to access
029:   -- objects in other schematas not covered with public.
030:   set search_path = :SCHEMA_NAME, public
031:   as
032: $body$
033:     declare
034:         V_PROPERTY_VALUE date;
035:     begin
036:         select PROPERTY_VALUE_DATE into V_PROPERTY_VALUE
037:           from PROPERTY
038:          where PROPERTY_NAME = I_PROPERTY_NAME;
039:         return V_PROPERTY_VALUE;
040:     end;
041: $body$;
042: 
043: comment on function GET_PROPERTY_VALUE_DATE(I_PROPERTY_NAME text) is 'Returns the date value of given property.
044: $Header: svn+ssh://thiemo@svn.code.sf.net/p/pglogger/code/functions/GET_PROPERTY_VALUE_DATE.pg_sql 16 2018-06-15 20:23:26Z thiemo $';
045: 
046: commit; -- unlike Oracle not all ddl commit implicitly
047: 
048: \echo End functions/GET_PROPERTY_VALUE_DATE.pg_sql


pglogger
Generated by HyperSQL v3.9.8 at Wed Jul 4 07:48:46 2018