pglogger

functions/GET_PROPERTY_VALUE_NUMBER.pg_sql

Functions

GET_PROPERTY_VALUE_NUMBER
Returns the numeric value of given property.
Private
Just used internally.
Syntax:
GET_PROPERTY_VALUE_NUMBER (I_PROPERTY_NAME)
Parameters:
ParameterIn/OutData TypeDescription
I_PROPERTY_NAMEINTEXTName of the property.
Return values:
  • NUMERIC Value: of the property.
Copyright:
Thiemo Kellner, 2018 -
Webpage:
https://www.sourceforge.net/projects/pglogger
Version Info:
$Id: GET_PROPERTY_VALUE_NUMBER.pg_sql 2 2018-03-21 18:33:44Z 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_NUMBER.pg_sql
002: 
003: /** Returns the numeric value of given property.
004:  *
005:  *  @function GET_PROPERTY_VALUE_NUMBER
006:  *  @param in text I_PROPERTY_NAME Name of the property.
007:  *  @return numeric 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_NUMBER.pg_sql 2 2018-03-21 18:33:44Z
014: thiemo $
015:  *  @todo Once PostgreSQL supports packages, integrate this function into one.
016:  *        For the time being, it should get installed within a schema on its
017:  *        own and no execution grants should be given on it.
018:  *  @todo Once HyperSQL supports a license tag, convert the corresponding
019:  *        info tag into one.
020:  *  @copyright Thiemo Kellner, 2018 -
021:  *  @info License LGPLv3
022:  *  @webpage https://www.sourceforge.net/projects/pglogger
023:  */
024: create or replace function GET_PROPERTY_VALUE_NUMBER(I_PROPERTY_NAME text)
025:   returns numeric
026:   language plpgsql
027:   stable
028:   -- Include the hosting schema into search_path so that dblink
029:   -- can find the pglogger objects. There is no need to access
030:   -- objects in other schematas not covered with public.
031:   set search_path = :SCHEMA_NAME, public
032:   as
033: $body$
034:     declare
035:         V_PROPERTY_VALUE numeric;
036:     begin
037:         select PROPERTY_VALUE_NUMBER into V_PROPERTY_VALUE
038:           from PROPERTY
039:          where PROPERTY_NAME = I_PROPERTY_NAME;
040:         return V_PROPERTY_VALUE;
041:     end;
042: $body$;
043: 
044: comment on function GET_PROPERTY_VALUE_NUMBER(I_PROPERTY_NAME text) is 'Returns
045: the numeric value of given property.
046: $Header: svn+ssh://thiemo@svn.code.sf.net/p/pglogger/code/functions/GET_PROPERTY
047: _VALUE_NUMBER.pg_sql 2 2018-03-21 18:33:44Z thiemo $';
048: 
049: commit; -- unlike Oracle not all ddl commit implicitly
050: 
051: \echo End functions/GET_PROPERTY_VALUE_NUMBER.pg_sql


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