This function sets dynamic sizes for strings based on the Oracle version and statement case. It contains a switch statement to select the appropriate string size based on the version and statement case. The sizes are stored in a static character array that is returned. The sizes vary between statements and Oracle versions.
This function sets a static character string called dyn_proc_func based on the input version and sentencia. It uses a switch statement to check the sentencia and sometimes the version, and copies different strings to dyn_proc_func depending on the case. For some cases like CASE_INSTANCE_STATUS and CASE_ACTIVE_TRANSACTIONS, it copies a string with the format "|SI|<column number>-1|<function number>|" to dyn_proc_func to indicate it needs to process a new select statement.
This C function sets dynamic titles for Oracle database monitoring reports. It takes a case number as input and uses a switch statement to return the appropriate title as a string. There are over 50 different case options that map monitoring statistics like "Oracle Version", "Active Parameters", "Datafile I/O", "Wait Events", and "SQL Area CPU Usage" to static title strings. The titles are returned in a character array for use in reporting interfaces.
This C code defines a function called "formatear_sql_statement" that takes in a character pointer and returns a formatted SQL statement string. It removes whitespace from the input, and inserts newline characters before certain SQL keywords like "SELECT", "FROM", etc. to make the statement more readable. Local variables are used to track positions within the strings and characters as it iterates through the input to add formatting and build up the output SQL statement string.
Este código C contém uma função chamada esperar_seg que imprime uma mensagem e faz o programa dormir por um número especificado de segundos passado como parâmetro, usando a função Sleep do Windows.
This document contains C code for loading sentences or queries into dynamic variables based on the input parameters. It includes a switch statement with 8 cases that set the values of dynamic variables like dyn_column, dyn_title, dyn_sts, and dyn_size based on the input sentence number. These dynamic variables are used to define SQL queries and reports on Oracle database instance statistics and performance metrics.
This function sets dynamic sizes for strings based on the Oracle version and statement case. It contains a switch statement to select the appropriate string size based on the version and statement case. The sizes are stored in a static character array that is returned. The sizes vary between statements and Oracle versions.
This function sets a static character string called dyn_proc_func based on the input version and sentencia. It uses a switch statement to check the sentencia and sometimes the version, and copies different strings to dyn_proc_func depending on the case. For some cases like CASE_INSTANCE_STATUS and CASE_ACTIVE_TRANSACTIONS, it copies a string with the format "|SI|<column number>-1|<function number>|" to dyn_proc_func to indicate it needs to process a new select statement.
This C function sets dynamic titles for Oracle database monitoring reports. It takes a case number as input and uses a switch statement to return the appropriate title as a string. There are over 50 different case options that map monitoring statistics like "Oracle Version", "Active Parameters", "Datafile I/O", "Wait Events", and "SQL Area CPU Usage" to static title strings. The titles are returned in a character array for use in reporting interfaces.
This C code defines a function called "formatear_sql_statement" that takes in a character pointer and returns a formatted SQL statement string. It removes whitespace from the input, and inserts newline characters before certain SQL keywords like "SELECT", "FROM", etc. to make the statement more readable. Local variables are used to track positions within the strings and characters as it iterates through the input to add formatting and build up the output SQL statement string.
Este código C contém uma função chamada esperar_seg que imprime uma mensagem e faz o programa dormir por um número especificado de segundos passado como parâmetro, usando a função Sleep do Windows.
This document contains C code for loading sentences or queries into dynamic variables based on the input parameters. It includes a switch statement with 8 cases that set the values of dynamic variables like dyn_column, dyn_title, dyn_sts, and dyn_size based on the input sentence number. These dynamic variables are used to define SQL queries and reports on Oracle database instance statistics and performance metrics.
This document contains default value definitions for new objects in a Microsoft Visual C++ generated include file that is used by a resource file called orastat01.rc. It defines the next default numeric values to use for new resources, commands, controls and symbols as 101, 40001, 1001 and 101 respectively.
This document contains the source code for a function that dynamically generates SQL statements based on input parameters. The function takes in a version number, statement ID, and optional parameters. It then uses a switch statement to select the correct SQL text to return based on the statement ID. The SQL statements are for various monitoring and diagnostic queries against Oracle views like V$SESSION, V$PARAMETER, V$INSTANCE, etc. The function contains logic to generate slightly different SQL for different Oracle versions.
This function sets dynamic columns for SQL statements depending on the Oracle version and statement case. It uses a switch statement to select the correct columns for each case and Oracle version combination. The columns are stored in a static character array that is returned. Various column layouts are defined for different Oracle versions and monitoring statements.
Este código define uma função chamada decode_lock_mode que recebe um número como entrada e retorna uma string descrevendo o modo de bloqueio correspondente. A função usa um switch para mapear cada caso de entrada para uma string como "No Lock", "Row Share" etc.
Este código C contém uma função que decodifica um número em uma string de comando SQL. A função usa um switch case para mapear cada caso de número para um comando SQL específico e retorna a string codificada.
The document defines 100 constants used for SQL statements in a database monitoring and management system. The constants are numbered and provide short descriptions for various SQL statements to retrieve information about the database, including status of datafiles, users, sessions, locks, performance metrics, and more. Constants were added over time with the latest additions in 2005 to cover additional statements for monitoring buffer cache and optimizer settings.
This document defines constants used to identify different types of Oracle database monitoring metrics and reports. There are over 60 constants defined for metrics related to database version, users, sessions, wait events, file usage, SQL statements, privileges, locking, performance, and more. The constants are used to select specific reports on database activity and resource usage.
This C program defines a function called ver_menu_opcion that takes an integer parameter called opcion_menu. Based on the value of opcion_menu, the function uses a switch statement to copy a descriptive string into a character array called dyn_title0. The string provides a title for the corresponding menu option. The function then returns dyn_title0 to display the selected menu title.
This document contains C code definitions for interfaces used to connect to an Oracle database and execute SQL statements. It defines structures for result sets, threads, objects, bindings for PL/SQL records, file and package names. It also includes SQLLIB prototypes and constants for error codes. The cud array contains compilation data and the code includes header files for Oracle libraries and functions.
This document contains default value definitions for new objects in a Microsoft Visual C++ generated include file that is used by a resource file called orastat01.rc. It defines the next default numeric values to use for new resources, commands, controls and symbols as 101, 40001, 1001 and 101 respectively.
This document contains the source code for a function that dynamically generates SQL statements based on input parameters. The function takes in a version number, statement ID, and optional parameters. It then uses a switch statement to select the correct SQL text to return based on the statement ID. The SQL statements are for various monitoring and diagnostic queries against Oracle views like V$SESSION, V$PARAMETER, V$INSTANCE, etc. The function contains logic to generate slightly different SQL for different Oracle versions.
This function sets dynamic columns for SQL statements depending on the Oracle version and statement case. It uses a switch statement to select the correct columns for each case and Oracle version combination. The columns are stored in a static character array that is returned. Various column layouts are defined for different Oracle versions and monitoring statements.
Este código define uma função chamada decode_lock_mode que recebe um número como entrada e retorna uma string descrevendo o modo de bloqueio correspondente. A função usa um switch para mapear cada caso de entrada para uma string como "No Lock", "Row Share" etc.
Este código C contém uma função que decodifica um número em uma string de comando SQL. A função usa um switch case para mapear cada caso de número para um comando SQL específico e retorna a string codificada.
The document defines 100 constants used for SQL statements in a database monitoring and management system. The constants are numbered and provide short descriptions for various SQL statements to retrieve information about the database, including status of datafiles, users, sessions, locks, performance metrics, and more. Constants were added over time with the latest additions in 2005 to cover additional statements for monitoring buffer cache and optimizer settings.
This document defines constants used to identify different types of Oracle database monitoring metrics and reports. There are over 60 constants defined for metrics related to database version, users, sessions, wait events, file usage, SQL statements, privileges, locking, performance, and more. The constants are used to select specific reports on database activity and resource usage.
This C program defines a function called ver_menu_opcion that takes an integer parameter called opcion_menu. Based on the value of opcion_menu, the function uses a switch statement to copy a descriptive string into a character array called dyn_title0. The string provides a title for the corresponding menu option. The function then returns dyn_title0 to display the selected menu title.
This document contains C code definitions for interfaces used to connect to an Oracle database and execute SQL statements. It defines structures for result sets, threads, objects, bindings for PL/SQL records, file and package names. It also includes SQLLIB prototypes and constants for error codes. The cud array contains compilation data and the code includes header files for Oracle libraries and functions.
1. funciones_auxiliares.c
/* Result Sets Interface */
#ifndef SQL_CRSR
# define SQL_CRSR
struct sql_cursor
{
unsigned int curocn;
void *ptr1;
void *ptr2;
unsigned int magic;
};
typedef struct sql_cursor sql_cursor;
typedef struct sql_cursor SQL_CURSOR;
#endif /* SQL_CRSR */
/* Thread Safety */
typedef void * sql_context;
typedef void * SQL_CONTEXT;
/* Object support */
struct sqltvn
{
unsigned char *tvnvsn;
unsigned short tvnvsnl;
unsigned char *tvnnm;
unsigned short tvnnml;
unsigned char *tvnsnm;
unsigned short tvnsnml;
};
typedef struct sqltvn sqltvn;
struct sqladts
{
unsigned int adtvsn;
unsigned short adtmode;
unsigned short adtnum;
sqltvn adttvn[1];
};
typedef struct sqladts sqladts;
static struct sqladts sqladt = {
1,0,0,
};
/* Binding to PL/SQL Records */
struct sqltdss
{
unsigned int tdsvsn;
unsigned short tdsnum;
unsigned char *tdsval[1];
};
typedef struct sqltdss sqltdss;
static struct sqltdss sqltds =
{
1,
0,
};
/* File name & Package Name */
struct sqlcxp
{
unsigned short fillen;
char filnam[24];
};
static const struct sqlcxp sqlfpn =
{
23,
"funciones_auxiliares.pc"
Página 1
2. funciones_auxiliares.c
};
static unsigned int sqlctx = 628383107;
static struct sqlexd {
unsigned int sqlvsn;
unsigned int arrsiz;
unsigned int iters;
unsigned int offset;
unsigned short selerr;
unsigned short sqlety;
unsigned int occurs;
const short *cud;
unsigned char *sqlest;
const char *stmt;
sqladts *sqladtp;
sqltdss *sqltdsp;
void **sqphsv;
unsigned int *sqphsl;
int *sqphss;
void **sqpind;
int *sqpins;
unsigned int *sqparm;
unsigned int **sqparc;
unsigned short *sqpadto;
unsigned short *sqptdso;
unsigned int sqlcmax;
unsigned int sqlcmin;
unsigned int sqlcincr;
unsigned int sqlctimeout;
unsigned int sqlcnowait;
int sqfoff;
unsigned int sqcmod;
unsigned int sqfmod;
void *sqhstv[1];
unsigned int sqhstl[1];
int sqhsts[1];
void *sqindv[1];
int sqinds[1];
unsigned int sqharm[1];
unsigned int *sqharc[1];
unsigned short sqadto[1];
unsigned short sqtdso[1];
} sqlstm = {12,1};
/* SQLLIB Prototypes */
extern void sqlcxt (void **, unsigned int *,
struct sqlexd *, const struct sqlcxp *);
extern void sqlcx2t(void **, unsigned int *,
struct sqlexd *, const struct sqlcxp *);
extern void sqlbuft(void **, char *);
extern void sqlgs2t(void **, char *);
extern void sqlorat(void **, unsigned int *, void *);
/* Forms Interface */
static const int IAPSUCC = 0;
static const int IAPFAIL = 1403;
static const int IAPFTL = 535;
extern void sqliem(char *, int *);
typedef struct { unsigned short len; unsigned char arr[1]; } VARCHAR;
typedef struct { unsigned short len; unsigned char arr[1]; } varchar;
/* cud (compilation unit data) array */
static const short sqlcud0[] =
{12,4242,178,1,0,
Página 2
3. funciones_auxiliares.c
};
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "constant_definition.h"
#include "case_constant_func_def.h"
#include "case_constant_sql_stmt_def.h"
#include "constant_oracle_versions.h"
#include <oraca.h>
#include <sqlca.h>
#include "extern_functions_funciones_auxiliares.h"
/* EXEC SQL INCLUDE sqlca;
*/
/*
* $Header: sqlca.h,v 1.3 1994/12/12 19:27:27 jbasu Exp $ sqlca.h
*/
/* Copyright (c) 1985,1986, 1998 by Oracle Corporation. */
/*
NAME
SQLCA : SQL Communications Area.
FUNCTION
Contains no code. Oracle fills in the SQLCA with status info
during the execution of a SQL stmt.
NOTES
**************************************************************
*** ***
*** This file is SOSD. Porters must change the data types ***
*** appropriately on their platform. See notes/pcport.doc ***
*** for more information. ***
*** ***
**************************************************************
If the symbol SQLCA_STORAGE_CLASS is defined, then the SQLCA
will be defined to have this storage class. For example:
#define SQLCA_STORAGE_CLASS extern
will define the SQLCA as an extern.
If the symbol SQLCA_INIT is defined, then the SQLCA will be
statically initialized. Although this is not necessary in order
to use the SQLCA, it is a good pgming practice not to have
unitialized variables. However, some C compilers/OS's don't
allow automatic variables to be init'd in this manner. Therefore,
if you are INCLUDE'ing the SQLCA in a place where it would be
an automatic AND your C compiler/OS doesn't allow this style
of initialization, then SQLCA_INIT should be left undefined --
all others can define SQLCA_INIT if they wish.
If the symbol SQLCA_NONE is defined, then the SQLCA variable will
not be defined at all. The symbol SQLCA_NONE should not be defined
in source modules that have embedded SQL. However, source modules
that have no embedded SQL, but need to manipulate a sqlca struct
passed in as a parameter, can set the SQLCA_NONE symbol to avoid
creation of an extraneous sqlca variable.
MODIFIED
lvbcheng 07/31/98 - long to int
jbasu 12/12/94 - Bug 217878: note this is an SOSD file
losborne 08/11/92 - No sqlca var if SQLCA_NONE macro set
Clare 12/06/84 - Ch SQLCA to not be an extern.
Página 3
5. funciones_auxiliares.c
*** This file is SOSD. Porters must change the data types ***
*** appropriately on their platform. See notes/pcport.doc ***
*** for more information. ***
*** ***
**************************************************************
*/
/* MODIFIED
apopat 07/31/99 - [707588] TAB to blanks for OCCS
lvbcheng 10/27/98 - change long to int for sqlda
lvbcheng 08/15/97 - Move sqlda protos to sqlcpr.h
lvbcheng 06/25/97 - Move sqlda protos to this file
jbasu 01/29/95 - correct typo
jbasu 01/27/95 - correct comment - ub2->sb2
jbasu 12/12/94 - Bug 217878: note this is an SOSD file
Morse 12/01/87 - undef L and S for v6 include files
Richey 07/13/87 - change int defs to long
Clare 09/13/84 - Port: Ch types to match SQLLIB structs
Clare 10/02/86 - Add ifndef SQLDA
*/
#ifndef SQLDA_
#define SQLDA_ 1
#ifdef T
# undef T
#endif
#ifdef F
# undef F
#endif
#ifdef S
# undef S
#endif
#ifdef L
# undef L
#endif
struct SQLDA {
/* ub4 */ int N; /* Descriptor size in number of entries */
/* text** */ char **V; /* Ptr to Arr of addresses of main variables */
/* ub4* */ int *L; /* Ptr to Arr of lengths of buffers */
/* sb2* */ short *T; /* Ptr to Arr of types of buffers */
/* sb2** */ short **I; /* Ptr to Arr of addresses of indicator vars */
/* sb4 */ int F; /* Number of variables found by DESCRIBE */
/* text** */ char **S; /* Ptr to Arr of variable name pointers */
/* ub2* */ short *M; /* Ptr to Arr of max lengths of var. names */
/* ub2* */ short *C; /* Ptr to Arr of current lengths of var. names */
/* text** */ char **X; /* Ptr to Arr of ind. var. name pointers */
/* ub2* */ short *Y; /* Ptr to Arr of max lengths of ind. var. names */
/* ub2* */ short *Z; /* Ptr to Arr of cur lengths of ind. var. names */
};
typedef struct SQLDA SQLDA;
#endif
/* ----------------- */
/* defines for sqlda */
/* ----------------- */
#define SQLSQLDAAlloc(arg1, arg2, arg3, arg4) sqlaldt(arg1, arg2, arg3, arg4)
#define SQLSQLDAFree(arg1, arg2) sqlclut(arg1, arg2)
Página 5
12. funciones_auxiliares.c
----****----****----****----****----****----****----****----****----****----****
*/
/*
----****----****----****----****----****----****----****----****----****----****
*/
char *funcion_columna (int nro_bytes, void *punt_cadena, int nro_funcion)
{
static char dato_1 [1024];
long valor_salida;
long valor_entrada;
vaciar_cadena (dato_1,1024);
switch (nro_funcion)
{
case FUNC_DB_BLOCK_SIZE:
/* Calculo DB_BLOCK_SIZE, multiplico por la COLUMNA y
devuelvo el RESULTADO */
/*
------------------------------------------------------------------------ */
itoa ((atoi ( (char *) punt_cadena ) * db_block_size() )
/ 1000,dato_1,10);
break;
case FUNC_COMMAND_SQL:
/* Decodifico el nro de la Columna y lo relaciono con el
nombre del COMANDO */
/*
------------------------------------------------------------------------ */
strcpy ( dato_1, decode_command_oracle ( atoi ( (char *)
punt_cadena) ) );
break;
case FUNC_LOCK_MODE:
/* Decodifico el nro de la Columna y lo relaciono con el
tipo de LOCKEO */
/*
------------------------------------------------------------------------ */
strcpy ( dato_1, decode_lock_mode ( atoi ( (char *)
punt_cadena) ) );
break;
case FUNC_LOCK_NAME_MODE:
/* Decodifico el nro de la Columna y lo relaciono con el
nombre de LOCKEO */
/*
------------------------------------------------------------------------ */
strcpy ( dato_1, decode_name_lock ( (char *)
punt_cadena) );
break;
case FUNC_DB_BLOCK_SIZE0:
/* Calculo DB_BLOCK_SIZE, multiplico por la COLUMNA y
devuelvo el RESULTADO */
/*
------------------------------------------------------------------------ */
itoa ((atoi ( (char *) punt_cadena ) * db_block_size() )
/ 1024,dato_1,10);
break;
case FUNC_DB_OBJECT_TYPE:
/* Busco el OBJECT_TYPE dentro de la tabla ALL_OBJECTS
*/
/*
------------------------------------------------------------------------ */
strcpy (dato_1,db_object_type ( atoi ( (char *)
punt_cadena ) ) );
break;
case FUNC_DB_OBJECT_OWNER_NAME:
/* Busco el OBJECT_OWNER_NAME dentro de la tabla
ALL_OBJECTS */
/*
Página 12
13. funciones_auxiliares.c
------------------------------------------------------------------------ */
strcpy (dato_1,db_object_owner_name ( atoi ( (char *)
punt_cadena ) ) );
/* printf ("[%s] n",dato_1); */
break;
case FUNC_DB_SESSION_SID:
/* Busco el OBJECT_OWNER_NAME dentro de la tabla
ALL_OBJECTS */
/*
------------------------------------------------------------------------ */
/* printf ("Cons[%s]n",((char *) punt_cadena));
*/
strcpy (dato_1,db_session_sid_locked ((char *)
punt_cadena ));
/* printf ("[%s] n",dato_1);*/
break;
case FUNC_CONVERT_HH_MM_SS:
/* Busco el OBJECT_OWNER_NAME dentro de la tabla
ALL_OBJECTS */
/*
------------------------------------------------------------------------ */
strcpy (dato_1,convert_ss_to_hh_mm_ss ((char *)
punt_cadena ));
break;
case FUNC_DB_COMP_TBLSPC_INI_EXT:
/* Busco el INIT_EXTENT de un TABLESPACE, y lo comparo
en el valor */
/*
--------------------------------------------------------------- */
valor_entrada = atoi ((char *) punt_cadena);
valor_salida = db_tablspace_ini_ext_size ((char *)
punt_cadena);
if (valor_entrada == 0)
strcpy (dato_1,"FREEn");
else
if (valor_entrada != valor_salida )
strcpy (dato_1,"CHANGEDn");
else
strcpy (dato_1,"INITIALn");
break;
default:
break;
}
return (dato_1);
}
Página 13