home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
dbutil.zip
/
BUFOP.ZIP
/
DBSTUFF.SQH
< prev
next >
Wrap
Text File
|
1993-10-09
|
3KB
|
91 lines
//
// processed by precompiler 10-08-93 06:43:14
//
/*******************************************************************
*
* List database tables, views & attributes
*
*******************************************************************/
#include <iseq.h>
/*******************************************************************
*
* Column information from the database
*
*******************************************************************/
EXEC SQL BEGIN DECLARE SECTION;
class columns {
protected:
char name[19];
char table[19];
char remarks[254];
char type[8];
char nulls; // Y=nullable, N=not nullable,
// D=nullable with default
short len;
short colNbr; // The order of this col in the table
char highKey2[19];
char lowKey2[19];
char avgColLen;
short keySeq; // Sequence number of col in key (or zero)
public:
char * getName(); // get the name of a col
char getType();
char * getRemarks();
short getlen();
short getColNbr();
friend
ostream & operator <<(ostream & aStream, const Column & aCol);
};
typedef ISequence<Column> columnSet;
/*******************************************************************
*
* Class to fill column container
*
*******************************************************************/
class colList : public Columns {
public:
void selectCol(char * tablename);
friend
columnSet & operator << (columnSet &s, colList & c);
};
class Table {
private;
char name[19]; // table name
char creator[9];
char type; // T = table, V=view
char ctime[27]; // time stamp when created
char remarks[254]; // user defined remarks about table or view
short nbrCols; // number of columns in table
integer nbrRows;
short parents; // number of parent tables for this table
short children; // number of child tables
short selfRefs; // number of self references
short keyCol; // number of key col for this table
columnSet AColSet; // sequential set of columns related to the table
public:
void getTable(char * tablename); // get table specified in tablename
friend ostream
&operator <<(ostream & aStream, Table const & aTable);
};
EXEC SQL END DECLARE SECTION;
void bind(char * DBName); // bind application to database if not bound