606 lines
24 KiB
Plaintext
606 lines
24 KiB
Plaintext
{<CODEFILE Path="dbdgii.code" Hash="5jaoc9lxdEF8t+d1/ak0sQ==" />}
|
|
#+ DB schema - Constraints Management (dbdgii)
|
|
|
|
--------------------------------------------------------------------------------
|
|
--This code is generated with the template dbapp5.0
|
|
--Warning: Enter your changes within a <BLOCK> or <POINT> section, otherwise they will be lost.
|
|
{<POINT Name="user.comments" Status="MODIFIED">}
|
|
{</POINT>}
|
|
|
|
--------------------------------------------------------------------------------
|
|
--Importing modules
|
|
IMPORT FGL libdbappCore
|
|
|
|
IMPORT FGL dbdgii
|
|
IMPORT FGL dbdgii_events
|
|
{<POINT Name="import" Status="MODIFIED">}
|
|
{</POINT>}
|
|
|
|
--------------------------------------------------------------------------------
|
|
--Database schema
|
|
SCHEMA dbdgii
|
|
|
|
--------------------------------------------------------------------------------
|
|
--Functions
|
|
|
|
{<BLOCK Name="fct.empresastmp_checkTableConstraints" Status="MODIFIED">}
|
|
#+ Check constraints on the "empresastmp" table
|
|
#+
|
|
#+ @param p_data - a row data LIKE empresastmp.*
|
|
#+
|
|
#+ @returnType - INTEGER, STRING
|
|
#+ @return - ERROR_SUCCESS|ERROR_FAILURE, message error
|
|
PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_checkTableConstraints(p_forUpdate, p_data)
|
|
DEFINE p_forUpdate BOOLEAN
|
|
DEFINE p_data RECORD LIKE empresastmp.*
|
|
DEFINE errNo INTEGER
|
|
DEFINE errMsg STRING
|
|
DEFINE l_errNo INTEGER
|
|
DEFINE l_errMsg STRING
|
|
|
|
LET errNo = ERROR_SUCCESS
|
|
INITIALIZE errMsg TO NULL
|
|
|
|
CALL dbdgii_dbxconstraints_empresastmp_rnc_checkColumnConstraints(p_data.rnc) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_razon_social_checkColumnConstraints(p_data.razon_social) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_nombre_empresa_checkColumnConstraints(p_data.nombre_empresa) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_actividad_checkColumnConstraints(p_data.actividad) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_calle_checkColumnConstraints(p_data.calle) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_no_local_checkColumnConstraints(p_data.no_local) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_sector_checkColumnConstraints(p_data.sector) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_telefono_checkColumnConstraints(p_data.telefono) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_fecha_inicio_checkColumnConstraints(p_data.fecha_inicio) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_estado1_checkColumnConstraints(p_data.estado1) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresastmp_estado2_checkColumnConstraints(p_data.estado2) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
|
|
CALL dbdgii_dbxconstraints_empresastmp_pk_empresastmp_checkUniqueConstraint(p_forUpdate, p_data.rnc) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
|
|
RETURN errNo, errMsg
|
|
END FUNCTION
|
|
{</BLOCK>} --fct.empresastmp_checkTableConstraints
|
|
|
|
{<BLOCK Name="fct.empresastmp_pk_empresastmp_checkUniqueConstraint" Status="MODIFIED">}
|
|
#+ Check the primary key uniqueness constraint on the "empresastmp"
|
|
#+
|
|
#+ @param p_key - Primary Key
|
|
#+
|
|
#+ @returnType - INTEGER
|
|
#+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_pk_empresastmp_checkUniqueConstraint(p_forUpdate, p_key)
|
|
DEFINE errNo INTEGER
|
|
DEFINE errMsg STRING
|
|
DEFINE p_forUpdate BOOLEAN
|
|
DEFINE p_key
|
|
RECORD
|
|
empresastmp_rnc LIKE empresastmp.rnc
|
|
END RECORD
|
|
DEFINE l_key
|
|
RECORD
|
|
empresastmp_rnc LIKE empresastmp.rnc
|
|
END RECORD
|
|
DEFINE l_where STRING
|
|
DEFINE l_sqlQuery STRING
|
|
DEFINE l_count INTEGER
|
|
|
|
LET errNo = ERROR_SUCCESS
|
|
INITIALIZE errMsg TO NULL
|
|
|
|
LET l_where = "WHERE empresastmp.rnc = ? "
|
|
|
|
let l_sqlQuery = "SELECT COUNT(*), rnc FROM empresastmp ", l_where, " GROUP BY rnc"
|
|
|
|
PREPARE cur_empresastmp_pk_empresastmp_checkUniqueConstraint FROM l_sqlQuery
|
|
EXECUTE cur_empresastmp_pk_empresastmp_checkUniqueConstraint INTO l_count, l_key.* USING p_key.*
|
|
FREE cur_empresastmp_pk_empresastmp_checkUniqueConstraint
|
|
IF (NOT p_forUpdate AND l_count > 0) OR (p_forUpdate AND l_count > 0 AND p_key.* != l_key.*) THEN
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, ERROR_FAILURE, "\n- rnc: " || ERROR_BAM_00002) RETURNING errNo, errMsg
|
|
END IF
|
|
|
|
RETURN errNo, errMsg
|
|
END FUNCTION
|
|
{</BLOCK>} --fct.empresastmp_pk_empresastmp_checkUniqueConstraint
|
|
|
|
{<BLOCK Name="fct.empresastmp_rnc_checkColumnConstraints" Status="MODIFIED">}
|
|
#+ Check constraints on the "empresastmp.rnc" column
|
|
#+
|
|
#+ @param p_rnc - CHAR(11) -
|
|
#+
|
|
#+ @returnType - INTEGER
|
|
#+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_rnc_checkColumnConstraints(p_rnc)
|
|
DEFINE errNo INTEGER
|
|
DEFINE errMsg STRING
|
|
DEFINE p_rnc LIKE empresastmp.rnc
|
|
|
|
LET errNo = ERROR_SUCCESS
|
|
INITIALIZE errMsg TO NULL
|
|
|
|
IF p_rnc IS NULL THEN
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, ERROR_FAILURE, "\n- rnc: " || ERROR_BAM_00001) RETURNING errNo, errMsg
|
|
END IF
|
|
|
|
RETURN errNo, errMsg
|
|
END FUNCTION
|
|
{</BLOCK>} --fct.empresastmp_rnc_checkColumnConstraints
|
|
|
|
{<BLOCK Name="fct.empresastmp_pk_empresastmp_checkFKConstraint">}
|
|
#+ Check the Foreign Key existence constraint on the "empresastmp"
|
|
#+
|
|
#+ @param p_data - Primary Key
|
|
#+
|
|
#+ @returnType INTEGER, STRING
|
|
#+ @return ERROR_SUCCESS|ERROR_FAILURE, error message
|
|
PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_pk_empresastmp_checkFKConstraint(p_data)
|
|
DEFINE errNo INTEGER
|
|
DEFINE errMsg STRING
|
|
DEFINE p_data
|
|
RECORD
|
|
empresastmp_rnc LIKE empresastmp.rnc
|
|
END RECORD
|
|
DEFINE l_where STRING
|
|
DEFINE l_sqlQuery STRING
|
|
DEFINE l_count INTEGER
|
|
{<POINT Name="fct.empresastmp_pk_empresastmp_checkFKConstraint.define">} {</POINT>}
|
|
|
|
LET errNo = ERROR_SUCCESS
|
|
INITIALIZE errMsg TO NULL
|
|
IF NOT (p_data.empresastmp_rnc IS NULL) THEN
|
|
LET l_where = "WHERE empresastmp.rnc = ? "
|
|
LET l_sqlQuery = "SELECT COUNT(*) FROM empresastmp ", l_where
|
|
{<POINT Name="fct.empresastmp_pk_empresastmp_checkFKConstraint.init">} {</POINT>}
|
|
TRY
|
|
PREPARE cur_empresastmp_pk_empresastmp_checkFKConstraint FROM l_sqlQuery
|
|
EXECUTE cur_empresastmp_pk_empresastmp_checkFKConstraint USING p_data.* INTO l_count
|
|
FREE cur_empresastmp_pk_empresastmp_checkFKConstraint
|
|
IF (l_count == 0) THEN
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, ERROR_FAILURE, "\n- rnc: " || ERROR_BAM_00004) RETURNING errNo, errMsg
|
|
END IF
|
|
CATCH
|
|
LET errNo = ERROR_FAILURE
|
|
END TRY
|
|
END IF
|
|
{<POINT Name="fct.empresastmp_pk_empresastmp_checkFKConstraint.user">} {</POINT>}
|
|
RETURN errNo, errMsg
|
|
END FUNCTION
|
|
{</BLOCK>} --fct.empresastmp_pk_empresastmp_checkFKConstraint
|
|
|
|
{<BLOCK Name="fct.empresas_checkTableConstraints" Status="MODIFIED">}
|
|
#+ Check constraints on the "empresas" table
|
|
#+
|
|
#+ @param p_data - a row data LIKE empresas.*
|
|
#+
|
|
#+ @returnType - INTEGER, STRING
|
|
#+ @return - ERROR_SUCCESS|ERROR_FAILURE, message error
|
|
PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_checkTableConstraints(p_forUpdate, p_data)
|
|
DEFINE p_forUpdate BOOLEAN
|
|
DEFINE p_data RECORD LIKE empresas.*
|
|
DEFINE errNo INTEGER
|
|
DEFINE errMsg STRING
|
|
DEFINE l_errNo INTEGER
|
|
DEFINE l_errMsg STRING
|
|
|
|
LET errNo = ERROR_SUCCESS
|
|
INITIALIZE errMsg TO NULL
|
|
|
|
CALL dbdgii_dbxconstraints_empresas_rnc_checkColumnConstraints(p_data.rnc) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_razon_social_checkColumnConstraints(p_data.razon_social) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_nombre_empresa_checkColumnConstraints(p_data.nombre_empresa) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_actividad_checkColumnConstraints(p_data.actividad) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_calle_checkColumnConstraints(p_data.calle) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_no_local_checkColumnConstraints(p_data.no_local) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_sector_checkColumnConstraints(p_data.sector) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_telefono_checkColumnConstraints(p_data.telefono) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_fecha_inicio_checkColumnConstraints(p_data.fecha_inicio) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_estado1_checkColumnConstraints(p_data.estado1) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
CALL dbdgii_dbxconstraints_empresas_estado2_checkColumnConstraints(p_data.estado2) RETURNING l_errNo, l_errMsg
|
|
CALL libdbapp_utilBuildErrorNoAndErrorMsg(errNo, errMsg, l_errNo, l_errMsg) RETURNING errNo, errMsg
|
|
|
|
RETURN errNo, errMsg
|
|
END FUNCTION
|
|
{</BLOCK>} --fct.empresas_checkTableConstraints
|
|
|
|
--------------------------------------------------------------------------------
|
|
--Add user functions
|
|
{<POINT Name="user.functions" Status="MODIFIED">}
|
|
{</POINT>}
|
|
{<BLOCK Name="fct.empresas_actividad_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.actividad" column
|
|
-- #+
|
|
-- #+ @param p_actividad - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_actividad_checkColumnConstraints(p_actividad)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_actividad LIKE empresas.actividad
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_calle_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.calle" column
|
|
-- #+
|
|
-- #+ @param p_calle - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_calle_checkColumnConstraints(p_calle)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_calle LIKE empresas.calle
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_estado1_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.estado1" column
|
|
-- #+
|
|
-- #+ @param p_estado1 - CHAR(15) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_estado1_checkColumnConstraints(p_estado1)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_estado1 LIKE empresas.estado1
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_estado2_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.estado2" column
|
|
-- #+
|
|
-- #+ @param p_estado2 - CHAR(15) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_estado2_checkColumnConstraints(p_estado2)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_estado2 LIKE empresas.estado2
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_fecha_inicio_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.fecha_inicio" column
|
|
-- #+
|
|
-- #+ @param p_fecha_inicio - CHAR(10) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_fecha_inicio_checkColumnConstraints(p_fecha_inicio)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_fecha_inicio LIKE empresas.fecha_inicio
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_no_local_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.no_local" column
|
|
-- #+
|
|
-- #+ @param p_no_local - CHAR(10) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_no_local_checkColumnConstraints(p_no_local)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_no_local LIKE empresas.no_local
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_nombre_empresa_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.nombre_empresa" column
|
|
-- #+
|
|
-- #+ @param p_nombre_empresa - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_nombre_empresa_checkColumnConstraints(p_nombre_empresa)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_nombre_empresa LIKE empresas.nombre_empresa
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_razon_social_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.razon_social" column
|
|
-- #+
|
|
-- #+ @param p_razon_social - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_razon_social_checkColumnConstraints(p_razon_social)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_razon_social LIKE empresas.razon_social
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_rnc_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.rnc" column
|
|
-- #+
|
|
-- #+ @param p_rnc - CHAR(11) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_rnc_checkColumnConstraints(p_rnc)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_rnc LIKE empresas.rnc
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_sector_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.sector" column
|
|
-- #+
|
|
-- #+ @param p_sector - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_sector_checkColumnConstraints(p_sector)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_sector LIKE empresas.sector
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresas_telefono_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresas.telefono" column
|
|
-- #+
|
|
-- #+ @param p_telefono - CHAR(15) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresas_telefono_checkColumnConstraints(p_telefono)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_telefono LIKE empresas.telefono
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_actividad_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.actividad" column
|
|
-- #+
|
|
-- #+ @param p_actividad - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_actividad_checkColumnConstraints(p_actividad)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_actividad LIKE empresastmp.actividad
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_calle_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.calle" column
|
|
-- #+
|
|
-- #+ @param p_calle - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_calle_checkColumnConstraints(p_calle)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_calle LIKE empresastmp.calle
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_estado1_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.estado1" column
|
|
-- #+
|
|
-- #+ @param p_estado1 - CHAR(15) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_estado1_checkColumnConstraints(p_estado1)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_estado1 LIKE empresastmp.estado1
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_estado2_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.estado2" column
|
|
-- #+
|
|
-- #+ @param p_estado2 - CHAR(15) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_estado2_checkColumnConstraints(p_estado2)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_estado2 LIKE empresastmp.estado2
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_fecha_inicio_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.fecha_inicio" column
|
|
-- #+
|
|
-- #+ @param p_fecha_inicio - CHAR(10) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_fecha_inicio_checkColumnConstraints(p_fecha_inicio)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_fecha_inicio LIKE empresastmp.fecha_inicio
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_no_local_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.no_local" column
|
|
-- #+
|
|
-- #+ @param p_no_local - CHAR(10) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_no_local_checkColumnConstraints(p_no_local)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_no_local LIKE empresastmp.no_local
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_nombre_empresa_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.nombre_empresa" column
|
|
-- #+
|
|
-- #+ @param p_nombre_empresa - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_nombre_empresa_checkColumnConstraints(p_nombre_empresa)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_nombre_empresa LIKE empresastmp.nombre_empresa
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_razon_social_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.razon_social" column
|
|
-- #+
|
|
-- #+ @param p_razon_social - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_razon_social_checkColumnConstraints(p_razon_social)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_razon_social LIKE empresastmp.razon_social
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_sector_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.sector" column
|
|
-- #+
|
|
-- #+ @param p_sector - CHAR(100) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_sector_checkColumnConstraints(p_sector)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_sector LIKE empresastmp.sector
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|
|
{<BLOCK Name="fct.empresastmp_telefono_checkColumnConstraints" Status="LOST">}
|
|
-- #+ Check constraints on the "empresastmp.telefono" column
|
|
-- #+
|
|
-- #+ @param p_telefono - CHAR(15) -
|
|
-- #+
|
|
-- #+ @returnType - INTEGER
|
|
-- #+ @return - ERROR_SUCCESS|ERROR_FAILURE
|
|
-- PUBLIC FUNCTION dbdgii_dbxconstraints_empresastmp_telefono_checkColumnConstraints(p_telefono)
|
|
-- DEFINE errNo INTEGER
|
|
-- DEFINE errMsg STRING
|
|
-- DEFINE p_telefono LIKE empresastmp.telefono
|
|
--
|
|
-- LET errNo = ERROR_SUCCESS
|
|
-- INITIALIZE errMsg TO NULL
|
|
--
|
|
-- RETURN errNo, errMsg
|
|
-- END FUNCTION
|
|
{</BLOCK>}
|