Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Fooling an Oracle application

Re: Fooling an Oracle application

From: Bruce Bristol <bbristol_at_ix.netcom.com>
Date: 1997/10/08
Message-ID: <343C69E7.C6F78AAF@ix.netcom.com>#1/1

Hi Roger,

That is close, but not quite what I'm trying to accomplish.

The application does a SELECT COMPANY-INFO from table a;

Now the table will no longer have the COMPANY-INFO column (7 bytes total), but instead COLUMN-A, COLUMN-B and COLUMN-C (3 bytes total).

I want the view to have a pseudo-column named COMPANY-INFO with the first four bytes to be filled with "0000" and the last three bytes to be filled with COLUMN-A, COLUMN-B and COLUMN-C.

The bottom line is that I don't want to have to change the application itself. I want to fool it to think the column still exists until I'm ready to change the code itself to reflect the new columns.

-bb

Roger Snowden wrote:

> If I understand you, you want to fill in some 'dummy' columns with the
> view? Just use dummy constants in your select statement...
>
> SQLWKS> create table sometable (
> alpha varchar2(1),
> beta varchar2(1)
> );
> Statement processed.
> SQLWKS> insert into sometable values ('a', 'b');
> 1 row processed.
> SQLWKS> insert into sometable values ('a', 'b');
> 1 row processed.
> SQLWKS> insert into sometable values ('a', 'b');
> 1 row processed.
> SQLWKS> insert into sometable values ('a', 'b');
> 1 row processed.
> SQLWKS> insert into sometable values ('a', 'b');
> 1 row processed.
> SQLWKS> insert into sometable values ('a', 'b');
> 1 row processed.
> SQLWKS> select * from sometable;
> A B
> - -
> a b
> a b
> a b
> a b
> a b
> a b
> 6 rows selected.
>
> SQLWKS> select alpha, beta, 'dummy' from sometable;
> A B 'DUMM
> - - -----
> a b dummy
> a b dummy
> a b dummy
> a b dummy
> a b dummy
> a b dummy
> 6 rows selected.
>
> And then, to this...
>
> SQLWKS> select 'dummy' || alpha || beta from sometable;
> 'DUMMY'
> -------
> dummyab
> dummyab
> dummyab
> dummyab
> dummyab
> dummyab
> 6 rows selected.
>
> This works pretty well
>
> Roger Snowden
>
> > Example:
> >
> > COMPANY-INFO CHAR(7)
> >
> > is really comprised of
> >
> > COLUMN-A CHAR(3)
> > COLUMN-B CHAR(1)
> > COLUMN-C CHAR(1)
> > COLUMN-D CHAR(1)
> > COLUMN-E CHAR(1)
> >
> > I'm dropping COMPANY-INFO, and what would be COLUMN-E but adding
> > COLUMN-B, C and D, so now my 7 bytes of info is replaced by 3 bytes of
> > info.
> >
> > I want the application to see, however,
> > "0000"+COLUMN-B+COLUMN-C+COLUMN-D.
Received on Wed Oct 08 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US