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.

SQL Debugger Problem

11 posts in Trigger Last posting was on 2008-05-08 22:03:55.0Z
Richard Parker Posted on 2008-03-31 09:54:32.0Z
Reply-To: "Richard Parker" <parkerr@wanadoo.fr>
From: "Richard Parker" <parkerr@wanadoo.fr>
Newsgroups: advantage.trigger
Subject: SQL Debugger Problem
Date: Mon, 31 Mar 2008 11:54:32 +0200
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3264
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3264
NNTP-Posting-Host: 90.5.96.193
Message-ID: <47f0b383@solutions.advantagedatabase.com>
X-Trace: 31 Mar 2008 03:48:51 -0700, 90.5.96.193
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!90.5.96.193
Xref: solutions.advantagedatabase.com Advantage.Trigger:384
Article PK: 1136444

I am testing triggers using the local server. I added a simple AFTER UPDATE
SQL trigger to a table. The trigger simply inserts a record in another table
after an update occurs. The idea being that the second table will act as a
log of changes to the first table

I got it to work okay then I decided to only add a record to the log if a
certain field had been changed. I was using ARC 8.1 and couldn't get my IF
statement to work, so I decided to download and install ARC 9.0 and try and
use the Debugger.

Here's the problem, I can see my trigger script okay, but when I click on
Debug/Test, I only see a one line UPDATE..SET statement and not my trigger
script.

Is there a fix for this? Do I need to install version 9.0 of the Local
Server as well?

(I noticed somebody asked a similar question in the V9Beta group but the
problem was in a UDF - my script doesn't use any UDFs, it's very simple.)


Joachim Duerr (ADS) Posted on 2008-03-31 12:24:34.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: SQL Debugger Problem
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com>
Organization: iAnywhere
User-Agent: XanaNews/1.18.1.9
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 130.214.79.11
Message-ID: <47f0c9f2@solutions.advantagedatabase.com>
Date: 31 Mar 2008 05:24:34 -0700
X-Trace: 31 Mar 2008 05:24:34 -0700, 130.214.79.11
Lines: 14
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!130.214.79.11
Xref: solutions.advantagedatabase.com Advantage.Trigger:385
Article PK: 1136448


Richard Parker wrote in <47f0b383@solutions.advantagedatabase.com>:

> Here's the problem, I can see my trigger script okay, but when I
> click on Debug/Test, I only see a one line UPDATE..SET statement and
> not my trigger script.

did you execute that statement within the debugger? It should jump into
the trigger.

--
Joachim Duerr
System Consultant (Advantage Database Server)
Sybase iAnywhere
advantagesupport[AT]ianywhere.com


Richard Parker Posted on 2008-03-31 18:41:19.0Z
Reply-To: "Richard Parker" <parkerr@wanadoo.fr>
From: "Richard Parker" <parkerr@wanadoo.fr>
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com> <47f0c9f2@solutions.advantagedatabase.com>
Subject: Re: SQL Debugger Problem
Date: Mon, 31 Mar 2008 20:41:19 +0200
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3264
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3264
NNTP-Posting-Host: 90.5.215.107
Message-ID: <47f12f0b@solutions.advantagedatabase.com>
X-Trace: 31 Mar 2008 12:35:55 -0700, 90.5.215.107
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!90.5.215.107
Xref: solutions.advantagedatabase.com Advantage.Trigger:386
Article PK: 1136446

Hi Joachim,

Thanks for your reply.

I tried to execute the SQL in the debugger but I got an error.

The SQL script shown by the Debugger window is this (which is nothing like
my script, see below);

UPDATE "PARTS" SET "UNIT" = :UNIT WHERE /* No primary key, add where clause
manually. */;

When I try to execute in the Debugger, it complains (not surprisingly) that
the WHERE clause is missing

My actual trigger script is this;

DECLARE @intOldStock Integer;
DECLARE @intNewStock Integer;

@intOldStock = (SELECT [GLSTOCK] FROM __old);
@intNewStock = (SELECT [GLSTOCK] FROM __New);

IF @intOldStock <> @intNewStock then
INSERT INTO STKTRACK
([DATE],[TIME], [BRANCH], [MFR], [DISC], [OLDSTOCK],
[NEWSTOCK], [DETAIL], [USER], [MACHINE], [QTY], [VALUE],
[WHY], [ADHOC] )
SELECT curDate(), convert(curTime(), SQL_CHAR), 'GL', [MFR], [DISC],
@intOldStock,
@intNewStock, 'THIS IS A TEST', User(), 'RPPC', 10, 100.00, 'TEST', TRUE
FROM __old;
END IF;

It works runs okay as an AFTER UPDATE trigger on the Parts table but the
Debugger won't display it.

Any more Suggestions?

Thanks

Richard


Alex Wong (ADS) Posted on 2008-03-31 19:41:54.0Z
From: "Alex Wong \(ADS\)" <nobody@sybase.com>
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com> <47f0c9f2@solutions.advantagedatabase.com> <47f12f0b@solutions.advantagedatabase.com>
Subject: Re: SQL Debugger Problem
Date: Mon, 31 Mar 2008 13:41:54 -0600
Lines: 59
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 10.24.38.219
Message-ID: <47f13d2d@solutions.advantagedatabase.com>
X-Trace: 31 Mar 2008 13:36:13 -0700, 10.24.38.219
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.219
Xref: solutions.advantagedatabase.com Advantage.Trigger:387
Article PK: 1136447

In order to debug a trigger, some action has to be performed to cause the
trigger to fire. That is why ARC present you with an UPDATE statement for
you to execute. You will need to make appropriate adjustment to the
statement and then execute it. It will cause the trigger to fire and the
debugger will then be able to stop the trigger.

--
Alex

"Richard Parker" <parkerr@wanadoo.fr> wrote in message
news:47f12f0b@solutions.advantagedatabase.com...
> Hi Joachim,
>
> Thanks for your reply.
>
> I tried to execute the SQL in the debugger but I got an error.
>
> The SQL script shown by the Debugger window is this (which is nothing like
> my script, see below);
>
> UPDATE "PARTS" SET "UNIT" = :UNIT WHERE /* No primary key, add where
> clause
> manually. */;
>
> When I try to execute in the Debugger, it complains (not surprisingly)
> that the WHERE clause is missing
>
> My actual trigger script is this;
>
> DECLARE @intOldStock Integer;
> DECLARE @intNewStock Integer;
>
> @intOldStock = (SELECT [GLSTOCK] FROM __old);
> @intNewStock = (SELECT [GLSTOCK] FROM __New);
>
> IF @intOldStock <> @intNewStock then
> INSERT INTO STKTRACK
> ([DATE],[TIME], [BRANCH], [MFR], [DISC], [OLDSTOCK],
> [NEWSTOCK], [DETAIL], [USER], [MACHINE], [QTY], [VALUE],
> [WHY], [ADHOC] )
> SELECT curDate(), convert(curTime(), SQL_CHAR), 'GL', [MFR], [DISC],
> @intOldStock,
> @intNewStock, 'THIS IS A TEST', User(), 'RPPC', 10, 100.00, 'TEST', TRUE
> FROM __old;
> END IF;
>
> It works runs okay as an AFTER UPDATE trigger on the Parts table but the
> Debugger won't display it.
>
> Any more Suggestions?
>
> Thanks
>
> Richard
>
>


Richard Parker Posted on 2008-03-31 21:40:45.0Z
Reply-To: "Richard Parker" <parkerr@wanadoo.fr>
From: "Richard Parker" <parkerr@wanadoo.fr>
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com> <47f0c9f2@solutions.advantagedatabase.com> <47f12f0b@solutions.advantagedatabase.com> <47f13d2d@solutions.advantagedatabase.com>
Subject: Re: SQL Debugger Problem
Date: Mon, 31 Mar 2008 23:40:45 +0200
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3264
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3264
NNTP-Posting-Host: 90.5.215.107
Message-ID: <47f1590c@solutions.advantagedatabase.com>
X-Trace: 31 Mar 2008 15:35:08 -0700, 90.5.215.107
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!90.5.215.107
Xref: solutions.advantagedatabase.com Advantage.Trigger:388
Article PK: 1136449

Hi Alex,

Thx for your reply.

But if I can't see my code in the Debugger window, how can I set a break
point?

Sorry if this obvious but I can't figure it out. I tried opening the
Debugger window and then getting the trigger to 'fire' but nothing happened.
The trigger just worked and the Debugger didn't display my code??

I don't understand why, when I click on the 'Debug/Test' button, my code
doesn't appear in the Debugger window. It would then be simple to set a
break point.

Thanks

Richard


Richard Parker Posted on 2008-03-31 22:02:34.0Z
Reply-To: "Richard Parker" <parkerr@wanadoo.fr>
From: "Richard Parker" <parkerr@wanadoo.fr>
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com> <47f0c9f2@solutions.advantagedatabase.com> <47f12f0b@solutions.advantagedatabase.com> <47f13d2d@solutions.advantagedatabase.com>
Subject: Re: SQL Debugger Problem
Date: Tue, 1 Apr 2008 00:02:34 +0200
Lines: 90
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3264
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3264
NNTP-Posting-Host: 90.5.215.107
Message-ID: <47f15e24@solutions.advantagedatabase.com>
X-Trace: 31 Mar 2008 15:56:52 -0700, 90.5.215.107
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!90.5.215.107
Xref: solutions.advantagedatabase.com Advantage.Trigger:389
Article PK: 1136450

Hi again Alex,

Sorry I read your reply again more carefully and I understand what you are
saying. I modified the UPDATE statement and sure enough my script appeared
in the Debugger/

This is surely a bit counter intuitive though. When one clicks on the
Debug/Test button, you naturally expect your script to be displayed so you
can set a break point.

Oh while I am on my soap box :-), would it be possible in some future
release to enable a context edit menu to pop when the right hand mouse
button is clicked in the SQL script editor? It's so nornmal these days to
highlight some text, do a RH click and Copy and then Paste the text using
the mouse again. Having to use Ctrl-C and Ctrl-V reminds me of when I used
to use Wordstar back in the dark days of the pre Windows 80's. (for those
not old enough, it was one of the early DOS word processors and all the
editing was done via control key combinations)....

Thanks for your help.

Richard

"Alex Wong (ADS)" <nobody@sybase.com> wrote in message
news:47f13d2d@solutions.advantagedatabase.com...
> In order to debug a trigger, some action has to be performed to cause the
> trigger to fire. That is why ARC present you with an UPDATE statement for
> you to execute. You will need to make appropriate adjustment to the
> statement and then execute it. It will cause the trigger to fire and the
> debugger will then be able to stop the trigger.
>
> --
> Alex
>
>
> "Richard Parker" <parkerr@wanadoo.fr> wrote in message
> news:47f12f0b@solutions.advantagedatabase.com...
>> Hi Joachim,
>>
>> Thanks for your reply.
>>
>> I tried to execute the SQL in the debugger but I got an error.
>>
>> The SQL script shown by the Debugger window is this (which is nothing
>> like my script, see below);
>>
>> UPDATE "PARTS" SET "UNIT" = :UNIT WHERE /* No primary key, add where
>> clause
>> manually. */;
>>
>> When I try to execute in the Debugger, it complains (not surprisingly)
>> that the WHERE clause is missing
>>
>> My actual trigger script is this;
>>
>> DECLARE @intOldStock Integer;
>> DECLARE @intNewStock Integer;
>>
>> @intOldStock = (SELECT [GLSTOCK] FROM __old);
>> @intNewStock = (SELECT [GLSTOCK] FROM __New);
>>
>> IF @intOldStock <> @intNewStock then
>> INSERT INTO STKTRACK
>> ([DATE],[TIME], [BRANCH], [MFR], [DISC], [OLDSTOCK],
>> [NEWSTOCK], [DETAIL], [USER], [MACHINE], [QTY], [VALUE],
>> [WHY], [ADHOC] )
>> SELECT curDate(), convert(curTime(), SQL_CHAR), 'GL', [MFR], [DISC],
>> @intOldStock,
>> @intNewStock, 'THIS IS A TEST', User(), 'RPPC', 10, 100.00, 'TEST', TRUE
>> FROM __old;
>> END IF;
>>
>> It works runs okay as an AFTER UPDATE trigger on the Parts table but the
>> Debugger won't display it.
>>
>> Any more Suggestions?
>>
>> Thanks
>>
>> Richard
>>
>>
>
>


Joachim Duerr (ADS) Posted on 2008-04-01 08:57:15.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: SQL Debugger Problem
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com> <47f0c9f2@solutions.advantagedatabase.com> <47f12f0b@solutions.advantagedatabase.com> <47f13d2d@solutions.advantagedatabase.com> <47f15e24@solutions.advantagedatabase.com>
Organization: iAnywhere
User-Agent: XanaNews/1.18.1.9
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 10.56.66.108
Message-ID: <47f1eadb@solutions.advantagedatabase.com>
Date: 1 Apr 2008 01:57:15 -0700
X-Trace: 1 Apr 2008 01:57:15 -0700, 10.56.66.108
Lines: 12
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.56.66.108
Xref: solutions.advantagedatabase.com Advantage.Trigger:390
Article PK: 1136451


Richard Parker wrote in <47f15e24@solutions.advantagedatabase.com>:

> Having to use Ctrl-C and Ctrl-V

I always use ctrl-c and ctrl-v...it's ways faster than using the mouse,
right click, select the right menu item, click again, ....

--
Joachim Duerr
System Consultant (Advantage Database Server)
Sybase iAnywhere
advantagesupport[AT]ianywhere.com


Richard Parker Posted on 2008-04-01 08:34:46.0Z
Reply-To: "Richard Parker" <parkerr@wanadoo.fr>
From: "Richard Parker" <parkerr@wanadoo.fr>
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com> <47f0c9f2@solutions.advantagedatabase.com> <47f12f0b@solutions.advantagedatabase.com> <47f13d2d@solutions.advantagedatabase.com> <47f15e24@solutions.advantagedatabase.com> <47f1eadb@solutions.advantagedatabase.com>
Subject: Re: SQL Debugger Problem
Date: Tue, 1 Apr 2008 10:34:46 +0200
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3264
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3264
NNTP-Posting-Host: 90.5.215.107
Message-ID: <47f1f24f@solutions.advantagedatabase.com>
X-Trace: 1 Apr 2008 02:29:03 -0700, 90.5.215.107
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!90.5.215.107
Xref: solutions.advantagedatabase.com Advantage.Trigger:391
Article PK: 1136452

If you are used to that way of working, I can see it might be faster for
you. And I often use Ctrl-c etc myself.

BUT in a modern editor one expects to be able to use both the mouse and
keyboard. Even Microsoft's humble Notepad.exe supports both ways of working
:-(


Howard Weisberg Posted on 2008-04-03 17:33:53.0Z
From: "Howard Weisberg" <weisberg39@yahoo.com>
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com> <47f0c9f2@solutions.advantagedatabase.com> <47f12f0b@solutions.advantagedatabase.com> <47f13d2d@solutions.advantagedatabase.com> <47f15e24@solutions.advantagedatabase.com> <47f1eadb@solutions.advantagedatabase.com> <47f1f24f@solutions.advantagedatabase.com>
Subject: Re: SQL Debugger Problem
Date: Thu, 3 Apr 2008 10:33:53 -0700
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 64.60.46.158
Message-ID: <47f513af@solutions.advantagedatabase.com>
X-Trace: 3 Apr 2008 11:28:15 -0700, 64.60.46.158
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!64.60.46.158
Xref: solutions.advantagedatabase.com Advantage.Trigger:392
Article PK: 1136454

This seems like a "nice to have" rather than a "got to have." ADS, with its
small development team, has done an incredible job of prioritizing in order
to deliver an outstanding product. That said, a context menu *would* be
nice.

"Richard Parker" <parkerr@wanadoo.fr> wrote in message
news:47f1f24f@solutions.advantagedatabase.com...
> If you are used to that way of working, I can see it might be faster for
> you. And I often use Ctrl-c etc myself.
>
> BUT in a modern editor one expects to be able to use both the mouse and
> keyboard. Even Microsoft's humble Notepad.exe supports both ways of
> working :-(
>
>
>
>


"Richard Parker" <no_spam Posted on 2008-04-04 10:13:24.0Z
Reply-To: "Richard Parker" <no_spam@thankyou_mam.com>
From: "Richard Parker" <no_spam@thankyou_mam.com>
Newsgroups: Advantage.Trigger
References: <47f0b383@solutions.advantagedatabase.com> <47f0c9f2@solutions.advantagedatabase.com> <47f12f0b@solutions.advantagedatabase.com> <47f13d2d@solutions.advantagedatabase.com> <47f15e24@solutions.advantagedatabase.com> <47f1eadb@solutions.advantagedatabase.com> <47f1f24f@solutions.advantagedatabase.com> <47f513af@solutions.advantagedatabase.com>
Subject: Re: SQL Debugger Problem
Date: Fri, 4 Apr 2008 12:13:24 +0200
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3264
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3264
NNTP-Posting-Host: 81.50.10.98
Message-ID: <47f5fde8@solutions.advantagedatabase.com>
X-Trace: 4 Apr 2008 04:07:36 -0700, 81.50.10.98
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!81.50.10.98
Xref: solutions.advantagedatabase.com Advantage.Trigger:393
Article PK: 1136453

I agree Howard it *would* be nice but not a *must' have...

"Howard Weisberg" <weisberg39@yahoo.com> wrote in message
news:47f513af@solutions.advantagedatabase.com...
> This seems like a "nice to have" rather than a "got to have." ADS, with
> its small development team, has done an incredible job of prioritizing in
> order to deliver an outstanding product. That said, a context menu *would*
> be nice.
>
> "Richard Parker" <parkerr@wanadoo.fr> wrote in message
> news:47f1f24f@solutions.advantagedatabase.com...
>> If you are used to that way of working, I can see it might be faster for
>> you. And I often use Ctrl-c etc myself.
>>
>> BUT in a modern editor one expects to be able to use both the mouse and
>> keyboard. Even Microsoft's humble Notepad.exe supports both ways of
>> working :-(
>>
>>
>>
>>
>
>


Jeremy Mullin Posted on 2008-05-08 22:03:55.0Z
Date: Thu, 8 May 2008 22:03:55 +0000 (UTC)
Message-ID: <1b468bc832b4d8ca7f3c4027f082@devzone.advantagedatabase.com>
From: Jeremy Mullin <no@email.com>
Subject: Re: SQL Debugger Problem
Newsgroups: Advantage.Trigger
References: <47f15e24@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 1098.1
NNTP-Posting-Host: 10.24.38.114
X-Trace: 8 May 2008 15:58:07 -0700, 10.24.38.114
Lines: 18
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.114
Xref: solutions.advantagedatabase.com Advantage.Trigger:394
Article PK: 1136455

Hi Richard,

Good suggestion (pulling up trigger source code). I may change it to pull
up both, because without that "driver" script there would be nothing to run
to exercise the script.

Right now when you hit test/debug it basically writes the driver script and
then sets an object breakpoint (breakpoint at the first line in the object,
in this case the trigger).

In the future I also plan to add "open object" functionality to the sql utility,
so you can just open the sql utility, then open a trigger script and start
editing and debugging right there.

J.D. Mullin
Advantage R&D