Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Auszug
hiddentrue

Nuclos database objects: views, functions, procedures, nuclet transfer, order, delete statement, CA_ functions, PostgreSQL/Oracle.

globe with meridians Language: Deutsch · English

hammer and wrench Database objects

Custom views, functions and procedures as part of a nuclet – incl. order/delete statement and the CA_ convention.

Status
colourPurple
titleHow-to
Status
colourBlue
titleApplication developer
Status
colourGreen
titleUpdated: Jul 2026
Status
colourGrey
titleapplies to Nuclos 4.2026.x

Panel
bgColor#F4F5F7

On this page

Inhalt
maxLevel2
minLevel2

What are database objects?

Database objects configure custom views, functions, procedures etc. as part of a nuclet – they are included in a nuclet transfer. Typical uses: DB functions for calculated attributes, views for virtual business objects, or packages for jobs.

Menu: Configuration → Database → Database objects

Info
titleDependencies under PostgreSQL

The order field (since Nuclos 3.10) defines dependencies: on change/transfer all objects are dropped in descending and recreated in ascending order. This requires a delete statement per object.

Creating an object

First create a database object with a suitable type: function, index, package, package body, procedure, view. A separate object can be stored per supported database system; the one for the active system is used.

Warnung
titleNaming convention

If a function is to serve a calculated attribute, its name must start with CA_ – only such objects appear for selection in the BO wizard.

Creating a database object and assigning a type.

Entering the source code

In the database object source (Configuration → Database → Database object sources) you enter the DB-specific code. If active is set, the object is created/updated on save. Nuclos prepends the schema/DB name automatically – do not add it yourself. The delete statement runs when the record is deleted.

The „database object source“ screen.

Function body (PostgreSQL)

Codeblock
languagesql
CREATE OR REPLACE FUNCTION <name>(imoduleid numeric)
  RETURNS numeric AS
$BODY$
  
$BODY$
  LANGUAGE 'plpgsql' VOLATILE
  COST 100;v

Example

Codeblock
languagesql
CREATE OR REPLACE FUNCTION GET_NEXT_NUMBER(imoduleid numeric)
  RETURNS numeric AS
$BODY$
DECLARE
  iresult NUMERIC (20, 0);
BEGIN
      SELECT intnaechstenummer INTO iresult
      FROM t_eo_nummern
      WHERE strbezeichnung = 'Kundennummer';   
  
   RETURN iresult;
END;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE
  COST 100;

Delete statement (PostgreSQL)

Codeblock
languagesql
DROP FUNCTION IF EXISTS GET_NEXT_NUMBER(imoduleid numeric) CASCADE
Warnung
titleCaution

On PostgreSQL a delete statement must always be provided.

Related pages

bar chart Calculated attributes


CA_ functions.

Open →

file cabinet Data sources


Data sources.

Open →