Subject isql ddl extract BUG: updatable views
Author Rob Schuff
hi folks,

I was unable to find this bug listed at sourceforge and I'm curious if it is
being addressed. It seems that if one has defined an updatable view and
also has defined a stored procedure to update the view, the ddl script
generated by isql cannot be run without errors. Here is a dll extract
script generated from isql that demonstrates the problem:

SET SQL DIALECT 3;

/* CREATE DATABASE 'c:\dbtest\isqltest.gdb' PAGE_SIZE 1024
DEFAULT CHARACTER SET NONE */


/* Table: TABLE_A, Owner: SYSDBA */
CREATE TABLE "TABLE_A" ("FIELD1" INTEGER);

/* Table: TABLE_B, Owner: SYSDBA */
CREATE TABLE "TABLE_B" ("FIELD2" INTEGER);



/* View: VIEW_AB, Owner: SYSDBA */
CREATE VIEW "VIEW_AB" ("FIELD1", "FIELD2") AS

select a.field1, b.field2 from table_a a
join table_b b on a.field1=b.field2
;
COMMIT WORK;
SET AUTODDL OFF;
SET TERM ^ ;

/* Stored procedures */
CREATE PROCEDURE "MY_PROCEDURE" AS
BEGIN EXIT; END ^

ALTER PROCEDURE "MY_PROCEDURE" AS

begin
/* Procedure Text */
delete from view_ab;
end ^
SET TERM ; ^
COMMIT WORK ;
SET AUTODDL ON;
SET TERM ^ ;

/* Triggers only will work for SQL triggers */
CREATE TRIGGER "VIEW_AB_BI0" FOR "VIEW_AB"
ACTIVE BEFORE INSERT POSITION 0
as
begin
insert into table_a (field1) values (new.field1);
insert into table_b (field2) values (new.field2);
end ^

CREATE TRIGGER "VIEW_AB_BU0" FOR "VIEW_AB"
ACTIVE BEFORE UPDATE POSITION 0
as
begin
update table_a set field1=new.field1 where field1=old.field1;
update table_b set field2=new.field2 where field2=old.field2;
end ^

CREATE TRIGGER "VIEW_AB_BD0" FOR "VIEW_AB"
ACTIVE BEFORE DELETE POSITION 0
as
begin
delete from table_a where field1=old.field1;
delete from table_b where field2=old.field2;
end ^

COMMIT WORK ^
SET TERM ; ^

/* Grant permissions for this database */


thanks a bunch

rob