Parallel Table name usage?

From: Barry Skaggs <bxs29_at_cas.org>
Date: Fri, 23 Sep 1994 20:17:06 GMT
Message-ID: <1994Sep23.201706.13311_at_chemabs.uucp>


I am working on a project with the following characteristics ...

1 - I am using Oracle7 - Sun OS - Pro C
2 - All my information is maintained in a single table named ESM_DOC_TABLE.
3 - I am still in development
4 - I need to have my software and table accessed by the rest of the development team
5 - Eventually will be used by several hundred users.
6 - Need to have a way to debug problems and test enhncements without interferring
     with a) rest of development team, b) with eventual users.
7 - All data queries and updates are handled by a series of utilitu programs
     and user interfaces (X11) via Pro-C.
8 - Only one database available for both production and beta versions of table. 9 - Need to be able to destroy, modify or recreate beta version

    without interferring with rest of development team or users. 10 - Need to be able to copy production table down to beta table for

     diagnostics and trouble shooting, again without interferring with
     rest of development tream and/or users.
     

The problem I am posing is the following. All my Pro-C source refers to ESM_DOC_TABLE with the embedded SQL calls. What I would like to be able to do is diagramed below ...

                   prod.ESM_DOC_TABLE       bls.ESM_DOC_TABLE                 
                   ---------------------  ------------------

| | | |
| ESM_DOC_TABLE | | ESM_DOC_TABLE |
| PRODUCTION | | BETA |
| | | |
-------------------- ------------------- \ \ \ \ \ \ --------------------- | | | ESM_DOC_TABLE | | (name used in | | proc-c source) | --------------------- /\ || || || USER (Software used in production mode) prod.ESM_DOC_TABLE bls.ESM_DOC_TABLE --------------------- ------------------
| | | |
| ESM_DOC_TABLE | | ESM_DOC_TABLE |
| PRODUCTION | | BETA |
| | | |
-------------------- ------------------- \ / \ / \ / (switch to either \ / table) \ / \ / --------------------- | | | ESM_DOC_TABLE | | (name used in | | proc-c source) | --------------------- /\ || || || USER (Software used in beta mode)

One solution to this is to double the size of my Pro-C source code and use distinct table names. This is an ugle solution that I am trying to avoid.

Another is to store on seperate databases. This two is undesirable due to the fact my CASE tools would have to be alterred for each application to compile and link using different database id's and possible Pro-C pre-compiler versions.

Database administrators use synonyms (in this case ESM_DOC_TABLE)

The bottom line is, I want to be able to test software, mangle a table (2 distinct tables with the same name) in anyway I want without it interferring with other users. And I would like to be able to do this at a moments notice without recompiling a bunch of libraries and relinking my applications after editing the table name in my Pro-C source code. I would like to be able to do this by logging into another ORACLE id, setting an alias of some sort or by any other convinient means.

Below is an example of my Pro-C source ...

#define ASSIGN_STRING(oracle_string, string) \

        if (strcpy ((char *) (oracle_string).arr, string)) \
          (oracle_string).len = strlen ((string)) 
      .
      .
      .

int put_document_record (char *name, Document_record *document_record,
                         int over_wright_ok)
{
  char day [12], buffer [20];
  EXEC SQL DECLARE C3 CURSOR FOR
    SELECT name, path, type_doc, install_day, modify_day, image_status,
           image_day, html_status, html_day, trilateral_status, 
           trilateral_day, ocr_status, ocr_day, ascii_status, 
           ascii_day, inpadoc_status, inpadoc_day, stn_ascii_status,
           stn_ascii_day, pat_cand_status, pat_cand_day, 
           pat_selected_status, pat_selected_day, pat_pages
           FROM ESM_DOC_TABLE;

  ASSIGN_STRING (document_type, document_record->type);
  ASSIGN_STRING (document_install_day, document_record->install);   ASSIGN_STRING (document_modify_day, document_record->modify);
  .
  .
  .
  .

}

Any Ideas??
Thank you for your help.

I tried using a utility to remove unnecessary |     Barry Skaggs  
lines from my software.  It promptly deleted  |     Chemical Abstracts Service
my entire directory and logged me out!!!      |     bxs29_at_cas.org
Received on Fri Sep 23 1994 - 22:17:06 CEST

Original text of this message