[TIP] Can't put SQL in trigger when change is made with SQL

Bart Davis (4/10/14 8:11AM)
Chris Curnow (4/10/14 5:26PM)


Bart Davis (4/10/14 8:11 AM)

SQL

It really is hard to believe that SQL in triggers still isn't
supported when a SQL statement causes a trigger to fire. ?4D's SQL
support is extremely weak/disappointing, especially considering SQL
has been available for years now. ?Can anyone name another "SQL
database" that doesn't fully support SQL in triggers?

While I'm complaining about the SQL supportÖ

- Is it really too difficult for 4D engineering to figure out how to
make local variables work in dynamic queries?
- SQL query performance is slow compared to traditional (4D Query +
selection to array + query with array)

Bart
A 4D user since 1987

On Apr 10, 2014, at 1:26 AM, 4d_tech-request@... wrote:

color><param>00000,0000,DDEE/param>MMessage: 10

Date: Thu, 10 Apr 2014 17:26:54 +1000
From: Chris Curnow <chris@...

<CANPboVYedgtKZzBa=esRFWL1Yqkb7yXsr6ryMvzpvt1R2aPUjA@mail.gmail.com>

Hi all,

I am in the process of removing all triggers from my application
(because I
have come to believe triggers are evil).

I came across one I hadn't deleted today and I had some SQL which
updated a
record of the table with a trigger.

Inside the trigger was a method I recently updated to use SQL (to
update a
log file).

This might not be a problem in a client-server application (I haven't
tried
it yet and don't think I will) but in standalone testing, this led to a
"Nested Begin/End SQL is not allowed" error. ?It took me a while to
work
out what was happening.

Just something to watch out for if you use SQL and triggers.

Chris Curnow
4Cast
Australia
/color>

Chris Curnow (4/10/14 5:26 PM)

<CANPboVYedgtKZzBa=esRFWL1Yqkb7yXsr6ryMvzpvt1R2aPUjA@mail.gmail.com>

Hi all,

I am in the process of removing all triggers from my application
(because I
have come to believe triggers are evil).

I came across one I hadn't deleted today and I had some SQL which
updated a
record of the table with a trigger.

Inside the trigger was a method I recently updated to use SQL (to
update a
log file).

This might not be a problem in a client-server application (I haven't
tried
it yet and don't think I will) but in standalone testing, this led to a
"Nested Begin/End SQL is not allowed" error. ¬=A0It took me a while to
work
out what was happening.

Just something to watch out for if you use SQL and triggers.

Chris Curnow
4Cast
Australia

Reply to this message

Summary created 4/10/14 at 1:50PM by Intellex Corporation

Comments welcome at: feedback@intellexcorp.com