66 lines
3.3 KiB
C
66 lines
3.3 KiB
C
|
/*---------------------------------------------------------------------------------*/
|
||
|
/* $RCSfile: testEntr.h,v $ */
|
||
|
/*---------------------------------------------------------------------------------*/
|
||
|
/* $Revision: 1.1 $ */
|
||
|
/* $Name: $ */
|
||
|
/* $Date: 2006/02/28 23:28:21 $ */
|
||
|
/* $Author: agibert $ */
|
||
|
/*---------------------------------------------------------------------------------*/
|
||
|
|
||
|
/*---------------------------------------------------------------------------------*/
|
||
|
/* This file is part of LibDataBase */
|
||
|
/* */
|
||
|
/* LibDataBase is free software; you can redistribute it and/or modify */
|
||
|
/* it under the terms of the GNU Lesser General Public Licence as published by */
|
||
|
/* the Free Software Foundation; either version 2.1 of the License, or */
|
||
|
/* (at your option) any later version. */
|
||
|
/* */
|
||
|
/* LibDataBase 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 Lesser General Public License for more details. */
|
||
|
/* */
|
||
|
/* You should have received a copy of the GNU Lesser General Public License */
|
||
|
/* along with LibDataBase; if not, write to the Free Software */
|
||
|
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||
|
/*---------------------------------------------------------------------------------*/
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#ifndef TESTENTR_H
|
||
|
#define TESTENTR_H
|
||
|
|
||
|
|
||
|
#define USAGE "Usage: %s [--from <n>] [--count <c>] [--db <db>] [--show] [--size <s>] [--col <c>]\n\n\
|
||
|
Selects columns from table TB_PERSONNE_PHYSIQUE then inserts them into table TEST_ENS.\n\
|
||
|
Options:\n\
|
||
|
--from:\tStarting row in the array from which retrieved data will be put (default: 0).\n\
|
||
|
--count:\tRows count to retrieve and insert (default: 0).\n\
|
||
|
--db:\t\tDatabase specification in the format: login/password@server.\n\
|
||
|
--show:\tIf specified, the results of the SELECT are shown.\n\
|
||
|
--col:\tColumns count to fetch and insert for each row (default: 3).\n\
|
||
|
--size:\tTotal size of the array that will contain selected values (default: 1).\n\
|
||
|
\n\
|
||
|
Examples:\n\
|
||
|
_ '%s --db entr/entr@pbdme1 --size 10000 --count 1000 --col 38' selects 10000 rows of 38\n\
|
||
|
columns from table TB_PERSONNE_PHYSIQUE and inserts them 1000 by 1000 into table TEST_ENS.\n\
|
||
|
_ '%s --db entr/entr@pbdme1 --size 50 --count 50 --col 4 --show' selects 50 rows of 4\n\
|
||
|
columns from TB_PERSONNE_PHYSIQUE, displays values then inserts them 50 by 50 into TEST_ENS.\n"
|
||
|
|
||
|
|
||
|
#define TRUE 1
|
||
|
#define FALSE 0
|
||
|
|
||
|
extern int strcasecmp(const char *, const char *);
|
||
|
extern char *strdup(const char *);
|
||
|
|
||
|
void parseArgs(int argc, char **argv);
|
||
|
void usage(char **argv);
|
||
|
void say (const char *format, ...);
|
||
|
void splitDBSpec(char *spec, const char **login, const char **pwd, const char **server);
|
||
|
|
||
|
|
||
|
#endif
|