Re: Generating SQL

From: Mikito Harakiri (mikharakiri_nospaum_at_yahoo.com)
Date: 11/18/04


Date: 18 Nov 2004 13:53:31 -0800


"Otavio C. Decio" <REMOVEodecio@earthlink.REMOVE.net> wrote in message news:<R_Kdndy4suEVEAHcRVn-jw@giganews.com>...
> Suppose you add a new column to a table. If you have concatenated
> SQL, you might have to account for the new column on every statement that
> talks to that table. This includes insert, delete, select and update -
> probably many of them. In my model, you add a new column to the database,
> add a new property in the value object class and you're done.

create table emp (
   empno integer,
   ename string
)

insert into emp (empno, ename)
values (500, 'Jon Doe');

select ename from emp
where empno = 500

alter table emp
  add sal integer

Now the query and insert statement still work. The suggestion that
application developers have to rewrite any sql statements whenever db
designer adds a column is ridiculous.



Relevant Pages

  • Re: internal handling of views
    ... Also in discussing mechanics of a view the manual says that sql ... CREATE VIEW BASIC_EMP AS SELECT EMPNO, ... The execution plan, perhaps surprisingly, has little resemblance to the ...
    (comp.databases.oracle.misc)
  • Enform Query
    ... Can we have an Enform query which lists only few records from the file ... like we have in Sql ... Select * from emp where empno = 10; ...
    (comp.sys.tandem)
  • Re: Library Cache
    ... procedures that determines the SQL to be submitted based on the ... These statements would all use bind variables.. ... select countfrom emp where ename = 'ALLEN' ...
    (comp.databases.oracle.server)
  • Re: Library Cache
    ... procedures that determines the SQL to be submitted based on the ... These statements would all use bind variables. ... select countfrom emp where ename = 'ALLEN' ...
    (comp.databases.oracle.server)
  • Re: Update trigger
    ... nvltrigger for each column for example. ... SQL> create or replace trigger emp_upd_trig ... after update of ename, job, sal on emp ... from emp where empno> 8000; ...
    (comp.databases.oracle.server)