2

What's wrong with that query?

alter table TableName enable trigger 'TriggerName'

Error is

Line 1, column 30
Could not execute statement.
ASA Error -131: Syntax error nera 'enable' on line 1
Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
Mauro
  • 2,032
  • 3
  • 25
  • 47

2 Answers2

4

The error message is from Sybase SQL Anywhere (ASA), but the syntax you're trying to use is not valid in ASA, it would be in Adaptive Server (ASE) though. I don't think there is an equivalent in ASA.

Graeme Perrow
  • 56,086
  • 21
  • 82
  • 121
martin clayton
  • 76,436
  • 32
  • 213
  • 198
  • My product is Sybase Adaptive Server Anywhere 8.0.3 – Mauro Jun 28 '11 at 08:59
  • Is it a case where triggers can't be disabled? – Mauro Jun 28 '11 at 09:00
  • 1
    @Mauro - that's right. If you review the SQLAnywhere Forum posting you'll see one approach is to change the code in the trigger to be conitionally executed based on a setting held in some table. This allows you to control what the trigger does and simulate disable. But it doesn't stop the trigger from firing. – martin clayton Jun 28 '11 at 09:12
0

I have updated the answer on the ASA forum that Martin pointed out http://sqlanywhere-forum.sap.com/questions/389/how-to-temporary-disable-a-trigger-inside-a-procedure-and-enable-again?page=1#13221 read it for details.

In summary you can use SET OPTION FIRE_TRIGGERS = OFF; or SET TEMPORARY OPTION FIRE_TRIGGERS = OFF;

Graeme Perrow
  • 56,086
  • 21
  • 82
  • 121
Robert
  • 3,328
  • 2
  • 24
  • 25