Subject | Re: [IB-Architect] Enhanced handling of EXECUTE PROCEDURE statement |
---|---|
Author | Jason Wharton |
Post date | 2000-06-16T22:25:19Z |
Markus,
That thought did come to mind but it was a possible workaround (involving
more work than I wanted to do) so I didn't want to divulge it. <g> I was
hoping my case for this enhancement would remain a little stronger...
Creating the view and the trigger is more work than just creating the stored
procedure to perform the select and pump into the target procedure.
Your solution does make it so that once in place dynamic statements could be
submitted from the client using a WHERE clause. So, I suppose that we can
put this issue to rest.
Is there anyone out there who though this might actually be useful? (Just
wondering if I am crazy or not.)
Thanks,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
That thought did come to mind but it was a possible workaround (involving
more work than I wanted to do) so I didn't want to divulge it. <g> I was
hoping my case for this enhancement would remain a little stronger...
Creating the view and the trigger is more work than just creating the stored
procedure to perform the select and pump into the target procedure.
Your solution does make it so that once in place dynamic statements could be
submitted from the client using a WHERE clause. So, I suppose that we can
put this issue to rest.
Is there anyone out there who though this might actually be useful? (Just
wondering if I am crazy or not.)
Thanks,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: "Markus Kemper" <mkemper@...>
To: <IB-Architect@egroups.com>
Sent: Friday, June 16, 2000 3:00 PM
Subject: Re: [IB-Architect] Enhanced handling of EXECUTE PROCEDURE statement
> Jason,
>
> > I would have to say because it allows one to take action on multiple
tables.
> > If I were just dealing with one table and needed to do various
manipulations
> > I would just use a trigger.
>
> You might be able to accomplish your goal with a "non-updatable"
> view and a trigger as seen in the following example.
>
> ---
>
> connect 'test.gdb'
> user 'sysdba' password 'masterkey';
>
> drop database;
>
> create database 'test.gdb'
> user 'sysdba' password 'masterkey';
>
> set auto off;
>
> create domain ch10 char( 10 );
> create domain sint smallint;
> commit;
>
> create table t0 (
> id sint,
> f1 ch10,
> f2 ch10
> );
> commit;
>
> create table t1 (
> id sint,
> f1 ch10
> );
> commit;
>
> create table t2 (
> id sint,
> f1 ch10
> );
> commit;
>
> insert into t0 values ( 1, 'test', 'data' );
> commit;
>
> create view t4 ( id, f1, f2 ) as
> select t1.id, t1.f1, t2.f1
> from t1, t2
> where t1.id = t2.id;
> commit;
>
> set term ^^;
>
> create trigger trg_ins_for_t4 for t4
> active before insert position 10
> as begin
>
> insert into t1 values ( new.id, new.f1 );
> insert into t2 values ( new.id, new.f2 );
> end^^
> commit^^
>
> set term ;^^
>
> insert into t4 ( id, f1, f2 )
> select id, f1, f2 from t0;
> commit;
>
> select * from t4;
> commit;
>
> ----
>
> Output:
>
> D:\work\temp>isql -i test.sql
> Use CONNECT or CREATE DATABASE to specify a database
> Database: 'test.gdb', User: sysdba
>
> ID F1 F2
> ====== ========== ==========
>
> 1 test data
>
> ------------------------------------------------------------------------
> Wrox Wireless Developer Conference, Amsterdam, July 10-12. Choose from
> 40+ technical sessions covering application of WAP, XML, ASP, Java and
> C++ to mobile computing. Get your ticket to the future today!
> http://click.egroups.com/1/5689/4/_/830676/_/961193297/
> ------------------------------------------------------------------------
>
> To unsubscribe from this group, send an email to:
> IB-Architect-unsubscribe@onelist.com
>
>
>