Skip to main content

Overview

Deletes a position record from tab_cargos by ID.

Signature

fun_delete_cargos(
    wid_cargo INTEGER
) RETURNS BOOLEAN

Parameters

wid_cargo
INTEGER
required
Position ID to delete

Returns

  • TRUE - Position deleted successfully
  • FALSE - Delete failed

Example Usage

-- Delete a position
SELECT fun_delete_cargos(1);

-- Delete position with ID 5
SELECT fun_delete_cargos(5);

Validation Rules

  • Position ID must exist
  • ID must not exceed 2 digits
  • Cannot delete positions referenced by employees

Error Handling

SQL StateDescription
02000Position ID does not exist
23502Attempted to use NULL value
22003Number is too large
22P02Invalid data format
othersUnknown error

Source

source/func/cargos/fun_delete_cargos.sql

Build docs developers (and LLMs) love