Subject Re: [firebird-support] Trigger for a view doesn't work in all circumstances
Author Martijn Tonies
Hi,

> in my (very small) firebird database I've got a view linking two
> tables, and a trigger (before insert or update or delete) to make it
> updatable. Firebird version: 2.0.3, Gentoo Linux.
>
> With insert or update statements I construct myself in isql or
> FlameRobin this works as expected. In a PyQt application using the
> QtSql classes this works, if I use a QSqlQuery, where I write the
> SQL statements myself. But with a QSqlTableModel no update is made
> (no error message either). In this case I can't see or control the
> SQL statements the model uses.
>
> To make matters still more confusing, I wrote a "before update"
> trigger for the phone_list view of the employee database - and this
> is correctly updated by a QSqlTableModel.
>
> I suppose this may mean that the trigger for my own database is
> buggy, but too simple update statements don't show the error. Is
> there any tool I could use to view the SQL statements produced by
> the QSqlTableModel? If I could repeat and vary these statements in
> the command line client I might perhaps get to the bottom of this.

What is the trigger source?

Does your component library have a SQL Monitor of sorts, you might
be able to use that to view the SQL statement that the Table-component
generates.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com