tldm-universe/Ardent/UV/gcidir/include/uvsql.h

69 lines
2.3 KiB
C
Raw Normal View History

2024-09-09 21:51:08 +00:00
#ifndef sql_global
#define sql_global
/******************************************************************************
*
* Declarations of UniVerse/SQL variables and typedefs
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intented
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/14/98 23801 SAP Change copyrights.
* 09/25/91 8710 RM Support for SQLerror, SQLwarning, SQLcode, SQLstate
*
*****************************************************************************/
#define NUM_DIAGS 9 /* number of exceptions held */
#define SQLFIN 0 /* successful completion */
#define SQLFATAL 1 /* emulate fatal() */
#define SQLERRNO 2 /* test for m*() print errno */
#define SQLMFATAL 3 /* emulate mfatal() */
#define SQLWARNING 4 /* emulate warning() */
#define SQLMWARNING 6 /* emulate mwarning() */
typedef struct uvsqldiagnostic
{
STRING sqlstate; /* returned sqlstate */
STRING origin; /* ISO or UV msg_no */
STRING catalog; /* name of catalog referenced */
STRING schema; /* name of schema referenced */
STRING table; /* name of table referenced */
STRING column; /* name of column referenced */
STRING cursor; /* name of cursor referenced */
STRING message; /* text of error message */
} UVSQLDIAGNOSTIC;
typedef struct diagnostics
{
int number; /* number of entries */
int more; /* more not stored? [Y/N] */
int row_count; /* number of items selected */
STRING function; /* bnf name of statement */
UVSQLDIAGNOSTIC *condition[NUM_DIAGS]; /* address of data */
} DIAGNOSTICS;
typedef union uvsqld
{
int number; /* return NUMBER, MORE, ROWCOUNT*/
STRING text; /* return single identifer */
UVSQLDIAGNOSTIC *condition; /* return whole condition */
} UVSQLD;
EXTERN int SQLerror;
EXTERN int SQLwarning;
EXTERN int SQLcode;
EXTERN char SQLstate[];
EXTERN DIAGNOSTICS Diagnostics;
#endif /* end of uvsql.h */