Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: [Pro*C/C++] : List of tables in database and other things
Hi.
> ---------- 1. tables in database ---------------
> 1.1. How can we know if a table (for instance, table "AAA") exists in
database?
> 1.2. How can we get number of tables containing in database?
> 1.3. How can we get list of names of all tables containing in database?
Couldn't you select the information from ALL_TABLES?
> ---------- 2. columns in table -----------------
> 2.1. How can we know if a column (for instance, column "BBB") exists in
table?
> 2.2. How can we get number of columns containing in table?
> 2.3. How can we get list of names of all columns containing in table?
Couldn't you select the information from ALL_SOURCE?
> ---------- 3. rows in table --------------------
> 3.1. How can we know if a row (for instance, row with specific key) exists
in table?
> 3.2. How can we get number of rows containing in table?
> 3.3. How can we get list of names of all rows containing in table?
Wouldn't this be a usual select statement? Or, do you need to know the syntax for a proC select?
For example, you could either:
strcpy(lsSQLStatement, "SELECT COUNT(*) FROM TABLE1"); EXEC SQL PREPARE sSQL FROM :lsSQLStatement; EXEC SQL DECLARE lcurCursor for sSQL; EXEC SQL OPEN lcurCursor; EXEC SQL WHENEVER NOT FOUND DO break; for (;;) { EXEC SQL FETCH lcurCursor into :liRowCount; } EXEC SQL CLOSE lcurCursor;
Hope it helps.
C Received on Sun Oct 10 1999 - 23:38:05 CDT