Skip to main content

Overview

Inserts a new payroll novelty (novedad) into tab_novedades with employee, concept, and value information.

Signature

fun_insert_novedades(
    wano_nom INTEGER,
    wmes_nom INTEGER,
    wper_nom INTEGER,
    wid_emplea INTEGER,
    wid_concepto INTEGER,
    wval_dias_trab INTEGER,
    wval_nomina NUMERIC
) RETURNS VOID

Parameters

wano_nom
INTEGER
required
Payroll year (Primary Key)
wmes_nom
INTEGER
required
Payroll month (Primary Key)
wper_nom
INTEGER
required
Payroll period (Primary Key)
wid_emplea
INTEGER
required
Employee ID (Foreign Key to tab_emplea)
wid_concepto
INTEGER
required
Concept ID (Foreign Key to tab_conceptos)
wval_dias_trab
INTEGER
required
Number of days worked
wval_nomina
NUMERIC
required
Payroll value for this novelty

Returns

VOID (no return value)

Example Usage

-- Insert a novelty
SELECT fun_insert_novedades(
    1987,
    3,
    1,
    1,
    1,
    17,
    4500000
);

-- Insert another novelty record
SELECT fun_insert_novedades(
    2025,
    1,
    1,
    5,
    2,
    15,
    3200000
);

Validation Rules

  • Year, month, and period form a composite primary key
  • Employee ID must exist in tab_emplea
  • Concept ID must exist in tab_conceptos
  • Days worked must be positive
  • Payroll value must be positive

Source

source/func/novedades/fun_insert_novedades.sql

Build docs developers (and LLMs) love