Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Help with Trigger please..

5 posts in Trigger Last posting was on 2009-06-02 11:29:10.0Z
Ian Branch Posted on 2009-06-01 07:52:33.0Z
From: "Ian Branch" <branch@celestial.com.au>
Subject: Help with Trigger please..
Newsgroups: Advantage.Trigger
Date: Mon, 1 Jun 2009 17:52:33 +1000
User-Agent: XanaNews/1.19.1.194
Message-ID: <xn0gawbyo2wzv1e000@devzone.advantagedatabase.com>
X-Ref: DevZone.AdvantageDatabase.com ~XNS:00000115
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 218.215.189.197
X-Trace: 1 Jun 2009 01:51:43 -0700, 218.215.189.197
Lines: 44
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!218.215.189.197
Xref: solutions.advantagedatabase.com Advantage.Trigger:432
Article PK: 1136494

Hi Guys,

I am ecperimenting with triggers using the tutorial example as a bssis.

I have the following code within the MyFunction Trigger.

======================================
oConn.Name := 'conn';

// YOUR TRIGGER CODE GOES HERE. The code commented out is an example
trigger
// which automatically places a row into the BACKORDERS table after an
order
// is placed if there is not enough inventory to cover the order.
oQuery := TAdsQuery.Create( nil );
oQuery.AdsConnection := oConn;
// // See how many items were ordered.
oQuery.SQL.Text := 'SELECT * FROM __new';
oQuery.Open;
iInvnumb := oQuery.Fields[0].AsInteger
=====================================

When I run the app and trigger the trigger, it falls over at the oQuery.Open;
and gives me an error as follows..

===================================
ttInvoices: Error 5177: Trigger execution failed. TrigError 7200: Error
7200: AQE Error: State = HY000; NativeError = 5004; [iAnywhere
Solutions][Advantage SQL][ASA] Error 5004: Either ACE could not find the
specified file, or you do not have sufficient rights to access the file. Table
name: __new.
===================================

I am using D2007, ADS 9, local server.

Is the issue with ttInvoices or __new? As 7200 is a SQL error I am guessing
it is with __new but 5004 is file not found and thereisn't a __new file per se.

What do I need to do to fix it?

Regards & TIA,

Ian


Edgar Sherman Posted on 2009-06-01 14:47:34.0Z
Date: Mon, 01 Jun 2009 08:47:34 -0600
From: Edgar Sherman <no@email.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Help with Trigger please..
References: <xn0gawbyo2wzv1e000@devzone.advantagedatabase.com>
In-Reply-To: <xn0gawbyo2wzv1e000@devzone.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 10.24.34.164
Message-ID: <4a23e9d7@solutions.advantagedatabase.com>
X-Trace: 1 Jun 2009 08:46:47 -0700, 10.24.34.164
Lines: 50
X-Authenticated-User: upreview
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.34.164
Xref: solutions.advantagedatabase.com Advantage.Trigger:433
Article PK: 1136498

One thing that comes to mind is to make sure to check the box "Include
VALUES (__old and __new) tables when you define the trigger in ARC.

Edgar

Ian Branch wrote:
> Hi Guys,
>
> I am ecperimenting with triggers using the tutorial example as a bssis.
>
> I have the following code within the MyFunction Trigger.
>
> ======================================
> oConn.Name := 'conn';
>
> // YOUR TRIGGER CODE GOES HERE. The code commented out is an example
> trigger
> // which automatically places a row into the BACKORDERS table after an
> order
> // is placed if there is not enough inventory to cover the order.
> oQuery := TAdsQuery.Create( nil );
> oQuery.AdsConnection := oConn;
> // // See how many items were ordered.
> oQuery.SQL.Text := 'SELECT * FROM __new';
> oQuery.Open;
> iInvnumb := oQuery.Fields[0].AsInteger
> =====================================
>
> When I run the app and trigger the trigger, it falls over at the oQuery.Open;
> and gives me an error as follows..
>
> ===================================
> ttInvoices: Error 5177: Trigger execution failed. TrigError 7200: Error
> 7200: AQE Error: State = HY000; NativeError = 5004; [iAnywhere
> Solutions][Advantage SQL][ASA] Error 5004: Either ACE could not find the
> specified file, or you do not have sufficient rights to access the file. Table
> name: __new.
> ===================================
>
> I am using D2007, ADS 9, local server.
>
> Is the issue with ttInvoices or __new? As 7200 is a SQL error I am guessing
> it is with __new but 5004 is file not found and thereisn't a __new file per se.
>
> What do I need to do to fix it?
>
> Regards & TIA,
>
> Ian
>


Ian Branch Posted on 2009-06-01 20:36:51.0Z
From: "Ian Branch" <branch@celestial.com.au>
Subject: Re: Help with Trigger please..
Newsgroups: Advantage.Trigger
References: <xn0gawbyo2wzv1e000@devzone.advantagedatabase.com> <4a23e9d7@solutions.advantagedatabase.com>
Date: Tue, 2 Jun 2009 06:36:51 +1000
User-Agent: XanaNews/1.19.1.194
Message-ID: <xn0gax8rd3oarph000@devzone.advantagedatabase.com>
X-Ref: DevZone.AdvantageDatabase.com ~XNS:00000118
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 218.215.189.197
X-Trace: 1 Jun 2009 14:36:03 -0700, 218.215.189.197
Lines: 16
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!218.215.189.197
Xref: solutions.advantagedatabase.com Advantage.Trigger:434
Article PK: 1136497


Edgar Sherman wrote:

> One thing that comes to mind is to make sure to check the box "Include VALUES
> (__old and __new) tables when you define the trigger in ARC.
>

Hi Edgar,

You were right and it seemed so simple.

So I enabled them but now I get a 5073: The given record length was invalid,
and it doesn't even seem to have got to the trigger.

Regards,

Ian


Edgar Sherman Posted on 2009-06-01 21:54:44.0Z
Date: Mon, 01 Jun 2009 15:54:44 -0600
From: Edgar Sherman <no@email.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Help with Trigger please..
References: <xn0gawbyo2wzv1e000@devzone.advantagedatabase.com> <4a23e9d7@solutions.advantagedatabase.com> <xn0gax8rd3oarph000@devzone.advantagedatabase.com>
In-Reply-To: <xn0gax8rd3oarph000@devzone.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 10.24.34.164
Message-ID: <4a244df5@solutions.advantagedatabase.com>
X-Trace: 1 Jun 2009 15:53:57 -0700, 10.24.34.164
Lines: 30
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.34.164
Xref: solutions.advantagedatabase.com Advantage.Trigger:435
Article PK: 1136496

Why do you think it has not gotten to the trigger?

Does the error occur if you disable the trigger in the dictionary? Have
you tried to debug the trigger?

To debug the trigger, be sure to enable "include TD32 debug info" and
"Include Remote Debug symbols". Also, I would suggest disabling DLL
caching, though this is probably more applicable to Remote server vs.
Local Server. Here is a KB item on disabling DLL Caching.
http://devzone.advantagedatabase.com/dz/content.aspx?Key=17&RefNo=060303-1747

Edgar

Ian Branch wrote:
> Edgar Sherman wrote:
>
>> One thing that comes to mind is to make sure to check the box "Include VALUES
>> (__old and __new) tables when you define the trigger in ARC.
>>
> Hi Edgar,
>
> You were right and it seemed so simple.
>
> So I enabled them but now I get a 5073: The given record length was invalid,
> and it doesn't even seem to have got to the trigger.
>
> Regards,
>
> Ian
>


Ian Branch Posted on 2009-06-02 11:29:10.0Z
From: "Ian Branch" <branch@celestial.com.au>
Subject: Re: Help with Trigger please..
Newsgroups: Advantage.Trigger
References: <xn0gawbyo2wzv1e000@devzone.advantagedatabase.com> <4a23e9d7@solutions.advantagedatabase.com> <xn0gax8rd3oarph000@devzone.advantagedatabase.com> <4a244df5@solutions.advantagedatabase.com>
Date: Tue, 2 Jun 2009 21:29:10 +1000
User-Agent: XanaNews/1.19.1.194
Message-ID: <xn0gaxw9x59u8j000@devzone.advantagedatabase.com>
X-Ref: DevZone.AdvantageDatabase.com ~XNS:0000011A
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 218.215.189.197
X-Trace: 2 Jun 2009 05:28:20 -0700, 218.215.189.197
Lines: 16
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!218.215.189.197
Xref: solutions.advantagedatabase.com Advantage.Trigger:436
Article PK: 1136493

Hi Edgar,

I found an item in Advantage.General dated 05/12/2008 & titled "Triggers on an
.ntx table".

In that Joachim suggested deleting and readding the table to the Dictionary.

I did this and now all is fine.

Thank you for your input. Appreciated.

Regards,

Ian