/* vim: set filetype=c fenc=utf-8 ts=4 sw=4: * * dagreater_pg.pgc * * Description: dagreater_pg.c is an API file for the PostgreSQL Database in GREAT-ER * * Authors: * Harjo Korte * Andre Heinecke * Bjoern Ricks * TechniData AG/Markdorf * * Copyright: * Copyright (C) 2011 by Intevation GmbH * Copyright (C) 2003 TechniData AG, Markdorf, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software */ /*! \file dagreater_pg.c \brief dagreater_pg.c is an API file for the PostgreSQL Database in GREAT-ER 2. With dagreater_pg.c it is possible to connect to database once per Session. If you want more than one connection at one time you have to use gdagreater_pg.c directly. \n This Module calls the gdagreater_pg-functions to handle single database. \n It was worked out from the api file dagreater.c which was the solution for the Oracle database made by Technidata. */ /************************************************************************** * DEFINE COMMANDS **************************************************************************/ /************************************************************************** * INCLUDE COMMANDS **************************************************************************/ /* system includes */ #include #include #include #include #include /* PostgreSQL includes */ EXEC SQL INCLUDE sqlca; /* constants for GREAT-ER API */ #include "dagreater_pg.h" /* data types for GREAT-ER API */ #include "datypes_pg.h" /* export of GREAT-ER API functions */ /* single-session */ #include "daexplib_pg.h" /* multi-session */ #include "gdaexplib_pg.h" /************************************************************************** * Global variables **************************************************************************/ DA_T_db_user_info vg_db_user_info; /* information about currently * login in database user */ DA_T_acc_right_info vg_acc_rght_info; /* access right info about last * access master object (subst., * env.param., mod.param.,...) */ static DB_con *con; /* global pointer var. for db-connection */ /************************************************************************** * LIBRARY INTERAL (LOCAL) FUNCTIONS **************************************************************************/ /********************************************************************* * Name : lda_set_db_errinfo * * Issue : 27-JUN-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Fill errinfo struct with information about last occured * oracle error * * * Parameter: vp_modulename (i) name of module in which error occured * vp_errinfo (o) STRUCT filled with error information * * Return : ---- * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \internal \author T.V. - TechniData AG/Markdorf \date 27-JUN-2002 \brief Fill errinfo struct with information about last occured postgres error. \param vp_modulname name of module in which error occured. \return --- */ void lda_set_db_errinfo(char *vp_modulename, DA_T_errinfo *vp_errinfo, int errln) { #if DEBUG_MODE_ON == 1 DA_T_MODULE_NAME v_module = "lda_set_db_errinfo"; #endif /* ----------------- * * start of function * ----------------- */ #if DEBUG_MODE_ON == 1 /* debug output */ lda_write_debug_info(1, v_module, NULL, NULL, NULL, NULL, NULL, NULL); #endif /* set error type = Postgres */ vp_errinfo->err_type = DA_ERRTYP_PG; /* set Postgres error number */ vp_errinfo->err_no = sqlca.sqlcode; /* set error parameter by error-line and module in which error occured */ sprintf (vp_errinfo->err_param,"%s - LINE: %d", vp_modulename, errln); } /************************************************************************** * PUBLIC FUNCTIONS, INTERFACE FUNCTIONS **************************************************************************/ /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * GENERAL FUNCTIONS * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /*! \brief Connect to GREAT-ER database (create DB session). Calls gda_db_connect to get db connection(). \author H.Korte - Intevation \date 09-SEP-2003 \param vp_userid user-id of database user \param vp_passwd user-passwd of database user \param vp_connect_descr database connect string \return DA_SUCCESS \n DA_FAIL. */ int da_db_connect(char *vp_userid, char *vp_passwd, char *vp_connect_descr, DA_T_errinfo *vp_errinfo) { con = gda_db_connect(vp_userid, vp_passwd, vp_connect_descr, vp_errinfo); if(!con) return(DA_FAIL); return(DA_SUCCESS); } /********************************************************************* * Name : da_db_connect_admin * * Issue : 28-JAN-2003 - S.F. - TechniData AG/Markdorf * * Purpose : Connect to GREAT-ER database (create DB session) * After connect check if connected user is a valid * GREAT-ER user (check USER_TAB) and if the user is * the GREAT-ER table owner. In case user is a valid * GREAT-ER user, then set global "vg_db_user_info" with * information about connected database user. In case * user is not the GREAT-ER table owner, then set flag * vp_admin to DA_NO. * * * Parameter: vp_userid (i) user-id of database user * vp_passwd (i) user-passwd of database user * vp_connect_descr (i) database connect string * vp_admin (o) database admin (table owner) flag * vp_errinfo (o) error info, just filled when * error occurs (return=FAIL). * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Connect to GREAT-ER database (create DB session). Calls gda_db_connect_admin to get db connection(). \author H.Korte - Intevation \date 09-SEP-2003 \param vp_userid user-id of database user \param vp_passwd user-passwd of database user \param vp_connect_descr database connect string \return DA_SUCCESS \n DA_FAIL. */ int da_db_connect_admin(char *vp_userid, char *vp_passwd, char *vp_connect_descr, int *vp_admin, DA_T_errinfo *vp_errinfo) { con = gda_db_connect_admin(vp_userid, vp_passwd, vp_connect_descr, vp_admin, vp_errinfo); if(!con) return(DA_FAIL); return(DA_SUCCESS); } /********************************************************************* * Name : da_db_disconnect * * Issue : 16-SEPT-2003 - H.Korte - Intevation * * Purpose : Disconnect from GREAT-ER database (close DB session) * DON'T save last open transaction * * Parameter: vp_errinfo (o) error info, just filled when * error occurs (return=FAIL). * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Disconnect from Database. Calls gda_db_disconnect() to disconnect db connection. \author H.Korte - Intevation \date 09-SEP-2003 \param --- \return DA_SUCCESS \n DA_FAIL. */ int da_db_disconnect(DA_T_errinfo *vp_errinfo) { int retval = gda_db_disconnect(con, vp_errinfo); con = NULL; return retval; } /********************************************************************* * Name : da_db_commit * * Issue : 18-SEPT-2003 - H.Korte - Intevation * * Purpose : Commit current transaction in GREAT-ER database * * * Parameter: vp_errinfo (o) error info, just filled when * error occurs (return=FAIL). * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Commit Work. Calls gda_db_commit() to commit work. \author H.Korte - Intevation \date 09-SEP-2003 \param --- \return DA_SUCCESS \n DA_FAIL. */ int da_db_commit(DA_T_errinfo *vp_errinfo) { return gda_db_commit(con, vp_errinfo); } /********************************************************************* * Name : da_db_rollback * * Issue : 18-SEPT-2003 - H.Korte - Intevation * * Purpose : Rollback current transaction in GREAT-ER database * * * Parameter: vp_errinfo (o) error info, just filled when * error occurs (return=FAIL). * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Rollback Work. Calls gda_db_rollback() to rollback work. \author H.Korte - Intevation \date 09-SEP-2003 \param --- \return DA_SUCCESS \n DA_FAIL. */ int da_db_rollback(DA_T_errinfo *vp_errinfo) { return gda_db_rollback(con, vp_errinfo); } /********************************************************************* * Name : da_get_version * * Issue : 17-SEPT-2003 - H.Korte - Intevation * * Purpose : Return string with current GREAT-ER-Version * * * Parameter: vp_ver (o) text with current GREAT-ER-Version * * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Return string with current GREAT-ER-Version. Calls gda_get_version(). \author S.F. - TechniData AG/Markdorf \date 28-JAN-2003 \param v_per points to the current version \return --- */ void da_get_version (char *vp_ver) { gda_get_version (vp_ver); } /********************************************************************* * Name : da_set_password * * Issue : 18-SEPT-2003 - H.Korte - Intevation * * Purpose : Set password for acutally connected user. * It is not possible to set the database user * password for a different user than the one * actually logged in. * * Parameter: vp_userid (i) user-id of database user * vp_passwd (i) user-passwd of database user * vp_errinfo (o) error info, just filled when * error occurs (return=FAIL). * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Set password for acutally connected user. Calls gda_set_password(). \author S.F. - TechniData AG/Markdorf \date 28-JAN-2003 \param db_con Pointer to connection \param vp_userid user-id of database user \param vp_passwd user-passwd of database user \return DA_SUCCESS \n DA_FAIL */ int da_set_password(char *vp_userid, char *vp_passwd, DA_T_errinfo *vp_errinfo) { return gda_set_password(con, vp_userid, vp_passwd, vp_errinfo); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: CATCH_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_catch (CATCH_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of catchments from CATCH_TAB. * * Query conditions: * a) catch_id = -1, => return: 1..n records * b) catch_id <>-1 => return: 1 record * * Parameter: vp_catch_id (i) ID of catchment(s) to select * vp_catch (o) Return value (list of catchments) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of catchments from CATCH_TAB. Calls gda_get_catch(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_catch_id ID of catchment(s) to select \return DA_SUCCESS \n DA_FAIL */ int da_get_catch (long vp_catch_id, DA_T_catch **vp_catch, DA_T_errinfo *vp_errinfo) { return gda_get_catch(con, vp_catch_id, vp_catch, vp_errinfo); } /********************************************************************* * Name : da_free_catch (CATCH_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_catch()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_catch (i) pointer to "list of" catchment records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_catch()". Calls gda_free_catch(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_catch_id pointer to "list of" catchment records \return --- */ void da_free_catch(DA_T_catch *vp_catch) { gda_free_catch(vp_catch); } /********************************************************************* * Name : da_insert_catch (CATCH_TAB) * * Issue : 19-MAY-2003 - S.F. - TechniData AG/Markdorf * * Purpose : Insert record into CATCH_TAB. Return new "CATCH_ID" by * passed struct, in case insert could successfully be done * * Parameter: vp_subst (i/o) data to insert into CATCH_TAB, * OUTPUT: * - catch_id = CATCH_SEQ.NEXTVAL * - cre_date = SYSDATE * - mod_date = SYSDATE * - user_id = * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info(i) -> general information about database * user of current db-session * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into CATCH_TAB. Calls gda_insert_catch(). \author S.F. - TechniData AG/Markdorf \date 19-MAY-2003 \param db_con Pointer to connection \param vp_catch_id pointer to "list of" catchment records \return DA_SUCCESS \n DA_FAIL */ int da_insert_catch ( DA_T_catch *vp_catch, DA_T_errinfo *vp_errinfo) { return gda_insert_catch(con, vp_catch, vp_errinfo); } /********************************************************************* * Name : da_update_catch (CATCH_TAB) * * Issue : 11-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by CATCH_ID) in CATCH_TAB * by data of passed record. * * Parameter: vp_catch (i) new catch data, containing CATCH_ID of * record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by CATCH_ID) in CATCH_TAB by data of passed record. Calls gda_update_catch(). \author T.L. - TechniData AG/Markdorf \date 11-OCT-2003 \param db_con Pointer to connection \param vp_catch new catch data, containing CATCH_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_catch ( DA_T_catch *vp_catch, DA_T_errinfo *vp_errinfo) { return gda_update_catch(con, vp_catch, vp_errinfo); } /********************************************************************* * Name : da_delete_catch (CATCH_TAB) * * Issue : 11-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from CATCH_TAB specified by "catch_id" * * Parameter: vp_catch_id (i) CATCH_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from CATCH_TAB specified by "catch_id". Calls gda_delete_catch(). Output:
  • vp_errinfo - Error information in case error occured \author T.L. - TechniData AG/Markdorf \date 11-OCT-2002 \param vp_catch_id CATCH_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_catch ( long vp_catch_id, DA_T_errinfo *vp_errinfo) { return gda_delete_catch(con, vp_catch_id, vp_errinfo); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: STRETCH_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_stretch (STRETCH_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of stretches for specified catchment * * Query conditions: * a) stretch_id = -1, catch_id >0 => return: 1..n records * (all stretches for catchm.) * b) stretch_id <>-1, catch_id >0 => return: 1 record * (one stretch for catchm.) * * Parameter: vp_catch_id (i) ID of catchm. for which stretch(s) * shall be selected * vp_stretch_id (i) ID of stretch to select * vp_stretch (o) Return value (list of stretches) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of stretches for specified catchment. Calls gda_get_stretch(). Output:
  • vp_stretch - Return value (list of stretches)
  • vp_errinfo - Error info in case error occured \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param db_con Pointer to connection \return DA_SUCCESS \n DA_FAIL */ int da_get_stretch (long vp_catch_id, long vp_stretch_id, DA_T_stretch **vp_stretch, DA_T_errinfo *vp_errinfo) { return gda_get_stretch(con, vp_catch_id, vp_stretch_id, vp_stretch, vp_errinfo); } /********************************************************************* * Name : da_free_stretch (STRETCH_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_stretch()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_stretch (i) pointer to "list of" stretch records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_stretch()". Pointer must be explizitely set to NULL in the calling program after calling this function. Calls gda_free_stretch(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_stretch pointer to "list of" stretch records \return --- */ void da_free_stretch(DA_T_stretch *vp_stretch) { gda_free_stretch(vp_stretch); } /********************************************************************* * Name : da_insert_stretch (STRETCH_TAB) * * Issue : 19-MAY-2003 - S.F. - TechniData AG/Markdorf * * Purpose : - Insert record into STRETCH_TAB. There is no new STRETCH_ID * returned, because STRETCH_ID is stored as given by * input parameter (due to catchment preprocessing). * * - Before INSERT is done * a) check by CATCH_ID if master record in table CATCH_TAB * exists. In case not -> cancel insert! * b) check by STRETCH_CLASS_ID if referenced record in table * STRETCH_CLASS_ID exists. In case not -> cancel insert! * * - Update "MOD_DATE" in master record (CATCH_TAB) by SYSDATE * * * Parameter: vp_stretch (i/o) data to insert into STRETCH_TAB, * Attention: * stretch_id is not set by sequence, * but as given by input data ! * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into STRETCH_TAB. Calls gda_insert_stretch(). \author S.F. - TechniData AG/Markdorf \date 19-MAY-2003 \param vp_stretch data to insert into STRETCH_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_stretch ( DA_T_stretch *vp_stretch, DA_T_errinfo *vp_errinfo) { return gda_insert_stretch(con, vp_stretch, vp_errinfo); } /********************************************************************* * Name : da_update_stretch (STRETCH_TAB) * * Issue : 14-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by CATCH_ID, STRETCH_ID) in * STRETCH_TAB with data of passed record. * * Parameter: vp_stretch (i) new stretch data, containing CATCH_ID and * STRETCH_ID of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by CATCH_ID, STRETCH_ID) in STRETCH_TAB with data of passed record. Calls gda_update_stretch(). \author T.L. - TechniData AG/Markdorf \date 14-OCT-2002 \param vp_stretch new stretch data, containing CATCH_ID and STRETCH_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_stretch ( DA_T_stretch vp_stretch, DA_T_errinfo *vp_errinfo) { return gda_update_stretch(con, vp_stretch, vp_errinfo); } /********************************************************************* * Name : da_delete_stretch (STRETCH_TAB) * * Issue : 14-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from STRETCH_TAB specified by "STRETCH_ID" * and "CATCH_ID". * * Parameter: vp_catch_id (i) CATCH_ID of record to delete * vp_stretch_id (i) STRETCH_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from STRETCH_TAB specified by "STRETCH_ID" and "CATCH_ID". Calls gda_delete_stretch(). \author T.L. - TechniData AG/Markdorf \date 14-OCT-2002 \param vp_catch_id CATCH_ID of record to delete \param vp_stretch_id STRETCH_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_stretch ( long vp_catch_id, long vp_stretch_id, DA_T_errinfo *vp_errinfo) { return gda_delete_stretch(con, vp_catch_id, vp_stretch_id, vp_errinfo); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: STRETCH_CLASS_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_stretch_class (STRETCH_CLASS_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of stretch classes for specified catchment,stretch * * Query conditions: * a) stretch_class_id = -1; return: 1..n records * b) stretch_class_id<> -1; return: 1 record * * Parameter: vp_stretch_class_id (i) ID stretch class to select * vp_stretch_class (o) Return value (list of stretch * classes) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of stretch classes for specified catchment,stretch. Calls gda_get_stretch_class(). Output:
  • vp_stretch_class - Return value (list of stretch classes)
  • vp_errinfo - Error info in case error occured \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_stretch_class_id ID stretch class to select \return DA_SUCCESS \n DA_FAIL */ int da_get_stretch_class (long vp_stretch_class_id, DA_T_stretch_class **vp_stretch_class, DA_T_errinfo *vp_errinfo) { return gda_get_stretch_class(con, vp_stretch_class_id, vp_stretch_class, vp_errinfo); } /********************************************************************* * Name : da_free_stretch_class (STRETCH_CLASS_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_stretch_class()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_stretch (i) pointer to "list of" stretch records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_stretch_class()". Calls gda_free_stretch_class(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_stretch pointer to "list of" stretch records \return --- */ void da_free_stretch_class(DA_T_stretch_class *vp_stretch_class) { gda_free_stretch_class(vp_stretch_class); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: DISCH_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_disch (DISCH_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of discharges (disches) * * Query conditions: * a) catch_id_id > 0; disch_id > 0, stretch_id > 0 => 1 rec. * b) catch_id_id > 0; disch_id > 0, stretch_id = -1 => 1 rec. * c) catch_id_id > 0; disch_id =-1, stretch_id > 0 => 1 rec. * d) catch_id_id > 0; disch_id =-1, stretch_id = -1 => 1..n rec. * * Parameter: vp_catch_id (i) ID of catchment to which stretch of * disch is linked * vp_stretch_id (i) ID of stretch to which disch is linked * vp_disch_id (i) ID of requested disch * vp_disch (o) Return value (list of discharge) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of discharges (disches). Calls gda_get_disch(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_catch_id ID of catchment to which stretch of disch is linked \param vp_stretch_id ID of stretch to which disch is linked \param vp_disch_id D of requested disch \return DA_SUCCESS \n DA_FAIL */ int da_get_disch (long vp_catch_id, long vp_stretch_id, long vp_disch_id, DA_T_disch **vp_disch, DA_T_errinfo *vp_errinfo) { return gda_get_disch(con, vp_catch_id, vp_stretch_id, vp_disch_id, vp_disch, vp_errinfo); } /********************************************************************* * Name : da_free_disch (DISCH_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_disch()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_stretch (i) pointer to "list of" disch records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_disch()". Calls gda_free_disch(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_catch pointer to "list of" disch records \return --- */ void da_free_disch(DA_T_disch *vp_disch) { gda_free_disch(vp_disch); } /********************************************************************* * Name : da_insert_disch (DISCH_TAB) * * Issue : 19-MAY-2003 - S.F. - TechniData AG/Markdorf * * Purpose : - Insert record into DISCH_TAB. There is no new DISCH_ID * returned, because DISCH_ID is stored as given by * input parameter (due to catchment preprocessing). * * - Before INSERT is done * a) check by CATCH_ID if master record in table CATCH_TAB * exists. In case not -> cancel insert! * b) check by STRETCH_ID if referenced record in table * STRETCH_TAB exists. In case not -> cancel insert! * c) check by DISCH_CLASS_ID if referenced record in table * DISCH_CLASS_ID exists. In case not -> cancel insert! * * - Update "MOD_DATE" in master record (CATCH_TAB) by SYSDATE * * * Parameter: vp_disch (i/o) data to insert into DISCH_TAB, * Attention: * disch_id is not set by sequence, * but as given by input data ! * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into DISCH_TAB. Calls gda_insert_disch(). \author S.F. - TechniData AG/Markdorf \date 19-MAY-2003 \param vp_disch data to insert into DISCH_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_disch ( DA_T_disch *vp_disch, DA_T_errinfo *vp_errinfo) { return gda_insert_disch(con, vp_disch, vp_errinfo); } /********************************************************************* * Name : da_update_disch (DISCH_TAB) * * Issue : 14-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by DISCH_ID) in DISCH_TAB * by data of passed record. * * Parameter: vp_catch_id(i) CATCH_ID of record to update * vp_disch (i) new disch data, containing DISCH_ID of * record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by DISCH_ID) in DISCH_TAB by data of passed record. Calls gda_update_disch(). \author T.L. - TechniData AG/Markdorf \date 14-OCT-2002 \param vp_catch_id CATCH_ID of record to update \param vp_disch new disch data, containing DISCH_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_disch ( long vp_catch_id, DA_T_disch vp_disch, DA_T_errinfo *vp_errinfo) { return gda_update_disch(con, vp_catch_id, vp_disch, vp_errinfo); } /********************************************************************* * Name : da_delete_disch (DISCH_TAB) * * Issue : 14-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from DISCH_TAB specified by DISCH_ID * and CATCH_ID. * * Parameter: vp_catch_id (i) CATCH_ID of record to delete * vp_disch_id (i) DISCH_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from DISCH_TAB specified by DISCH_ID and CATCH_ID. Calls gda_delete_disch(). \author T.L. - TechniData AG/Markdorf \date 14-OCT-2003 \param vp_catch_id CATCH_ID of record to delete \param vp_disch_id DISCH_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_disch ( long vp_catch_id, long vp_disch_id, DA_T_errinfo *vp_errinfo) { return gda_delete_disch(con, vp_catch_id, vp_disch_id, vp_errinfo); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: DISCH_CLASS_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_disch_class (DISCH_CLASS_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of discharge classes (disch classes) * * Query conditions: * a) disch_class_id = -1; return: 1..n records * b) disch_class_id <> -1; return: 1 record * * Parameter: vp_disch_class_id (i) ID of requested disch class * vp_disch_class (o) Return value (list of disch classes) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of discharge classes (disch classes). Calls gda_get_disch_class(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_disch_class_id ID of requested disch class \return DA_SUCCESS \n DA_FAIL */ int da_get_disch_class (long vp_disch_class_id, DA_T_disch_class **vp_disch_class, DA_T_errinfo *vp_errinfo) { return gda_get_disch_class(con, vp_disch_class_id, vp_disch_class, vp_errinfo); } /********************************************************************* * Name : da_free_disch_class (DISCH_CLASS_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_disch_class()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_disch_class_id (i) pointer to "list of" stretch records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_disch_class()". Calls gda_free_disch_class(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_disch_class pointer to "list of" stretch records \return --- */ void da_free_disch_class(DA_T_disch_class *vp_disch_class) { gda_free_disch_class(vp_disch_class); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: BACKGRD_JOIN_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_backgrd (BACKGRD_JOIN_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of background object id's * * Query conditions: * a) catch_id > -1; return: 1..n records * b) * * Parameter: vp_catch_id (i) ID of catchment for which background * object information shall be selected * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of background object id's. Calls gda_get_backgrd(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_catch_id ID of catchment for which background object information shall be selected \return DA_SUCCESS \n DA_FAIL */ int da_get_backgrd (long vp_catch_id, DA_T_backgrd **vp_backgrd, DA_T_errinfo *vp_errinfo) { return gda_get_backgrd(con, vp_catch_id, vp_backgrd, vp_errinfo); } /********************************************************************* * Name : da_insert_backgrd (BACKGRD_JOIN_TAB) * * Issue : 15-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Insert record into BACKGRD_JOIN_TAB. * * Parameter: vp_backgrd (i) data to insert into BACKGRD_JOIN_TAB * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into BACKGRD_JOIN_TAB. Calls gda_insert_backgrd(). \author T.L. - TechniData AG/Markdorf \date 15-OCT-2002 \param vp_backgrd data to insert into BACKGRD_JOIN_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_backgrd ( DA_T_backgrd vp_backgrd, DA_T_errinfo *vp_errinfo) { return gda_insert_backgrd(con, vp_backgrd, vp_errinfo); } /********************************************************************* * Name : da_update_backgrd (BACKGRD_JOIN_TAB) * * Issue : 16-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by vp_backgrd_old) in * BACKGRD_JOIN_TAB by data of passed record. * * Parameter: vp_backgrd_old(i) background data to update * vp_backgrd (i) new background data * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by vp_backgrd_old) in BACKGRD_JOIN_TAB by data of passed record. Calls gda_update_backgrd(). \author T.L. - TechniData AG/Markdorf \date 16-OCT-2002 \param vp_backgrd_old background data to update \param vp_backgrd new background data \return DA_SUCCESS \n DA_FAIL */ int da_update_backgrd ( DA_T_backgrd vp_backgrd_old, DA_T_backgrd vp_backgrd, DA_T_errinfo *vp_errinfo) { return gda_update_backgrd(con, vp_backgrd_old, vp_backgrd, vp_errinfo); } /********************************************************************* * Name : da_delete_backgrd (BACKGRD_JOIN_TAB) * * Issue : 16-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from BACKGRD_JOIN_TAB. * * Parameter: vp_backgrd (i) data of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from BACKGRD_JOIN_TAB. Calls gda_delete_backgrd(). Output:
  • vp_errinfo - Error information in case error occured \author T.L. - TechniData AG/Markdorf \date 16-OCT-2002 \param vp_backgrd data of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_backgrd( DA_T_backgrd vp_backgrd, DA_T_errinfo *vp_errinfo) { return gda_delete_backgrd(con, vp_backgrd, vp_errinfo); } /********************************************************************* * Name : da_free_backgrd (BACKGRD_JOIN_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_backgrd()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_backgrd_id (i) pointer to "list of" backgrd. obj. * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_backgrd()". Calls gda_free_backgrd(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_backgrd data of record to delete \return --- */ void da_free_backgrd(DA_T_backgrd *vp_backgrd) { gda_free_backgrd(vp_backgrd); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: BIN_OBJ_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_bin_obj (BIN_OBJ_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of binary objects (BLOB) from BIN_OBJ_TAB * incl. BLOB values for specified input parameters * (bin_obj_id and object_id) * * Query conditions: * a) bin_obj_id> 0, object_id=-1 => return: 1 record * b) bin_obj_id=-1, object_id> 0 => return: 1..n records * c) bin_obj_id=-1, object_id=-1, vp_object_type="BACKGROUND" * => return: all background binary objects * d) bin_obj_id=-1, object_id=-1, vp_object_type="%" * => return: all binary objects * * Parameter: vp_object_id (i) ID of object(s) to select * vp_object_type (i) Type of object(s) to select * vp_bin_obj_id (i) Unique ID of object to select * vp_bin_obj_file (o) Return value (list of bin. objects) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of binary objects (BLOB) from BIN_OBJ_TAB. Calls gda_get_bin_obj(). Output:
  • vp_errinfo - Error information in case error occured
  • vp_bin_obj_file - Return value (list of bin. objects) \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_object_id ID of object(s) to select \param vp_object_type Type of object(s) to select \param vp_bin_obj_id Unique ID of object to select \return DA_SUCCESS \n DA_FAIL */ int da_get_bin_obj (long vp_object_id, char *vp_object_type, long vp_bin_obj_id, char vp_get_file_obj, DA_T_bin_obj **vp_bin_obj, DA_T_errinfo *vp_errinfo) { return gda_get_bin_obj(con, vp_object_id, vp_object_type, vp_bin_obj_id, vp_get_file_obj, vp_bin_obj, vp_errinfo); } /********************************************************************* * Name : da_get_bin_obj_search (BIN_OBJ_TAB, BIN_OBJ_SEARCH_TAB) * * Issue : 24-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Get list of binary objects from BIN_OBJ_TAB, filtered by * various search parameters, without the BLOB itself. * If a parameter is NULL ignore it in SELECT-statement * * Parameter: vp_name (i) Name of object(s) to select * vp_object_sub_type (i) Subtype of object(s) to select * vp_remark (i) Remark of object to select * vp_user_id (i) User ID of object to select * vp_file_type (i) File type of object to select * vp_cre_date (i) Creation date of object to select * vp_mod_date (i) Modification date of object to select * vp_bin_obj (o) Return value (list of bin. obj. data) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of binary objects from BIN_OBJ_TAB. Calls gda_get_bin_obj_search(). Output:
  • vp_errinfo - Error information in case error occured
  • vp_bin_obj - Return value (list of bin. objects) \author T.L. - TechniData AG/Markdorf \date 24-OCT-2002 \param vp_name Name of object(s) to select \param vp_object_sub_type Subtype of object(s) to select \param vp_remark Remark of object to select \param vp_user_id User ID of object to select \param vp_file_type File type of object to select \param vp_cre_date Creation date of object to select \param vp_mod_date Modification date of object to select \return DA_SUCCESS \n DA_FAIL */ int da_get_bin_obj_search (char *vp_name, char *vp_obj_sub_type, char *vp_remark, char *vp_user_id, char *vp_file_type, char *vp_cre_date, char *vp_mod_date, DA_T_bin_obj **vp_bin_obj, DA_T_errinfo *vp_errinfo) { return gda_get_bin_obj_search(con, vp_name, vp_obj_sub_type, vp_remark, vp_user_id, vp_file_type, vp_cre_date, vp_mod_date, vp_bin_obj, vp_errinfo); } /********************************************************************* * Name : da_insert_bin_obj (BIN_OBJ_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into BIN_OBJ_TAB. Return new ID "BIN_OBJ_ID" * in passed struct, in case for insert could successfully * be done * * Parameter: vp_bin_obj (i/o) data to insert into BIN_OBJ_TAB, * OUTPUT: * - bin_obj_id = BIN_OBJ_SEQ.NEXTVAL * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info(i) -> general information about database * user of current db-session * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into BIN_OBJ_TAB. Calls gda_insert_bin_obj(). Output:
  • vp_bin_obj - bin_obj_id
  • vp_errinfo - Error information in case error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_bin_obj data to insert into BIN_OBJ_TAB, \return DA_SUCCESS \n DA_FAIL */ int da_insert_bin_obj( DA_T_bin_obj *vp_bin_obj, DA_T_errinfo *vp_errinfo) { return gda_insert_bin_obj(con, vp_bin_obj, vp_errinfo); } /********************************************************************* * Name : da_update_bin_obj (BIN_OBJ_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by BIN_OBJ_ID) in BIN_OBJ_TAB * by data of passed record. BLOB will be only updated, if * file_object is specified! * * Parameter: vp_bin_obj (i) new bin. obj. data containing BIN_OBJ_ID * of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by BIN_OBJ_ID) in BIN_OBJ_TAB by data of passed record. Calls gda_update_bin_obj(). Output:
  • vp_errinfo - Error information in case error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_bin_obj new bin. obj. data containing BIN_OBJ_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_bin_obj( DA_T_bin_obj *vp_bin_obj, DA_T_errinfo *vp_errinfo) { return gda_update_bin_obj(con, vp_bin_obj, vp_errinfo); } /********************************************************************* * Name : da_delete_bin_obj (BIN_OBJ_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Delete record (incl. BLOB) specified by "bin_obj_id" * * Parameter: vp_bin_obj_id (i) BIN_OBJ_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record (incl. BLOB) specified by "bin_obj_id". Calls gda_delete_bin_obj(). Output:
  • vp_errinfo - Error information in case error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_bin_obj_id BIN_OBJ_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_bin_obj( long vp_bin_obj_id, DA_T_errinfo *vp_errinfo) { return gda_delete_bin_obj(con, vp_bin_obj_id, vp_errinfo); } /********************************************************************* * Name : da_load_bin_obj (BIN_OBJ_TAB) * * Issue : 30-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Load specified file from file system into memory and insert * the loaded file (bin. object) together with passed bin.obj. * detail data into table BIN_OBJ_TAB. * * Parameter: vp_bin_obj (i/o) pointer to struct, containing the detail * data for insert into BIN_OBJ_TAB * * OUTPUT: * vp_bin_obj.bin_obj_id (ret. from insert) * vp_bin_obj.name (taken from vp_filename) * vp_bin_obj.file_obj (ptr. to allocated mem. * containg the inputfile) * vp_get_file_obj (i) control return of binary input file/obj. * 'N' => vp_bin_obj->file_obj = NULL * 'Y' => vp_bin_obj->file_obj <> NULL * vp_filepath (i) path to file which shall be read in as * binary object * vp_filename (i) name of file which shall be read in as * binary object. Wildcards are not supported! * vp_errinfo (o) Error information in case error occured * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Load specified file from file system into memory and insert the loaded file. Calls gda_load_bin_obj(). Output:
  • vp_errinfo - Error information in case error occured \author T.V. - TechniData AG/Markdorf \date 30-JUL-2002 \param vp_bin_obj pointer to struct, containing the detail data for insert into BIN_OBJ_TAB \param vp_get_file_obj (i) control return of binary input file/obj. \n 'N' => vp_bin_obj->file_obj = NULL \n 'Y' => vp_bin_obj->file_obj <> NULL \param vp_filepath path to file which shall be read in as binary object \param vp_filename name of file which shall be read in as binary object. Wildcards are not supported! \return --- */ int da_load_bin_obj (DA_T_bin_obj *vp_bin_obj, char vp_get_file_obj, char *vp_filepath, char *vp_filename, DA_T_errinfo *vp_errinfo) { return gda_load_bin_obj(con, vp_bin_obj, vp_get_file_obj, vp_filepath, vp_filename, vp_errinfo); } /********************************************************************* * Name : da_free_bin_obj (BIN_OBJ_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "da_get_bin_obj()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_bin_obj (i) pointer to "list of" bin_obj records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "da_get_bin_obj()". Calls gda_free_bin_obj(). \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_bin_obj pointer to "list of" bin_obj records \return --- */ void da_free_bin_obj(DA_T_bin_obj *vp_bin_obj) { gda_free_bin_obj(vp_bin_obj); } /********************************************************************* * Name : da_load_bin_obj_update (BIN_OBJ_TAB) * * Issue : 28-JAN-2003 - S.F. - TechniData AG/Markdorf * * Purpose : Load specified file from file system into memory and update * the loaded file (bin. object) together with passed bin.obj. * detail data into table BIN_OBJ_TAB. If no file path and no * file name are given, only the binary object data is updated without * without upload of file. * * Parameter: vp_bin_obj (i/o) pointer to struct, containing the detail * data for insert into BIN_OBJ_TAB * * OUTPUT: * vp_bin_obj.bin_obj_id (ret. from insert) * vp_bin_obj.name (taken from vp_filename) * vp_bin_obj.file_obj (ptr. to allocated mem. * containg the inputfile) * vp_get_file_obj (i) control return of binary input file/obj. * 'N' => vp_bin_obj->file_obj = NULL * 'Y' => vp_bin_obj->file_obj <> NULL * vp_filepath (i) path to file which shall be read in as * binary object * vp_filename (i) name of file which shall be read in as * binary object. Wildcards are not supported! * vp_errinfo (o) Error information in case error occured * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Load specified file from file system into memory and update the loaded file . Calls gda_load_bin_obj_update(). Output:
  • vp_errinfo - Error information in case error occured \author S.F. - TechniData AG/Markdorf \date 28-JAN-2003 \param vp_bin_obj pointer to struct, containing the detail data for insert into BIN_OBJ_TAB \param vp_get_file_obj (i) control return of binary input file/obj. \n 'N' => vp_bin_obj->file_obj = NULL \n 'Y' => vp_bin_obj->file_obj <> NULL \param vp_filepath path to file which shall be read in as binary object \param vp_filename name of file which shall be read in as binary object. Wildcards are not supported! \return --- */ int da_load_bin_obj_update (DA_T_bin_obj *vp_bin_obj, char vp_get_file_obj, char *vp_filepath, char *vp_filename, DA_T_errinfo *vp_errinfo) { return gda_load_bin_obj_update(con, vp_bin_obj, vp_get_file_obj, vp_filepath, vp_filename, vp_errinfo); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: PARA_TREE_DEF_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_para_tree (PARA_TREE_DEF_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of parameter tree information * * Query conditions: * a) FIELD_ID= * BLOCK_ID= * GROUP_ID= or DA_ALL * => return: 1 record * * b) FIELD_ID= DA_ALL * BLOCK_ID= * GROUP_ID= or DA_ALL * => return: 1..n records (all fields for spec. block_id/group_id) * * * Parameter: vp_block_id (i) ID of parameter block * vp_group_id (i) ID of parameter group * vp_field_id (i) ID of parameter field * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of parameter tree information. Calls gda_get_para_tree(). Output:
  • vp_errinfo - Error information in case error occured
  • vp_para_tree - the parameter tree information \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_block_id ID of parameter block \param vp_group_id ID of parameter group \param vp_field_id ID of parameter field \return DA_SUCCESS \n DA_FAIL */ int da_get_para_tree (char *vp_block_id, char *vp_group_id, char *vp_field_id, DA_T_para_tree **vp_para_tree, DA_T_errinfo *vp_errinfo) { return gda_get_para_tree(con, vp_block_id, vp_group_id, vp_field_id, vp_para_tree, vp_errinfo); } /********************************************************************* * Name : da_insert_para_tree (PARA_TREE_DEF_TAB) * * Issue : 16-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Insert record into PARA_TREE_DEF_TAB. * * Parameter: vp_para_tree (i) data to insert into PARA_TREE_DEF_TAB * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into PARA_TREE_DEF_TAB. Calls gda_insert_para_tree(). Output:
  • vp_errinfo - Error information in case error occured \author T.L. - TechniData AG/Markdorf \date 16-OCT-2002 \param vp_para_tree data to insert into PARA_TREE_DEF_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_para_tree (DA_T_para_tree vp_para_tree, DA_T_errinfo *vp_errinfo) { return gda_insert_para_tree(con, vp_para_tree, vp_errinfo); } /********************************************************************* * Name : da_update_para_tree (PARA_TREE_DEF_TAB) * * Issue : 16-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by BLOCK_ID, GROUP_ID, FIELD_ID) * in PARA_TREE_DEF_TAB by data of passed record. * * Parameter: vp_para_tree (i) new para_tree data * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by BLOCK_ID, GROUP_ID, FIELD_ID) in PARA_TREE_DEF_TAB by data of passed record. Calls gda_update_para_tree(). Output:
  • vp_errinfo - Error information in case error occured \author T.L. - TechniData AG/Markdorf \date 16-OCT-2002 \param vp_para_tree new para_tree data \return DA_SUCCESS \n DA_FAIL */ int da_update_para_tree ( DA_T_para_tree vp_para_tree, DA_T_errinfo *vp_errinfo) { return gda_update_para_tree(con, vp_para_tree, vp_errinfo); } /********************************************************************* * Name : da_delete_para_tree (PARA_TREE_DEF_TAB) * * Issue : 16-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from PARA_TREE_DEF_TAB specified by * BLOCK_ID, GROUP_ID and FIELD_ID. * * Parameter: vp_block_id (i) BLOCK_ID of record to delete * vp_group_id (i) GROUP_ID of record to delete * vp_field_id (i) FIELD_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from PARA_TREE_DEF_TAB specified by BLOCK_ID, GROUP_ID and FIELD_ID. Calls gda_delete_para_tree(). Output:
  • vp_errinfo - Error information in case error occured \author T.L. - TechniData AG/Markdorf \date 16-OCT-2002 \param vp_block_id BLOCK_ID of record to delete \param vp_group_id GROUP_ID of record to delete \param vp_field_id FIELD_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_para_tree ( char *vp_block_id, char *vp_group_id, char *vp_field_id, DA_T_errinfo *vp_errinfo) { return gda_delete_para_tree(con, vp_block_id, vp_group_id, vp_field_id, vp_errinfo); } /********************************************************************* * Name : da_free_para_tree (PARA_TREE_DEF_TAB) * * Issue : 02-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_para_tree()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_para_tree (i) pointer to "list of" param. tree infos * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_para_tree()". Calls gda_free_para_tree(). \author T.V. - TechniData AG/Markdorf \date 02-AUG-2002 \param vp_para_tree pointer to "list of" param. tree infos \return DA_SUCCESS \n DA_FAIL */ void da_free_para_tree(DA_T_para_tree *vp_para_tree) { gda_free_para_tree(vp_para_tree); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: SESS_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_sess (SESS_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of sessions from SESS_TAB * * Query conditions: * a) sess_id =-1 return: 1..n records * b) sess_id <>-1, return: 1 record * * Additional filter: * is_temp_sess = Y -> select only temp. sessions * is_temp_sess = N -> select only NONE temp. sessions * is_temp_sess = % -> select both types of sessions * * Parameter: vp_sess_id (i) ID of session to select * vp_is_temp_sess (i) see above * vp_sess (o) Return value (list of sessions) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of sessions from SESS_TAB. Calls gda_get_sess(). Query conditions:
  • sess_id =-1 return: 1..n records
  • sess_id <>-1, return: 1 record Additional filter:
  • is_temp_sess = Y -> select only temp. sessions
  • is_temp_sess = N -> select only NONE temp. sessions
  • is_temp_sess = % -> select both types of sessions Output:
  • vp_sess - Return value (list of sessions)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_sess_id ID of session to select \param vp_is_temp_sess see above \return DA_SUCCESS \n DA_FAIL */ int da_get_sess (long vp_sess_id, char vp_is_temp_sess, DA_T_sess **vp_sess, DA_T_errinfo *vp_errinfo) { return gda_get_sess(con, vp_sess_id, vp_is_temp_sess, vp_sess, vp_errinfo); } /********************************************************************* * Name : da_insert_sess (SESS_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into SESS_TAB. Return new "SESS_ID" * by passed struct, in case insert could successfully be done * * Parameter: vp_sess (i/o) data to insert into SESS_TAB, * OUTPUT: * - sess_id = SESS_SEQ.NEXTVAL * - cre_date = SYSDATE * - mod_date = SYSDATE * - user_id = * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info(i) -> general information about database * user of current db-session * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into SESS_TAB. Return new "SESS_ID" by passed struct, in case insert could successfully be done. Calls gda_insert_sess(). Output:
  • vp_sess - Return value (sess_id = NEXTVAL('SESS_SEQ'), cre_date = CURRENT_TIMESTAMP, mod_date = CURRENT_TIMESTAMP)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_sess data to insert into SESS_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_sess ( DA_T_sess *vp_sess, DA_T_errinfo *vp_errinfo) { return gda_insert_sess(con, vp_sess, vp_errinfo); } /********************************************************************* * Name : da_update_sess (SESS_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by SESS_ID) in SESS_TAB * by data of passed record. * * Parameter: vp_sess (i/o) new session data, containing SESS_ID of * record to update. * OUTPUT: vp_sess.MOD_DATE = SYSDATE * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by SESS_ID) in SESS_TAB by data of passed record. Calls gda_update_sess(). Output:
  • vp_sess - Return value (vp_sess.MOD_DATE = CURRENT_TIMESTAMP)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_sess new session data, containing SESS_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_sess ( DA_T_sess *vp_sess, DA_T_errinfo *vp_errinfo) { return gda_update_sess(con, vp_sess, vp_errinfo); } /********************************************************************* * Name : da_delete_sess (SESS_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Delete record from SESS_TAB specified by "sess_id" * * Parameter: vp_sess_id (i) SESS_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from SESS_TAB specified by "sess_id". Calls gda_delete_sess(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_sess_id SESS_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_sess ( long vp_sess_id, DA_T_errinfo *vp_errinfo) { return gda_delete_sess(con, vp_sess_id, vp_errinfo); } /********************************************************************* * Name : da_create_temp_sess (SESS_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Create temp. session, by copying session with passed "sess_id" * and all session details, like substance, env. params,... . * * - Copied session will be marked as temp. session (IS_TEMP_SESS=Y). * - Copied data are generally no template data anymore (IS_TEMPL=N) * - Copied data are linked to the same owner(user), because session * could be owned by an other user than the current database user! * * If vp_sess_id_src = -1 then create temporary session from scratch. * * - There is no source session required or copied. * - All reference Ids are set to -1. * - New temporary session is generally no template session. * - New temporary session is owned by current database user. * * NOTE: All copied details will get new ID's by copy action! * ===== * * Parameter: vp_sess_id_src (i) ID of session to copy * vp_sess_id_temp (o) ID of temporary session * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Create temp. session, by copying session with passed "sess_id" and all session details, like substance, env. params,... Calls gda_create_temp_sess().
  • Copied session will be marked as temp. session (IS_TEMP_SESS=Y).
  • Copied data are generally no template data anymore (IS_TEMPL=N)
  • Copied data are linked to the same owner(user), because session could be owned by an other user than the current database user! If vp_sess_id_src = -1 then create temporary session from scratch.
  • There is no source session required or copied.
  • All reference Ids are set to -1.
  • New temporary session is generally no template session.
  • New temporary session is owned by current database user. NOTE: All copied details will get new ID's by copy action! Output:
  • vp_sess_id_temp ID of temporary session
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param db_con Pointer to connection \param vp_sess_id_src ID of session to copy \param vp_temp_type "Y" => Session is already marked as temp \n "N" => Session is not temp yet \n "W" => Session is an web-based session \return DA_SUCCESS \n DA_FAIL */ int da_create_temp_sess ( long vp_sess_id_src, long *vp_sess_id_tmp, char vp_temp_type, DA_T_errinfo *vp_errinfo) { return gda_create_temp_sess(con, vp_sess_id_src, vp_sess_id_tmp, vp_temp_type, vp_errinfo); } /********************************************************************* * Name : da_make_temp_sess_permanent() (SESS_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Save temp. session created by "da_create_temp_sess()" as * permanent/none temporary session and delete source session * (incl. details) of specified temp. session; * Delete nothing, if no source session is existing. * * Parameter: vp_sess_id_temp (i) ID of session to copy * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Save temp. session created by "da_create_temp_sess()" ... as permanent/none temporary session and delete source session (incl. details) of specified temp. session; Delete nothing, if no source session is existing. Calls gda_make_temp_sess_permanent(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_sess_id_tmp ID of session to copy \return DA_SUCCESS \n DA_FAIL */ int da_make_temp_sess_permanent ( long vp_sess_id_tmp, DA_T_errinfo *vp_errinfo) { return gda_make_temp_sess_permanent(con, vp_sess_id_tmp, vp_errinfo); } /********************************************************************* * Name : da_cleanup_temp_sess (SESS_TAB) * * Issue : 16-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Delete all client temporary sessions from database, which * are linked to database sessions that do not exist anymore; * delete also web temporary sessions older than 2 days. * * Parameter: vp_errinfo (o) Error info in case error occured * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete all client temporary sessions from database, ... which are linked to database sessions that do not exist anymore; delete also web temporary sessions older than 2 days. Calls gda_cleanup_temp_sess(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 16-AUG-2002 \param --- \return DA_SUCCESS \n DA_FAIL */ int da_cleanup_temp_sess(DA_T_errinfo *vp_errinfo) { return gda_cleanup_temp_sess(con, vp_errinfo); } /********************************************************************* * Name : da_free_sess (SESS_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_sess()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_sess (i) pointer to "list of" session records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_sess()". Pointer must be explizitely set to NULL in the calling program after calling this function. Calls gda_free_sess(). \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_sess pointer to "list of" session records \return --- */ void da_free_sess(DA_T_sess *vp_sess) { gda_free_sess(vp_sess); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: SESS_DISCH_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_sess_disch (SESS_DISCH_TAB) * * Issue : 04-SEP-2002 - S.F. - TechniData AG/Markdorf * * Purpose : Get list of session data from SESS_DISCH_TAB ordered by * SESS_DISCH_ID * * Query conditions: * a) catch_id <> -1 or = -1 * disch_id = -1 or <> -1 * sess_disch_id = -1 or = -1 * => return: 1..n records! * * b) catch_id <> -1 * disch_id <> -1 * sess_disch_id <> -1 * => return: 1 record! * * Parameter: vp_catch_id (i) ID of catchment to which session discharge * data belong * vp_disch_id (i) ID of disch to which session discharge * data belong * vp_sess_disch_id (i) ID of session discharge data record * vp_sess_disch (o) Return value (list of session discharge data) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : *********************************************************************/ /*! \brief Get list of session data from SESS_DISCH_TAB ordered by SESS_DISCH_ID. Calls gda_get_sess_disch(). Output:
  • vp_sess_disch - Return value (list of session discharge data)
  • vp_errinfo - Error info in case of error occured \author S.F. - TechniData AG/Markdorf \date 04-SEP-2002 \param vp_catch_id ID of catchment to which session discharge data belong \param vp_disch_id ID of disch to which session discharge data belong \param vp_sess_disch_id ID of session discharge data record \return DA_SUCCESS \n DA_FAIL */ int da_get_sess_disch (long vp_catch_id, long vp_disch_id, long vp_sess_disch_id, DA_T_sess_disch **vp_sess_disch, DA_T_errinfo *vp_errinfo) { return gda_get_sess_disch(con, vp_catch_id, vp_disch_id, vp_sess_disch_id, vp_sess_disch, vp_errinfo); } /********************************************************************* * Name : da_insert_sess_disch (SESS_DISCH_TAB) * * Issue : 05-SEP-2002 - S.F. - TechniData AG/Markdorf * * Purpose : Insert record into SES_DISCH_TAB. Return new "SESS_DISCH_ID" * by passed struct, in case insert could successfully be done. * * The new (inserted) session discharge record will be * automatically linked to the specified session, because a * session discharge record must always be linked to a session! * * Parameter: vp_sess_disch (i/o) data to insert into SESS_DISCH_TAB, * OUTPUT: (->SESS_DISCH_ID) * a) When record was first sess disch record * for specified session: * -> SESS_DISCH_ID = * cre_date = CURRENT_TIMESTAMP * mod_date = CURRENT_TIMESTAMP * user_id = * * a) When record was additional sess disch * record for specified session: * -> SESS_DISCH_ID = SESS_TAB.SESS_DISCH_ID * cre_date = CURRENT_TIMESTAMP * mod_date = CURRENT_TIMESTAMP * user_id = * * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info(i) -> general information about database * user of current db-session * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into SES_DISCH_TAB. Calls gda_insert_sess_disch(). Output:
  • vp_sess_disch - look at gda_insert_sess_disch
  • vp_errinfo - Error info in case of error occured \author S.F. - TechniData AG/Markdorf \date 05-SEP-2002 \param vp_sess_disch data to insert into SESS_DISCH_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_sess_disch ( long vp_sess_id, DA_T_sess_disch *vp_sess_disch, DA_T_errinfo *vp_errinfo) { return gda_insert_sess_disch(con, vp_sess_id, vp_sess_disch, vp_errinfo); } /********************************************************************* * Name : da_update_sess_disch (SESS_DISCH_TAB) * * Issue : 05-SEP-2002 - S.F. - TechniData AG/Markdorf * * Purpose : Update record (specified by SESS_DISCH_ID) in SESS_DISCH_TAB * by data of passed record. * * Parameter: vp_sess_disch (i) new session discharge data, containing * SESS_DISCH_ID of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by SESS_DISCH_ID) in SESS_DISCH_TAB by data of passed record. Calls gda_update_sess_disch(). Output:
  • vp_errinfo - Error info in case of error occured \author S.F. - TechniData AG/Markdorf \date 05-SEP-2002 \param vp_sess_disch new session discharge data, containing SESS_DISCH_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_sess_disch ( DA_T_sess_disch *vp_sess_disch, DA_T_errinfo *vp_errinfo) { return gda_update_sess_disch(con, vp_sess_disch, vp_errinfo); } /********************************************************************* * Name : da_delete_sess_disch (SESS_DISCH_TAB) * * Issue : 04-SEP-2002 - S.F. - TechniData AG/Markdorf * * Purpose : Delete record from SESS_DISCH_TAB specified by "sess_disch_id" * * Delete condition: * ------------------ * CATCH_ID > 0, DISCH_ID > 0, SESS_DISCH_ID > 0 * * Parameter: vp_sess_disch_id (i) SESS_DISCH_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from SESS_DISCH_TAB specified by "sess_disch_id". Calls gda_delete_sess_disch(). Output:
  • vp_errinfo - Error info in case of error occured \author S.F. - TechniData AG/Markdorf \date 04-SEP-2002 \param vp_catch_id CATCH_ID of record to delete \param vp_disch_id DISCH_ID of record to delete \param vp_sess_disch_id SESS_DISCH_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_sess_disch ( long vp_catch_id, long vp_disch_id, long vp_sess_disch_id, DA_T_errinfo *vp_errinfo) { return gda_delete_sess_disch(con, vp_catch_id, vp_disch_id, vp_sess_disch_id, vp_errinfo); } /********************************************************************* * Name : da_free_sess_disch (SESS_DISCH_TAB) * * Issue : 04-SEP-2002 - S.F. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_sess_disch()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_sess_disch (i) pointer to "list of" session discharge * records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_sess_disch()". Calls gda_free_sess_disch(). \author S.F. - TechniData AG/Markdorf \date 04-SEP-2002 \param vp_sess_disch pointer to "list of" session discharge records \return --- */ void da_free_sess_disch ( DA_T_sess_disch *vp_sess_disch) { gda_free_sess_disch(vp_sess_disch); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: SUBST_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_subst (SUBST_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of substance data from SUBST_TAB order by SUBST_ID * * Query conditions: * a) subst_id =-1, is_templ='Y' return: 1..n records (templates) * subst_id =-1, is_templ='N' return: 1..n records (non-templ.) * (is_tepml=DA_ALL -> ignore is_templ for selection!) * * b) subst_id<>-1, is_templ='Y' return: 1 record (template) * subst_id<>-1, is_templ='N' return: 1 record (non-templ.) * (is_tepml=DA_ALL -> ignore is_templ for selection!) * * Parameter: vp_subst_id (i) ID of substance to select * vp_is_templ (i) 'Y' => select templates only * 'N' => select non-templates only * vp_subst (o) Return value (list of substances) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of substance data from SUBST_TAB order by SUBST_ID. Calls gda_get_subst(). Output:
  • vp_subst - Return value (list of substances)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_subst_id ID of substance to select \param vp_is_templ 'Y' => select templates only \n 'N' => select non-templates only \return DA_SUCCESS \n DA_FAIL */ int da_get_subst (long vp_subst_id, char vp_is_templ, DA_T_subst **vp_subst, DA_T_errinfo *vp_errinfo) { return gda_get_subst(con, vp_subst_id, vp_is_templ, vp_subst, vp_errinfo); } /********************************************************************* * Name : da_get_subst_search (SUBST_TAB, SUBST_DET_TAB) * * Issue : 04-NOV-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Get list of subst data from SUBST_TAB and SUBST_DET_TAB, * filtered by NAME, REMARK in SUBST_TAB and the content of * the VALUE-field in SUBST_DET_TAB where FIELD_ID = passed * FIELD_ID. * If a parameter is NULL ignore it in SELECT-statement. * * Parameter: vp_name (i) Name of substance(s) to select * vp_remark (i) Remark of substance(s) to select * vp_field_id (i) Specifies the third search criterium * vp_detail_value (i) Search text for the third search * criterium * vp_subst_result (o) Return value (list of substances) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of subst data from SUBST_TAB and SUBST_DET_TAB, filtered by NAME, REMARK in SUBST_TAB and the content of the VALUE-field in SUBST_DET_TAB where FIELD_ID = passed FIELD_ID. If a parameter is NULL ignore it in SELECT-statement. Calls gda_get_subst_search(). Output:
  • vp_subst_result - Return value (list of substances)
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 04-NOV-2002 \param vp_name Name of substance(s) to select \param vp_remark Remark of substance(s) to select \param vp_field_id Specifies the third search criterium \param vp_detail_value Search text for the third search criterium \return DA_SUCCESS \n DA_FAIL */ int da_get_subst_search (char *vp_name, char *vp_remark, char *vp_field_id, char *vp_detail_value, DA_T_subst_result **vp_subst_result, DA_T_errinfo *vp_errinfo) { return gda_get_subst_search(con, vp_name, vp_remark, vp_field_id, vp_detail_value, vp_subst_result, vp_errinfo); } /********************************************************************* * Name : da_insert_subst (SUBST_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into SUBST_TAB. Return new "SUBST_ID" by * passed struct, in case insert could successfully be done * * Parameter: vp_subst (i/o) data to insert into SUBST_TAB, * OUTPUT: * - subst_id = NEXTVAL('SUBST_SEQ') * - cre_date = CURRENT_TIMESTAMP * - mod_date = CURRENT_TIMESTAMP * - user_id = * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info(i) -> general information about database * user of current db-session * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] * 22-AUG-2002 - T.V. - Return additionally: CRE_DATE=SYSDATE, * MOD_DATE=SYSDATE,USER_ID= * - Removed access right check *********************************************************************/ /*! \brief Insert record into SUBST_TAB. Return new "SUBST_ID" by passed struct, in case insert could successfully be done Calls gda_insert_subst(). Output:
  • vp_subst - subst_id, cre_date, mod_date, user_id
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_subst data to insert into SUBST_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_subst ( DA_T_subst *vp_subst, DA_T_errinfo *vp_errinfo) { return gda_insert_subst(con, vp_subst, vp_errinfo); } /********************************************************************* * Name : da_update_subst (SUBST_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by SUBST_ID) in SUBST_TAB * by data of passed record. * * Parameter: vp_subst (i) new substance data, containing SUBST_ID of * record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by SUBST_ID) in SUBST_TAB by data of passed record. Calls gda_update_subst(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_subst new substance data, containing SUBST_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_subst ( DA_T_subst *vp_subst, DA_T_errinfo *vp_errinfo) { return gda_update_subst(con, vp_subst, vp_errinfo); } /********************************************************************* * Name : da_delete_subst (SUBST_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Delete record from SUBST_TAB specified by "subst_id" * * Parameter: vp_subst_id (i) SUBST_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from SUBST_TAB specified by "subst_id". Calls gda_delete_subst(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_subst_id SUBST_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_subst ( long vp_subst_id, DA_T_errinfo *vp_errinfo) { return gda_delete_subst(con, vp_subst_id, vp_errinfo); } /********************************************************************* * Name : da_free_subst (SUBST_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "da_get_subst()". * Pointer must be explicitely set to NULL in the calling * program after calling this function. * * Parameter: vp_subst (i) pointer to "list of" substance records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "da_get_subst()". Calls gda_free_subst(). \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_subst pointer to "list of" substance records \return --- */ void da_free_subst ( DA_T_subst *vp_subst) { gda_free_subst(vp_subst); } /********************************************************************* * Name : da_free_subst_result (SUBST_TAB) * * Issue : 04-NOV-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "da_get_subst_search()". * Pointer must be explicitely set to NULL in the calling * program after calling this function. * * Parameter: vp_subst_result (i) pointer to "list of" substance records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "da_get_subst_search()". Calls gda_free_subst_result(). \author T.L. - TechniData AG/Markdorf \date 04-NOV-2002 \param vp_subst_result pointer to "list of" substance records \return --- */ void da_free_subst_result ( DA_T_subst_result *vp_subst_result) { gda_free_subst_result(vp_subst_result); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: SUBST_DET_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_subst_det (SUBST_DET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of substance detail data from SUBST_DET_TAB ordered * by SUBST_DET_ID * * Query conditions: * a) subst_id <>-1, subst_det_id =-1; return: 1..n records * b) subst_id <>-1, subst_det_id<>-1; return: 1 records * * Parameter: vp_subst_id (i) ID of substance for which details shall * be selected * vp_subst_det_id (i) ID of substance detail data to select * vp_subst_det (o) Return value (list of substance details) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of substance detail data from SUBST_DET_TAB ordered by SUBST_DET_ID. Calls gda_get_subst_det(). Output:
  • vp_subst_det - Return value (list of substance details)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_subst_id ID of substance for which details shall be selected \param vp_subst_det_id ID of substance detail data to select \return DA_SUCCESS \n DA_FAIL */ int da_get_subst_det (long vp_subst_id, long vp_subst_det_id, DA_T_subst_det **vp_subst_det, DA_T_errinfo *vp_errinfo) { return gda_get_subst_det(con, vp_subst_id, vp_subst_det_id, vp_subst_det, vp_errinfo); } /********************************************************************* * Name : da_insert_subst_det (SUBST_DET_TAB) * * Issue : 07-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : - Insert record into SUBST_DET_TAB. Return new "SUBST_DET_ID" * by passed struct, in case insert could successfully be done. * * - Before INSERT is done * a) check by FIELD_ID, BLOCK_ID if master record in table * PARA_TREE_DEF_TAB exists. In case not -> cancel insert! * b) check by SUBST_ID if master record in table SUBST_TAB * exists. In case not -> cancel insert! * * - Update "MOD_DATE" in master record (SUBST_TAB) by SYSDATE * * * Parameter: vp_subst_det (i/o) data to insert into SUBST_DET_TAB, * OUTPUT: * new subst_det_id = SUBST_DET_SEQ.NEXTVAL * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into SUBST_DET_TAB. Calls gda_insert_subst_det(...)(). Output:
  • vp_subst_det -> subst_det_id
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 07-AUG-2002 \param vp_subst_det data to insert into SUBST_DET_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_subst_det ( DA_T_subst_det *vp_subst_det, DA_T_errinfo *vp_errinfo) { return gda_insert_subst_det(con, vp_subst_det, vp_errinfo); } /********************************************************************* * Name : da_update_subst_det (SUBST_DET_TAB) * * Issue : 07-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by SUBST_DET_ID) in SUBST_DET_TAB * by data of passed record. * * - Before UPDATE is done * a) check by FIELD_ID, BLOCK_ID if master record in table * PARA_TREE_DEF_TAB exists. In case not -> cancel update! * b) check by SUBST_ID if master record in table SUBST_TAB * exists. In case not -> cancel update! * * - Update "MOD_DATE" in master record (SUBST_TAB) by SYSDATE * * * Parameter: vp_subst_det (i) new substancen data, containing SUBST_DET_ID * of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by SUBST_DET_ID) in SUBST_DET_TAB by data of passed record. Calls gda_update_subst_det(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 07-AUG-2002 \param vp_subst_det new substancen data, containing SUBST_DET_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_subst_det ( DA_T_subst_det *vp_subst_det, DA_T_errinfo *vp_errinfo) { return gda_update_subst_det(con, vp_subst_det, vp_errinfo); } /********************************************************************* * Name : da_free_subst_det (SUBST_DET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_subst_det()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_subst_det (i) pointer to "list of" substance det. records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_subst_det()". Calls gda_free_subst_det(). \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_subst_det pointer to "list of" substance det. records \return --- */ void da_free_subst_det ( DA_T_subst_det *vp_subst_det) { gda_free_subst_det(vp_subst_det); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: ENV_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_env (ENV_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of environment data from ENV_TAB order by ENV_ID * * Query conditions: * a) env_id =-1, is_templ='Y' return: 1..n records (templates) * env_id =-1, is_templ='N' return: 1..n records (non-templ.) * (is_tepml=DA_ALL -> ignore is_templ for selection!) * * b) env_id<>-1, is_templ='Y' return: 1 record (template) * env_id<>-1, is_templ='N' return: 1 record (non-templ.) * (is_tepml=DA_ALL -> ignore is_templ for selection!) * * Parameter: vp_env_id (i) ID of environment data to select * vp_is_templ (i) 'Y' => select templates only * 'N' => select non-templates only * vp_env (o) Return value (list of environment data) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of environment data from ENV_TAB order by ENV_ID. Calls gda_get_env(). Output:
  • vp_env - Return value (list of environment data)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_env_id ID of environment data to select \param vp_is_templ 'Y' => select templates only \n 'N' => select non-templates only \return DA_SUCCESS \n DA_FAIL */ int da_get_env (long vp_env_id, char vp_is_templ, DA_T_env **vp_env, DA_T_errinfo *vp_errinfo) { return gda_get_env(con, vp_env_id, vp_is_templ, vp_env, vp_errinfo); } /********************************************************************* * Name : da_insert_env (ENV_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into ENV_TAB. Return new "ENV_ID" by passed * struct, in case insert could successfully be done * * Parameter: vp_env (i/o) data to insert into ENV_TAB, * OUTPUT: * new env_id = ENV_SEQ.NEXTVAL * cre_date = SYSDATE * mod_date = SYSDATE * user_id = * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info (i) -> general information about database * user of current db-session * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into ENV_TAB. Calls gda_insert_env(). Output:
  • vp_env - new env_id, cre_date, mod_date, user_id (curr. db-user)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_env data to insert into ENV_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_env ( DA_T_env *vp_env, DA_T_errinfo *vp_errinfo) { return gda_insert_env(con, vp_env, vp_errinfo); } /********************************************************************* * Name : da_update_env (ENV_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by ENV_ID) in ENV_TAB * by data of passed record. * * Parameter: vp_env (i) new environment data, containing ENV_ID * of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by ENV_ID) in ENV_TAB by data of passed record. Calls gda_update_env(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_env new environment data, containing ENV_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_env ( DA_T_env *vp_env, DA_T_errinfo *vp_errinfo) { return gda_update_env(con, vp_env, vp_errinfo); } /********************************************************************* * Name : da_delete_env (ENV_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Delete record from ENV_TAB specified by "env_id" * * Parameter: vp_env_id (i) ENV_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from ENV_TAB specified by "env_id". Calls gda_delete_env(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_env_id ENV_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_env ( long vp_env_id, DA_T_errinfo *vp_errinfo) { return gda_delete_env(con, vp_env_id, vp_errinfo); } /********************************************************************* * Name : da_free_env (ENV_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_env()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_env (i) pointer to "list of" environment records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_env()". Calls gda_free_env(). \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_env pointer to "list of" environment records \return --- */ void da_free_env ( DA_T_env *vp_env) { gda_free_env(vp_env); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: ENV_DET_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_env_det (ENV_DET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of environment detail data from ENV_DET_TAB ordered * by ENV_DET_ID * * Query conditions: * a) env_id <>-1, env_det_id =-1; return: 1..n records * b) env_id <>-1, env_det_id<>-1; return: 1 records * * Parameter: vp_subst_id (i) ID of environment for which details shall * be selected * vp_env_det_id (i) ID of env. detail data to select * vp_env_det (o) Return value (list of environm. details) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of environment detail data from ENV_DET_TAB order by ENV_DET_ID. Calls gda_get_env_det(). Output:
  • vp_env_det - Return value (list of environment data)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_subst_id ID of environment for which details shall be selected \param vp_env_id ID of environment data to select \return DA_SUCCESS \n DA_FAIL */ int da_get_env_det (long vp_env_id, long vp_env_det_id, DA_T_env_det **vp_env_det, DA_T_errinfo *vp_errinfo) { return gda_get_env_det(con, vp_env_id, vp_env_det_id, vp_env_det, vp_errinfo); } /********************************************************************* * Name : da_insert_env_det (ENV_DET_TAB) * * Issue : 07-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : - Insert record into ENV_DET_TAB. Return new "ENV_DET_ID" * by passed struct, in case insert could successfully be * done. * * - Before INSERT is done * a) check by FIELD_ID, BLOCK_ID if master record in table * PARA_TREE_DEF_TAB exists. In case not -> cancel insert! * b) check by ENV_ID if master record in table ENV_TAB * exists. In case not -> cancel insert! * * - Update "MOD_DATE" in master record (ENV_TAB) by SYSDATE * * * Parameter: vp_env_det (i/o) data to insert into ENV_DET_TAB, * OUTPUT: * new env_det_id = ENV_DET_SEQ.NEXTVAL * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into ENV_DET_TAB. Calls gda_insert_env_det(). Output:
  • vp_env_det - new env_det_id
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 07-AUG-2002 \param vp_env data to insert into ENV_DET_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_env_det ( DA_T_env_det *vp_env_det, DA_T_errinfo *vp_errinfo) { return gda_insert_env_det(con, vp_env_det, vp_errinfo); } /********************************************************************* * Name : da_update_env_det (ENV_DET_TAB) * * Issue : 07-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by ENV_DET_ID) in ENV_DET_TAB * by data of passed record. * * - Before UPDATE is done * a) check by FIELD_ID, BLOCK_ID if master record in table * PARA_TREE_DEF_TAB exists. In case not -> cancel update! * b) check by ENV_ID if master record in table ENV_TAB * exists. In case not -> cancel update! * * - Update "MOD_DATE" in master record (ENV_TAB) by SYSDATE * * * Parameter: vp_env_det (i) new envirnm. detail data, containing ENV_DET_ID * of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by ENV_ID) in ENV_DET_TAB by data of passed record. Calls gda_update_env_det(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 07-AUG-2002 \param vp_env new environment detail data, containing ENV_DET_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_env_det ( DA_T_env_det *vp_env_det, DA_T_errinfo *vp_errinfo) { return gda_update_env_det(con, vp_env_det, vp_errinfo); } /********************************************************************* * Name : da_free_env_det (ENV_DET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_env_det()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_env_det (i) pointer to "list of" substance det. records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_env_det()". Calls gda_free_env_det(). \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_env pointer to "list of" substance det. records \return --- */ void da_free_env_det ( DA_T_env_det *vp_env_det) { gda_free_env_det(vp_env_det); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: MARKET_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_market (MARKET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of market data from MARKET_TAB ordered by MARKET_ID * * Query conditions: * a) catch_id <> -1 * disch_id = -1 * market_id = -1 * => return: 1..n records! * * b) catch_id <> -1 * disch_id <> -1 * market_id<> -1 * => return: 1 record! * * Parameter: vp_catch_id (i) ID of catchment to which market data * belong * vp_disch_id (i) ID of disch to which market data belong * vp_market_id (i) ID of market data record * vp_market (o) Return value (list of market data) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of market data from MARKET_TAB ordered by MARKET_ID. Calls gda_get_market(). Output:
  • vp_market - Return value (list of market data)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_catch_id ID of catchment to which market data belong \param vp_disch_id ID of disch to which market data belong \param vp_market_id ID of market data record \return DA_SUCCESS \n DA_FAIL */ int da_get_market (long vp_catch_id, long vp_disch_id, long vp_market_id, DA_T_market **vp_market, DA_T_errinfo *vp_errinfo) { return gda_get_market(con, vp_catch_id, vp_disch_id, vp_market_id, vp_market, vp_errinfo); } /********************************************************************* * Name : da_insert_market (MARKET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into MARKET_TAB. Return new "MARKET_ID" by * passed struct, in case insert could successfully be done. * * The new (inserted) market record will be automatically linked * to the specified session, because a market record must always * be linked to a session! * * Parameter: vp_market (i/o) data to insert into MARKET_TAB, * OUTPUT: (->MARKET_ID) * a) When record was first market record for * specified session: * -> MARKET_ID = * cre_date = SYSDATE * mod_date = SYSDATE * user_id = * * a) When record was additional market record * for specified session: * -> MARKET_ID = SESS_TAB.MARKET_ID * cre_date = SYSDATE * mod_date = SYSDATE * user_id = * * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info(i) -> general information about database * user of current db-session * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into MARKET_TAB. Calls gda_insert_market(). Output:
  • vp_market - MARKET_ID, cre_date, mod_date, user_id
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_sess_id ID of Session for MARKET_ID \param vp_market data to insert into MARKET_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_market ( long vp_sess_id, DA_T_market *vp_market, DA_T_errinfo *vp_errinfo) { return gda_insert_market(con,vp_sess_id,vp_market,vp_errinfo); } /********************************************************************* * Name : da_update_market (MARKET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by MARKET_ID) in MARKET_TAB * by data of passed record. * * Parameter: vp_market (i) new market data, containing MARKET_ID * of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by MARKET_ID) in MARKET_TAB by data of passed record. Calls gda_update_market(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_market new market data, containing MARKET_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_market ( DA_T_market *vp_market, DA_T_errinfo *vp_errinfo) { return gda_update_market(con, vp_market, vp_errinfo); } /********************************************************************* * Name : da_delete_market (MARKET_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Delete record from MARKET_TAB specified by "market_id" * * Delete condition: * ------------------ * CATCH_ID > 0, DISCH_ID > 0, MARKET_ID > 0 * * Parameter: vp_market_id (i) MARKET_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from MARKET_TAB specified by "market_id". Calls gda_delete_market(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_market vp_market_id MARKET_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_market ( long vp_catch_id, long vp_disch_id, long vp_market_id, DA_T_errinfo *vp_errinfo) { return gda_delete_market(con, vp_catch_id, vp_disch_id, vp_market_id, vp_errinfo); } /********************************************************************* * Name : da_free_market (MARKET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_market()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_market (i) pointer to "list of" market records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_market()". Calls gda_free_market(). \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_market pointer to "list of" market records \return --- */ void da_free_market ( DA_T_market *vp_market) { gda_free_market(vp_market); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: MOD_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_mod (MOD_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of model modes data from MOD_TAB ordered by MOD_ID * * Query conditions: * a) mod_id =-1; return: 1..n records * b) mod_id<>-1; return: 1 record * * Parameter: vp_mod_id (i) ID of model mode to select * vp_mod (o) Return value (list of model modes) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of model modes data from MOD_TAB ordered by MOD_ID. Calls gda_get_mod(). Output:
  • vp_mod - Return value (list of model modes)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_mod_id ID of model mode to select \return DA_SUCCESS \n DA_FAIL */ int da_get_mod (long vp_mod_id, DA_T_mod **vp_mod, DA_T_errinfo *vp_errinfo) { return gda_get_mod(con, vp_mod_id, vp_mod, vp_errinfo); } /********************************************************************* * Name : da_insert_mod (MOD_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into MOD_TAB. Return new "MOD_ID" by passed * struct, in case insert could successfully be done * * Parameter: vp_mod (i/o) data to insert into MOD_TAB, * OUTPUT: * - mod_id = MOD_SEQ.NEXTVAL * - cre_date = SYSDATE * - mod_date = SYSDATE * - user_id = * * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * vg_db_user_info(i) -> general information about database * user of current db-session * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into MOD_TAB. Calls gda_insert_mod(). Output:
  • vp_mod - mod_id, cre_date, mod_date, user_id (curr. db-user)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_mod data to insert into MOD_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_mod ( DA_T_mod *vp_mod, DA_T_errinfo *vp_errinfo) { return gda_insert_mod(con, vp_mod, vp_errinfo); } /********************************************************************* * Name : da_update_mod (MOD_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by MOD_ID) in MOD_TAB by data of * passed record. * * Parameter: vp_mod (i) new model mode data, containing MOD_ID * of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by MOD_ID) in MOD_TAB by data of passed record. Calls gda_update_mod(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_mod new model mode data, containing MOD_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_mod ( DA_T_mod *vp_mod, DA_T_errinfo *vp_errinfo) { return gda_update_mod(con, vp_mod, vp_errinfo); } /********************************************************************* * Name : da_delete_mod (MOD_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Delete record from MOD_TAB specified by "MOD_ID" * * Parameter: vp_mod_id (i) MOD_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from MOD_TAB specified by "MOD_ID". Calls gda_delete_mod(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_mod_id MOD_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_mod ( long vp_mod_id, DA_T_errinfo *vp_errinfo) { return gda_delete_mod(con, vp_mod_id, vp_errinfo); } /********************************************************************* * Name : da_free_mod (MOD_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_mod()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_mod (i) pointer to "list of" model mode records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_mod()". Calls gda_free_mod(). \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_mod pointer to "list of" model mode records \return --- */ void da_free_mod ( DA_T_mod *vp_mod) { gda_free_mod(vp_mod); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: MOD_DET_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_mod_det (MOD_DET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of environment detail data from MOD_DET_TAB ordered * by MOD_DET_ID * * Query conditions: * a) mod_id <>-1, mod_det_id =-1; return: 1..n records * b) mod_id <>-1, mod_det_id<>-1; return: 1 records * * Parameter: vp_mod_id (i) ID of model mode for which details shall * be selected * vp_mod_det_id (i) ID of model mode detail data to select * vp_mod_det (o) Return value (list of model mode details) * vp_errinfo (o) Error info in case of error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of environment detail data from MOD_DET_TAB ordered by MOD_DET_ID. Calls gda_get_mod_det(). Output:
  • vp_mod_det - Return value (list of model modes details)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_mod_id ID of model mode for which details shall be selected \param vp_mod_det_id ID of model mode detail data to select \return DA_SUCCESS \n DA_FAIL */ int da_get_mod_det (long vp_mod_id, long vp_mod_det_id, DA_T_mod_det **vp_mod_det, DA_T_errinfo *vp_errinfo) { return gda_get_mod_det(con, vp_mod_id, vp_mod_det_id, vp_mod_det, vp_errinfo); } /********************************************************************* * Name : da_insert_mod_det (MOD_DET_TAB) * * Issue : 07-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : - Insert record into MOD_DET_TAB. Return new "MOD_DET_ID" * by passed struct, in case insert could successfully be * done. * * - Before INSERT is done * a) check by FIELD_ID, BLOCK_ID if master record in table * PARA_TREE_DEF_TAB exists. In case not -> cancel insert! * b) check by MOD_ID if master record in table MOD_TAB * exists. In case not -> cancel insert! * * - Update "MOD_DATE" in master record (MOD_TAB) by SYSDATE * * * Parameter: vp_mod_det (i/o) data to insert into MOD_DET_TAB, * OUTPUT: * new env_det_id = MOD_DET_SEQ.NEXTVAL * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into MOD_DET_TAB. Calls gda_insert_mod_det(). Output:
  • vp_mod_det - new env_det_id
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 07-AUG-2002 \param vp_mod_det data to insert into MOD_DET_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_mod_det ( DA_T_mod_det *vp_mod_det, DA_T_errinfo *vp_errinfo) { return gda_insert_mod_det(con, vp_mod_det, vp_errinfo); } /********************************************************************* * Name : da_update_mod_det (MOD_DET_TAB) * * Issue : 07-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by MOD_DET_ID) in MOD_DET_TAB * by data of passed record. * * - Before UPDATE is done * a) check by FIELD_ID, BLOCK_ID if master record in table * PARA_TREE_DEF_TAB exists. In case not -> cancel update! * b) check by MOD_ID if master record in table MOD_TAB * exists. In case not -> cancel update! * * - Update "MOD_DATE" in master record (MOD_TAB) by SYSDATE * * * Parameter: vp_mod_det (i) new model mode detail data, containing * MOD_DET_ID of record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by MOD_ID) in MOD_TAB by data of passed record. Calls gda_update_mod_det(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 07-AUG-2002 \param vp_mod_det new model mode detail data, containing MOD_ID_DET of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_mod_det ( DA_T_mod_det *vp_mod_det, DA_T_errinfo *vp_errinfo) { return gda_update_mod_det(con, vp_mod_det, vp_errinfo); } /********************************************************************* * Name : da_free_mod_det (MOD_DET_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_mod_det()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_mod_det (i) pointer to "list of" model mode detail rec. * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_mod_det()". Calls gda_free_mod_det(). \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_mod_det pointer to "list of" model mode detail records \return --- */ void da_free_mod_det ( DA_T_mod_det *vp_mod_det) { gda_free_mod_det(vp_mod_det); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: RES_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_res (RES_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of results from RES_TAB. * * Query conditions: * a) res_id = -1, => return: 1..n records * b) res_id <>-1 => return: 1 record * * Parameter: vp_res_id (i) ID of result(s) to select * vp_res (o) Return value (list of results) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of results from RES_TAB. Calls gda_get_res(). Output:
  • vp_res - Return value (list of results)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_res_id ID of result(s) to select \return DA_SUCCESS \n DA_FAIL */ int da_get_res (long vp_res_id, DA_T_res **vp_res, DA_T_errinfo *vp_errinfo) { return gda_get_res(con, vp_res_id, vp_res, vp_errinfo); } /********************************************************************* * Name : da_insert_res (RES_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into RES_TAB. Return new "RES_ID" by passed * struct, in case insert could successfully be done * * Parameter: vp_sess_id (i) session to which result belongs * vp_res (i/o) data to insert into RES_TAB, * OUTPUT: * new res_id = RES_SEQ.NEXTVAL * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into RES_TAB. Calls gda_insert_res(). Output:
  • vp_res - new res_id
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_sess_id session to which result belongs \param vp_res data to insert into RES_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_res ( long vp_sess_id, DA_T_res *vp_res, DA_T_errinfo *vp_errinfo) { return gda_insert_res(con, vp_sess_id, vp_res, vp_errinfo); } /********************************************************************* * Name : da_update_res (RES_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by RES_ID) in RES_TAB by data of * passed record. * * Parameter: vp_res (i) new result containing RES_ID of record * to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by RES_ID) in RES_TAB by data of passed record. Calls gda_update_res(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_res new result containing RES_ID of record \return DA_SUCCESS \n DA_FAIL */ int da_update_res ( DA_T_res *vp_res, DA_T_errinfo *vp_errinfo) { return gda_update_res(con, vp_res, vp_errinfo); } /********************************************************************* * Name : da_delete_res (RES_TAB) * * Issue : 18-JUL-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Delete record from RES_TAB specified by "RES_ID". * Reference in SESS_TAB is also removed. * * Parameter: vp_res_id (i) RES_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from RES_TAB specified by "RES_ID". Calls gda_delete_res(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 18-JUL-2002 \param vp_res_id RES_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_res ( long vp_res_id, DA_T_errinfo *vp_errinfo ) { return gda_delete_res(con, vp_res_id, vp_errinfo); } /********************************************************************* * Name : da_free_res (RES_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_res()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_res (i) pointer to "list of" result records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_res()". Calls gda_free_res(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_res pointer to "list of" result records \return --- */ void da_free_res(DA_T_res *vp_res) { gda_free_res(vp_res); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: RES_STRETCH_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_res_stretch (RES_STRETCH_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of stretch results from RES_STRETCH_TAB. * * Query conditions: * a) res_stretch_id =-1; res_id <> -1; => return: 1..n records * b) res_stretch_id >-1; res_id <> -1; => return: 1 record * * Parameter: vp_res_stretch_id(i) ID of stretch result(s) to select * vp_res_id (i) ID of result to which stretch res. belongs * vp_res_stretch (o) Return value (list of results) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of stretch results from RES_STRETCH_TAB. Calls gda_get_res_stretch(). Output:
  • vp_res_stretch - Return value (list of results)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_res_stretch_id ID of stretch result(s) to select \param vp_res_id ID of result to which stretch res. belongs \return DA_SUCCESS \n DA_FAIL */ int da_get_res_stretch (long vp_res_id, long vp_res_stretch_id, DA_T_res_stretch **vp_res_stretch, DA_T_errinfo *vp_errinfo) { return gda_get_res_stretch(con, vp_res_id, vp_res_stretch_id, vp_res_stretch, vp_errinfo); } /********************************************************************* * Name : da_insert_res_stretch (RES_STRETCH_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into RES_STRETCH_TAB. Return new "RES_STRETCH_ID" * by passed struct, in case insert could successfully be done * * Parameter: vp_res_stretch (i/o) data to insert into RES_STRETCH_TAB, * OUTPUT: * new res_stretch_id = RES_STRETCH_SEQ.NEXTVAL * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into RES_STRETCH_TAB. Calls gda_insert_res_stretch(). Output:
  • vp_res_stretch - new res_stretch_id
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_res_stretch data to insert into RES_STRETCH_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_res_stretch ( DA_T_res_stretch *vp_res_stretch, DA_T_errinfo *vp_errinfo) { return gda_insert_res_stretch(con, vp_res_stretch, vp_errinfo); } /********************************************************************* * Name : da_insert_bulk_res_stretch RES_STRETCH_TAB) * * Issue : 21-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Insert list of records into RES_STRETCH_TAB. Return new * "RES_STRETCH_ID"s by passed list of structs, in case insert * could successfully be done * * Parameter: vp_res_stretch (i/o) data to insert into RES_STRETCH_TAB, * OUTPUT: * new res_stretch_id = RES_STRETCH_SEQ.NEXTVAL * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert list of records into RES_STRETCH_TAB. Calls gda_insert_bulk_res_stretch(). Output:
  • vp_res_stretch - new res_stretch_id
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 21-OCT-2002 \param vp_res_stretch data to insert into RES_STRETCH_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_bulk_res_stretch ( DA_T_res_stretch *vp_res_stretch, DA_T_errinfo *vp_errinfo) { return gda_insert_bulk_res_stretch(con, vp_res_stretch, vp_errinfo); } /********************************************************************* * Name : da_update_res_stretch (RES_STRETCH_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by RES_STRETCH_ID) in RES_STRETCH_TAB * by data of passed record. * * Parameter: vp_res_stretch (i) new result containing RES_STRETCH_ID of * record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by RES_STRETCH_ID) in RES_STRETCH_TAB by data of passed record. Calls gda_update_res_stretch(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_res_stretch new result containing RES_STRETCH_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_res_stretch ( DA_T_res_stretch *vp_res_stretch, DA_T_errinfo *vp_errinfo) { return gda_update_res_stretch(con, vp_res_stretch, vp_errinfo); } /********************************************************************* * Name : da_free_res_stretch (RES_STRETCH_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_res_stretch()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_res_stretch (i) pointer to "list of" result records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_res_stretch()". Calls gda_free_res_stretch(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_res_stretch pointer to "list of" result records \return --- */ void da_free_res_stretch(DA_T_res_stretch *vp_res_stretch) { gda_free_res_stretch(vp_res_stretch); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: RES_DISCH_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_res_disch (RES_DISCH_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of disch results from RES_DISCH_TAB. * * Query conditions: * a) res_disch_id =-1; res_id <> -1; => return: 1..n records * b) res_disch_id >-1; res_id <> -1; => return: 1 record * * Parameter: vp_res_disch_id (i) ID of disch result(s) to select * vp_res_id (i) ID of result to which disch res. belongs * vp_res_disch (o) Return value (list of results) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of disch results from RES_DISCH_TAB. Calls gda_get_res_disch(). Output:
  • vp_res_disch - Return value (list of results)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_res_disch_id ID of disch result(s) to select \param vp_res_id ID of result to which disch res. belongs \return DA_SUCCESS \n DA_FAIL */ int da_get_res_disch (long vp_res_id, long vp_res_disch_id, DA_T_res_disch **vp_res_disch, DA_T_errinfo *vp_errinfo) { return gda_get_res_disch(con, vp_res_id, vp_res_disch_id, vp_res_disch, vp_errinfo); } /********************************************************************* * Name : da_insert_res_disch (RES_DISCH_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Insert record into RES_DISCH_TAB. Return new "RES_DISCH_ID" * by passed struct, in case insert could successfully be done * * Parameter: vp_res_disch (i/o) data to insert into RES_DISCH_TAB, * OUTPUT: * new "res_disch_id" = RES_DISCH_SEQ.NEXTVAL * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into RES_DISCH_TAB. Calls gda_insert_res_disch(). Output:
  • vp_res_disch - new res_disch_id
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_res_disch data to insert into RES_DISCH_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_res_disch ( DA_T_res_disch *vp_res_disch, DA_T_errinfo *vp_errinfo) { return gda_insert_res_disch(con, vp_res_disch, vp_errinfo); } /********************************************************************* * Name : da_update_res_disch (RES_DISCH_TAB) * * Issue : 06-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Update record (specified by RES_DISCH_ID) in RES_DISCH_TAB * by data of passed record. * * Parameter: vp_res_disch (i) new result containing RES_DISCH_ID of * record to update * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by RES_DISCH_ID) in RES_DISCH_TAB by data of passed record. Calls gda_update_res_disch(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 06-AUG-2002 \param vp_res_disch new result containing RES_DISCH_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_res_disch ( DA_T_res_disch *vp_res_disch, DA_T_errinfo *vp_errinfo) { return gda_update_res_disch(con, vp_res_disch, vp_errinfo); } /********************************************************************* * Name : da_free_res_disch (RES_DISCH_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_res_disch()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_res_disch (i) pointer to "list of" result records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_res_disch()". Calls gda_free_res_disch(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_res_disch pointer to "list of" result records \return --- */ void da_free_res_disch(DA_T_res_disch *vp_res_disch) { gda_free_res_disch(vp_res_disch); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: USER_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_user (USER_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of user data from USER_TAB. * * Query conditions: * a) user_id = "" => return: 1..n records * b) user_id <> "" => return: 1 record * * Parameter: vp_user_id (i) ID of user to select * vp_user (o) Return value (list of users) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of user data from USER_TAB. Calls gda_get_user(). Output:
  • vp_user - Return value (list of users)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_user_id ID of user to select \return DA_SUCCESS \n DA_FAIL */ int da_get_user (char *vp_user_id, DA_T_user **vp_user, DA_T_errinfo *vp_errinfo) { return gda_get_user(con, vp_user_id, vp_user, vp_errinfo); } /********************************************************************* * Name : da_free_user (USER_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_user()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_user (i) pointer to "list of" user data records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_user()". Calls gda_free_user(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_user pointer to "list of" user data records \return --- */ void da_free_user(DA_T_user *vp_user) { gda_free_user(vp_user); } /********************************************************************* * Name : da_insert_user (USER_TAB) * * Issue : 27-SEP-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Insert record into USER_TAB. * * Parameter: vp_user (i/o) data to insert into USER_TAB * OUTPUT: * - cre_date = SYSDATE * - mod_date = SYSDATE * vp_password (i) new user's password * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into USER_TAB. Calls gda_insert_user(). Output:
  • vp_user - cre_date, mod_date
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 27-SEP-2002 \param vp_password new user's password \return DA_SUCCESS \n DA_FAIL */ int da_insert_user(DA_T_user *vp_user, char *vp_password, DA_T_errinfo *vp_errinfo) { return gda_insert_user(con, vp_user, vp_password, vp_errinfo); } /********************************************************************* * Name : da_update_user (USER_TAB) * * Issue : 30-SEP-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by USER_ID) in USER_TAB * by data of passed record. * * Parameter: vp_user (i/o) new user data, containing USER_ID of * record to update. * OUTPUT: vp_user.MOD_DATE = SYSDATE * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by USER_ID) in USER_TAB by data of passed record. Calls gda_update_user(). Output:
  • vp_user - mod_date
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 30-SEP-2002 \param vp_user new user data, containing USER_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_user ( DA_T_user *vp_user, DA_T_errinfo *vp_errinfo) { return gda_update_user(con, vp_user, vp_errinfo); } /********************************************************************* * Name : da_delete_user (USER_TAB) * * Issue : 30-SEP-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from USER_TAB specified by "user_id" * * Parameter: vp_user_id (i) USER_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from USER_TAB specified by "user_id". Calls gda_delete_user(). Output:
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 30-SEP-2002 \param vp_user_id USER_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_user ( char *vp_user_id, DA_T_errinfo *vp_errinfo) { return gda_delete_user(con, vp_user_id, vp_errinfo); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: GROUP_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_group (GROUP_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of group data from GROUP_TAB. * * Query conditions: * a) group_id = -1; => return: 1..n records * b) group_id <>-1; => return: 1 record * * Parameter: vp_group_id (i) ID of group to select * vp_group (o) Return value (list of group data) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of group data from GROUP_TAB. Calls gda_get_group(). Output:
  • vp_group - Return value (list of group data)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_group_id ID of group to select \return DA_SUCCESS \n DA_FAIL */ int da_get_group (long vp_group_id, DA_T_group **vp_group, DA_T_errinfo *vp_errinfo) { return gda_get_group(con, vp_group_id, vp_group, vp_errinfo); } /********************************************************************* * Name : da_free_group (GROUP_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "db_get_group()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_group (i) pointer to "list of" group data records * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "db_get_group()". Calls gda_free_group(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_group pointer to "list of" group data records \return --- */ void da_free_group(DA_T_group *vp_group) { gda_free_group(vp_group); } /********************************************************************* * Name : da_insert_group (GROUP_TAB) * * Issue : 30-SEP-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Insert record into GROUP_TAB. * * Parameter: vp_group (i/o) data to insert into GROUP_TAB * OUTPUT: * - cre_date = SYSDATE * - mod_date = SYSDATE * - group_id: from GROUP_SEQ * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into GROUP_TAB. Calls gda_insert_group(). Output:
  • vp_group - cre_date, mod_date, group_id
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 30-SEP-2002 \param vp_group data to insert into GROUP_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_group(DA_T_group *vp_group, DA_T_errinfo *vp_errinfo) { return gda_insert_group(con, vp_group, vp_errinfo); } /********************************************************************* * Name : da_update_group (GROUP_TAB) * * Issue : 30-SEP-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by GROUP_ID) in GROUP_TAB * by data of passed record. * * Parameter: vp_group (i/o) new group data, containing GROUP_ID of * record to update. * OUTPUT: vp_group.MOD_DATE = SYSDATE * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by GROUP_ID) in GROUP_TAB by data of passed record. Calls gda_update_group(). Output:
  • vp_group - mod_date
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 30-SEP-2002 \param vp_group new group data, containing GROUP_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_group ( DA_T_group *vp_group, DA_T_errinfo *vp_errinfo) { return gda_update_group(con, vp_group, vp_errinfo); } /********************************************************************* * Name : da_delete_group (GROUP_TAB) * * Issue : 01-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from GROUP_TAB specified by "group_id" * * Parameter: vp_group_id (i) GROUP_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from GROUP_TAB specified by "group_id". Calls gda_delete_group(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_group_id GROUP_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_group ( long vp_group_id, DA_T_errinfo *vp_errinfo) { return gda_delete_group(con, vp_group_id, vp_errinfo); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: MESSAGE_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_message (MESSAGE_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get list of messages from MESSAGE_TAB. * * Query conditions: * - message_id <>-1; => return: 1 record * * Parameter: vp_message_id (i) ID of message to select * vp_language (i) language of message to select * vp_message (o) Return value (one message) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of messages from MESSAGE_TAB. Calls gda_get_message(). Output:
  • vp_message - Return value (one message)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_message_id ID of message to select \param vp_language language of message to select \return DA_SUCCESS \n DA_FAIL */ int da_get_message (long vp_message_id, char *vp_language, DA_T_message *vp_message, DA_T_errinfo *vp_errinfo) { return gda_get_message(con, vp_message_id, vp_language, vp_message, vp_errinfo); } /********************************************************************* * Name : da_insert_message (MESSAGE_TAB) * * Issue : 01-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Insert record into MESSAGE_TAB. * * Parameter: vp_message (i) data to insert into MESSAGE_TAB * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into MESSAGE_TAB. Calls gda_insert_message(). Output:
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 01-OCT-2002 \param vp_message data to insert into MESSAGE_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_message(DA_T_message vp_message, DA_T_errinfo *vp_errinfo) { return gda_insert_message(con, vp_message, vp_errinfo); } /********************************************************************* * Name : da_update_message (MESSAGE_TAB) * * Issue : 01-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by MESSAGE_ID) in MESSAGE_TAB * by data of passed record. * * Parameter: vp_message (i) new message data * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by MESSAGE_ID) in MESSAGE_TAB by data of passed record. Calls gda_update_message(). Output:
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 01-OCT-2002 \param vp_message new message data \return DA_SUCCESS \n DA_FAIL */ int da_update_message( DA_T_message vp_message, DA_T_errinfo *vp_errinfo) { return gda_update_message(con, vp_message, vp_errinfo); } /********************************************************************* * Name : da_delete_message (MESSAGE_TAB) * * Issue : 01-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from MESSAGE_TAB specified by "message_id" * * Parameter: vp_group_id (i) MESSAGE_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from MESSAGE_TAB specified by "message_id". Calls gda_delete_message(). Output:
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_message_id MESSAGE_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_message( long vp_message_id, DA_T_errinfo *vp_errinfo) { return gda_delete_message(con, vp_message_id, vp_errinfo); } /********************************************************************* * Name : da_get_all_messages (MESSAGE_TAB) * * Issue : 21-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Get list of all message data from MESSAGE_TAB. * * Parameter: vp_message (o) Return value (list of message data) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get list of all message data from MESSAGE_TAB. Calls gda_get_all_messages(). Output:
  • vp_message - Return value (list of message data)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \return DA_SUCCESS \n DA_FAIL */ int da_get_all_messages (DA_T_message_list **vp_message, DA_T_errinfo *vp_errinfo) { return gda_get_all_messages(con, vp_message, vp_errinfo); } /********************************************************************* * Name : da_free_all_messages (MESSAGE_TAB) * * Issue : 21-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "da_get_all_messages()". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_message_list (i) pointer to "list of" message data records * * Return : nothing * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "da_get_all_messages()".. Calls gda_free_message(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_message pointer to "list of" message data records \return --- */ void da_free_all_messages (DA_T_message_list *vp_message) { gda_free_all_messages(vp_message); } /* ----------------------------------------------------------------- * * ----------------------------------------------------------------- * * FUNCTIONS to access table: PHRASE_TAB * ----------------------------------------------------------------- * * ----------------------------------------------------------------- */ /********************************************************************* * Name : da_get_phrase (PHRASE_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get single phrase from PHRASE_TAB * * Query conditions: * - phrase_id >0, language <> ""; => return: 1 record * * Parameter: vp_phrase_id (i) ID of phrase to select * vp_language (i) language of phrase to select * vp_phrase (o) Return value (single phrases) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get single phrase from PHRASE_TAB. Calls gda_get_phrase(). Output:
  • vp_phrase - Return value (single phrases)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_phrase_id ID of phrase to select \param vp_language language of phrase to select \return DA_SUCCESS \n DA_FAIL */ int da_get_phrase (long vp_phrase_id, char *vp_language, DA_T_phrase *vp_phrase, DA_T_errinfo *vp_errinfo) { return gda_get_phrase(con, vp_phrase_id, vp_language, vp_phrase, vp_errinfo); } /********************************************************************* * Name : da_get_phrase_grp (PHRASE_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Get group phrases (list of values) from PHRASE_TAB * * Query conditions: * a) phrase_grp_id >0; => return: 1..n records * * Parameter: vp_phrase_grp_id (i) ID of phrase grp. from which * phrases has to be selected * vp_phrase_grp (o) Return value (list of phrases) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get group phrases (list of values) from PHRASE_TAB. Calls gda_get_phrase_grp(). Output:
  • vp_phrase_grp - Return value (list phrases)
  • vp_errinfo - Error info in case of error occured \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_phrase_grp_id ID of phrase grp. from which phrases has to be selected \return DA_SUCCESS \n DA_FAIL */ int da_get_phrase_grp (long vp_phrase_grp_id, char *vp_language, DA_T_phrase **vp_phrase_grp, DA_T_errinfo *vp_errinfo) { return gda_get_phrase_grp(con, vp_phrase_grp_id, vp_language, vp_phrase_grp, vp_errinfo); } /********************************************************************* * Name : da_get_all_phrases (PHRASE_TAB) * * Issue : 03-DEC-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Get all phrases (of a specified language) from PHRASE_TAB * * Parameter: vp_language (i) specifies the the language of the * phrases * vp_language = "%" ==> get all phrases * vp_phrase_grp (o) Return value (list of phrases) * vp_errinfo (o) Error info in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Get all phrases (of a specified language) from PHRASE_TAB. Calls gda_get_all_phrase(). Output:
  • vp_phrase_grp - Return value (list phrases)
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 03-DEC-2002 \param vp_language specifies the the language of the phrases \return DA_SUCCESS \n DA_FAIL */ int da_get_all_phrases (char *vp_language, DA_T_phrase **vp_phrase_grp, DA_T_errinfo *vp_errinfo) { return gda_get_all_phrases(con, vp_language, vp_phrase_grp, vp_errinfo); } /********************************************************************* * Name : da_free_phrase_grp (PHRASE_TAB) * * Issue : 01-AUG-2002 - T.V. - TechniData AG/Markdorf * * Purpose : Free memory allocated by function "da_get_phrase_grp()" * or "da_get_all_phrases". * Pointer must be explizitely set to NULL in the calling * program after calling this function. * * Parameter: vp_group (i) pointer to "list of" phrases * * Return : none * Globals : none * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Free memory allocated by function "da_get_phrase_grp()" or "gda_get_all_phrases". Calls gda_free_phrase_grp(). \author T.V. - TechniData AG/Markdorf \date 01-AUG-2002 \param vp_group pointer to "list of" phrases \return --- */ void da_free_phrase_grp (DA_T_phrase *vp_phrase_grp) { gda_free_phrase_grp(vp_phrase_grp); } /********************************************************************* * Name : da_insert_phrase (PHRASE_TAB) * * Issue : 02-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Insert record into PHRASE_TAB. * * Parameter: vp_phrase (i/o) data to insert into PHRASE_TAB * OUTPUT: * - phrase_id: from PHRASE_SEQ * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Insert record into PHRASE_TAB. Calls gda_insert_phrase(). Output:
  • vp_phrase - phrase_id
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 02-OCT-2002 \param vp_phrase data to insert into PHRASE_TAB \return DA_SUCCESS \n DA_FAIL */ int da_insert_phrase (DA_T_phrase *vp_phrase, DA_T_errinfo *vp_errinfo) { return gda_insert_phrase(con, vp_phrase, vp_errinfo); } /********************************************************************* * Name : da_update_phrase (PHRASE_TAB) * * Issue : 02-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Update record (specified by PHRASE_ID) in PHRASE_TAB * by data of passed record. * * Parameter: vp_user (i) new phrase, containing PHRASE_ID of * record to update. * vp_errinfo (o) error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Update record (specified by PHRASE_ID) in PHRASE_TAB by data of passed record. Calls gda_update_phrase(). Output:
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 02-OCT-2002 \param vp_phrase new phrase, containing PHRASE_ID of record to update \return DA_SUCCESS \n DA_FAIL */ int da_update_phrase ( DA_T_phrase vp_phrase, DA_T_errinfo *vp_errinfo) { return gda_update_phrase(con, vp_phrase, vp_errinfo); } /********************************************************************* * Name : da_delete_phrase (PHRASE_TAB) * * Issue : 02-OCT-2002 - T.L. - TechniData AG/Markdorf * * Purpose : Delete record from PHRASE_TAB specified by "phrase_id" * * Parameter: vp_phrase_id (i) GROUP_ID of record to delete * vp_errinfo (o) Error information in case error occured * * Return : success => DA_SUCCESS * fail => DA_FAIL * * Globals : errln * * Changes : * [DD-MON-YYYY] - [ Name ] - [ Action ] *********************************************************************/ /*! \brief Delete record from PHRASE_TAB specified by "phrase_id". Calls gda_delete_phrase(). Output:
  • vp_errinfo - Error info in case of error occured \author T.L. - TechniData AG/Markdorf \date 02-OCT-2002 \param vp_phrase_id GROUP_ID of record to delete \return DA_SUCCESS \n DA_FAIL */ int da_delete_phrase ( long vp_phrase_id, DA_T_errinfo *vp_errinfo) { return gda_delete_phrase(con, vp_phrase_id, vp_errinfo); }