Subject Re: sql to check if a row has been used in related tables?
Author wang960
Any sample that can get me started? I think this kind of sql is very
useful in the application.

--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@...> wrote:
>
>
>
>
> > Is it really impossible, Martijn? I thought most things were possible
> > with Firebird through combining querying system tables and using
execute
> > statement in a stored procedure.
>
> well, yes, that's what I was thinking about after replying ;)
>
> I guess with execute statement, you could create a dynamic
> query with the info from the system tables.
>
> After creating such a procedure, then yes, it would be a more-or-less
> generic way of doing this.
>
> Martijn Tonies
> Database Workbench - development tool for Firebird and more!
> Upscene Productions
> http://www.upscene.com
> My thoughts:
> http://blog.upscene.com/martijn/
> Database development questions? Check the forum!
> http://www.databasedevelopmentforum.com
>
> > Sure, most of us never need/want to do anyting like this (I, for one,
> > have never been in a situation where this could be of much help -
after
> > all, Firebird do allow the foreing key to prevent deletion), but it
> > would not surprise me if that would be something that some people
could
> > want to implement (e.g. I could imagine the guy that wrote the
wonderful
> > DB Workbench to have customers asking for such features).
> >
> > Set
> >
> > Martijn Tonies wrote:
> > >> I have a table called Item with keyfield itemno, and there are many
> > >> tables use the itemno as foreign key, is there a generic way to
check
> > >> if a certain itemno already exists in one of related tables?
Thanks.
> > >
> > > No.
>