Triggers in SQL Anywhere 5.5.0 and PowerBuilder 5.0.03

Hi:

I'm trying to get a series of triggers working, but am having lots of
difficulties.  Initially, the following trigger did not update the
'product' table on an insert.

create trigger ti_inventory after insert on inventory
referencing new as new_inventory
for each row
begin
update product set product.current_in_stock = product.current_in_stock +

  new_inventory.qty_new + new_inventory.qty_used_excl +
  new_inventory.qty_used_good + new_inventory.qty_used_poor
where product.product_code = new_inventory.product_code
end;

I tried to put other commands into the trigger (such as Message), but
kept getting syntax error messages about the end of line.  I presumed
that this related to the position of the ';' character, but wasn't able
to get it working no matter where I placed this termination character.

I next tried to create the following trigger, which is a modified
version of an example right out of a Sybase SQL Manual (section 20.4.1
Creating Triggers, page 225):

create trigger ti_inventory after insert on inventory
referencing new as new_inventory
for each row
begin
declare err_usr_error exception for sqlstate '99999';
if  new_inventory.product_code > 5106 then
 signal err_usr_error;
end if;
end

This issued the following errors:

Line 5, SQLSTATE = 37000 [Sybase][ODBC Driver]Syntax error: syntax error
near '(end of line)'
Line 7, SQLSTATE = 37000 [Sybase][ODBC Driver]Syntax error: near 'if' in
[if] new_inventory....
Line 8, SQLSTATE = 37000 [Sybase][ODBC Driver]Syntax error: near 'if'
Line 9, SQLSTATE = 37000 [Sybase][ODBC Driver]Syntax error: syntax error
near '(end of line)'


Now I'm really confused.  When examples out of a Sybase don't work, I'm
left to wonder if the SQL Anywhere product shipped with PowerBuilder is
severly limited in it's abilities; particularly with respect to
Triggers.  Is this true????  What's the solution????


Thanks for your help.


Andre Fischer


0
Andre
9/30/1997 5:42:06 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

6 Replies
1055 Views

Similar Articles

[PageSpeed] 41

What tool are you using to submit the trigger?  When I submit triggers or
procedures I use ISQL and change the command delimiter which by default is
a semi-colon.  I change it to double semi-colons.  The single semi-colon is
used to indicate the end of a statement in a stored procedure or trigger.
-- 
Jim Egan [TeamPS]
Dealer Solutions, LLC
Houston, TX
0
Jim
9/30/1997 5:05:28 PM
>What tool are you using to submit the trigger?  When I submit triggers or
>procedures I use ISQL and change the command delimiter which by default is
>a semi-colon.  I change it to double semi-colons.  The single semi-colon is
>used to indicate the end of a statement in a stored procedure or trigger.

Changing the delimiter in ISQL has not been necessary since... well,
some release ago.  They made the parser smarter.


Leo Tohill - Team Powersoft
0
72330
10/1/1997 2:13:49 AM
It is very difficult to execute trigger and SP definitions from the PB
painter.  You'll find it easier to execute them in ISQL.  That will
take care of the command-delimiter problem.

After you get that resolved, try the message statement again.


Leo Tohill - Team Powersoft
0
72330
10/1/1997 2:13:50 AM
I'm always the last to know....

0
Jim
10/1/1997 11:29:16 AM

Thanks Leo and Jim:

I tried using ISQL, and was able to do considerably more testing.

I believe that I've have tracked the original problem down to the fact
that several of the quantities I was trying to accumulate had null
values.  Testing showed that the accumulation worked OK when there were no
null values.  I'm guessing that SQL doesn't like mixing numerics and
null's in the same arithmatic statement.


Thanks for your help.

Andre Fischer.

Leo Tohill wrote:

> It is very difficult to execute trigger and SP definitions from the PB
> painter.  You'll find it easier to execute them in ISQL.  That will
> take care of the command-delimiter problem.
>
> After you get that resolved, try the message statement again.
>
> Leo Tohill - Team Powersoft



0
Andre
10/1/1997 6:48:53 PM
This is a multi-part message in MIME format.

------=_NextPart_000_0001_01BCCEB1.B3DADE90
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

 Hi Andre,
You can use ifNull(possible_null_value,0,possible_null_value)... in your
calculations.
-Aditya


--
http://www.softra.com

Andre Fischer wrote in article <34329B15.E7BFB458@csa.ca>...

>
>
>Thanks Leo and Jim:
>
>I tried using ISQL, and was able to do considerably more testing.
>
>I believe that I've have tracked the original problem down to the fact
>that several of the quantities I was trying to accumulate had null
>values.  Testing showed that the accumulation worked OK when there were no
>null values.  I'm guessing that SQL doesn't like mixing numerics and
>null's in the same arithmatic statement.
>
>
>Thanks for your help.
>
>Andre Fischer.
>
>Leo Tohill wrote:
>
>> It is very difficult to execute trigger and SP definitions from the PB
>> painter.  You'll find it easier to execute them in ISQL.  That will
>> take care of the command-delimiter problem.
>>
>> After you get that resolved, try the message statement again.
>>
>> Leo Tohill - Team Powersoft
>
>
>

------=_NextPart_000_0001_01BCCEB1.B3DADE90
Content-Type: text/x-vcard;
	name="Aditya Bhushan [SOFTRA - NT, Sybase, PowerBuilder].vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="Aditya Bhushan [SOFTRA - NT, Sybase, PowerBuilder].vcf"

BEGIN:VCARD
N:Bhushan [SOFTRA - NT, Sybase, PowerBuilder];Aditya
FN:Aditya Bhushan [SOFTRA - NT, Sybase, PowerBuilder]
EMAIL;PREF;INTERNET:abhushan@softra.com
END:VCARD

------=_NextPart_000_0001_01BCCEB1.B3DADE90--

0
Aditya
10/2/1997 4:33:46 AM
Reply:

Similar Artilces:

Virus Detection S/W (Netware 4.11) Compatible w/SQL Anywhere 5.5.0.3 & 5.5.0.4
<HTML> Does anyone have any recommendations as to a virus detection software for Netware (4.11) that is compatible with SQL Anywhere 5.5.0.3 or 5.5.0.4?&nbsp; Our customer was using Cheyenne's Innoculan which shut the database/service down and they are looking for a proven alternative. <BR>Thanks, <BR>Stacy Zacher <BR>M&amp;I Data Services, Inc.</HTML> Stacy Zacher wrote: > > Does anyone have any recommendations as to a virus detection software > for Netware (4.11) that is compatible with SQL Anywhere 5.5.0.3 or > 5.5.0.4? ...

SQL Anywhere 5.5 and Novell 5.0
Does any one know if SQLAnywhere 5.5 will run okay on Novell 5.0? We have a client that had 5.5 running on Novell 4 and they upgraded to Novell 5.0. When they have the database running, it is locking up the Novell console. There is an EBF that allows 5.5.04 to run in a NW 5 environment. Mark Black schrieb: > > Does any one know if SQLAnywhere 5.5 will run okay on Novell 5.0? We have a > client that had 5.5 running on Novell 4 and they upgraded to Novell 5.0. > When they have the database running, it is locking up the Novell console. ...

SQL Anywhere 5.5.0.5 and VMWare
Are there any known issues with using SQL Anywhere on a Virtualised VMWare server, especially around replication processes ? We have a replication intensive db that our corporate IT dept want to virtualise onto a new server running VMWare. I need to know if there are any do's and don'ts that we should be aware of. Thanks in advance VMWare is not actually a support platform for ASA. Having said that, because VMWare is designed to be a virtual OS, we should still run within this environment. If there are problems that are encountered in a VMWare session, that cannot be r...

SQL Anywhere 5.5 and Netware 5.0
I understand that SQL Anywhere 5.5.04 as shipped will not work properly with Novell Netware 5.0. Has anyone heard whether Sybase intends to release a version update to resolve these problems such as version 5.5.05? Alternatively, is there a later build of version 5.5.04 which will resolve the problems? Yes, there is an EBF available through Tech Support that allows 5.5.04 to run on Netware 5. -- Jim Egan [TeamPS] Dynamic Data Solutions, Inc. http://www.dyn-data.com Houston, TX ...

PowerBuilder 5.0 to 5.0.0.2
I hope this the correct venue for this question. I have a fresh install of PB 5.0 and I need to upgrade it to 5.0.0.2. I have found plenty of reference/downloads to 5.0.0.4 on the sybase website, but I need to go from 5.0 to 5.0.0.2. Where can I download the correct patch/upgrade? Thanks 5.0.0.2 is no longer available. You can choose between 5.0.03 (bug infested) and 5.0.04 (stable). -- pbm_hopethishelps, Roy Kiesler [TeamSybase] Sybase Developer Network (SDN) - http://sdn.sybase.com MySybase - http://my.sybase.com "Dwayne Bordelon" <dwayne.bordelon@shawinc...

5.5.03 Server + 5.5.0 Clients?
We have an OS/2 server running the 5.5.0 engine. Sometimes we encounter assertions and would like to apply the patch 5.5.03. All clients are remote and communicate over IPX/SPX. Some clients use ODBC, others use ESQL. Is it possible to apply the patch to the server without updating the clients? Thanks for your help Tobias -- ====================================================================== Dipl.-Ing. Tobias Krueger Tel.: +49 6103 5881-41 Giegerich & Partner GmbH Fax: +49 6103 5881-49 Daimlerstrasse, D-63303 Dreieich eM...

Dbremote 5.5.0 and 5.5.03 Crash.
Have a problem with dbremote crashing. I have 4 remote sites. At one of the remotes site and the consolidated site, dbremote crashes (GPF or something) after it prints Processing Active Transaction Log and before it prints anything else. This has had some unfortunate side effects. It appears that data was getting to the consolidated site, but not back out. Except for the one remote site. Any ideas? Wayne@aprompt.com Wayne, I have not had GPF problems but did have trouble similar to yours where stuff was coming in okay from the remotes but not replicating out correctly....

How to do from ASA5.5.0.4 #1867 To 5.5.0.5?
Hi , I have 1 database on ASA5.5.04 Built #1867, Today I download the package 5.5.0.5 from Sybase web page,after I run the setup.exe. I can not start my database anymore. Can anyone help me. Thanks A Lot! Kadee What error are you getting? /ck "kadee" <kadee@pchome.com.tw> wrote in message news:$O6WtrS6BHA.238@forums.sybase.com... > Hi , > > I have 1 database on ASA5.5.04 Built #1867, > Today I download the package 5.5.0.5 from > Sybase web page,after I run the setup.exe. > I can not start my database anymore. > > Can...

Pb 5.0 Desktop with sql anywhere 5.5
Hi, I am using pb 5.0 Desktop and i want know if sql anywhere 5.5 works with my development enviroment, or if dont work if there are any option (such ODBC drivers) to make work together. ...

SQL Anywhere 5.5.04 and Novell 5.0
Hello. When a NetWare 5.0 server attempts to load SQL Anywhere 5.5.04, the server goes down. I understand from an on-line Sybase solved case that SQL Anywhere did not support NetWare 5.0 until build #1928. Since I have build #1867, the older build is probably the problem. Can anyone tell me how to obtain SQL Anywhere 5.5.04 build #1928, hopefully free of charge? What is an alternative solution? Thank you. Ron Sochanski The only available download is SA 5.5.05. You will need to first download the maintenace release for to go to SA 5.5.05 and tehm apply the EBF 2817. P...

SQL Anywhere 5.5 on Netware 5.0
Is anyone successfully running SQL Anywhere on NetWare 5.0? When I load SQL Anywhere 5.5.04 on my NetWare 5.0 server, it hangs. I turned in a bug over 2 months ago to Sybase documenting that SA 5.5.04 would abend NetWare 5.0 Beta 3, but since no patch was issued, I assumed it was a Beta problem. Now that I have installed the final release version of NetWare 5.0, SQL Anywhere hangs after initializing the available communication protocols. All other NLMs run just fine. I'm wondering if it is a problem with my specific hardware, or if it is a bug in SQL Anywhere. Thanks, Bren...

Netware 5.0 and SQL Anywhere 5.5.04
I just tried to install SQL Anywhere 5.5.04 on a Netware 5.0 server and the database server locks up when alocating the buffers (I think it was 600 buffers of 512K). The server has 128MB RAM. My question is, is 5.5.04 compatible with Netware 5.0? Thanks, Greg I have since found a message that says that build 1964 is compatible with Netware 5.0, how do I get build 1964? Is that the build number for SQL Anywhere 5.5.05? Greg Greg Heiner wrote: > I just tried to install SQL Anywhere 5.5.04 on a Netware 5.0 server and > the database server locks up when alocating t...

Replication between SQL Server 11.0.2 and SQL Anywhere 5.5.0.3
Does anyone know if exists some document with the details on Replication between Sybase SQL Server 11.0.2 and SQL Anywhere 5.5.0.3 using Replication Server 11.0.3. I�m having some troubles with this configuration and I�m wondering if I�m doing something wrong. Thanks in advance. ...

Powerbuilder 7.0 and Sql Anywhere 5.5
I have been having problems with my 5.5 Sql Anywhere database getting fatal database errors ever since I switched my application from Powerbuilder 5.0 to 7.0. Do you know of any known problems with this. If so, what can I do about it? Please advise Define fatal database errors? Do you mean assertions? If so, read http://my.sybase.com/detail?id=1010805. /ck <Jim_Sacks> wrote in message news:1B0972BF2418D403004477D285256AF2.004477E185256AF2@webforums... > I have been having problems with my 5.5 Sql Anywhere database getting fatal > database errors ever since I s...

Web resources about - Triggers in SQL Anywhere 5.5.0 and PowerBuilder 5.0.03 - sybase.sqlanywhere.general

PowerBuilder - Wikipedia, the free encyclopedia
PowerBuilder is an integrated development environment owned by Sybase , a division of SAP . It has been in use since 1991, peaking around 1998 ...

Sybase PowerBuilder tool readied for Microsoft's .Net
... Win32 or newer style .Net development After several years of work, Sybase is ready to deliver on the final step in its plan to move PowerBuilder ...

Jim O'Neil (@jimoneil) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Open Directory - Computers: Programming: Languages
about dmoz - dmoz blog - report abuse/spam - help the entire directory only in Programming/Languages Description Top : Computers : Programming ...

The HP Booth Staff (Goons) Owe Me an Apology
... when you might need to use it. For instance, when I was in the WinRunner world there were plugins for driving terminal emulators and powerbuilder ...

Contact Us - Sybase Inc
Thanks for visiting the 主页 section of Sybase.com. Here you will find information about Contact Us. For more information about Business Intelligence, ...

热门搜索 - 我的异常网
... 我的异常网 » 热门搜索 sdpnet2 移动【A111】其它用户原因鉴权失败,是什么意思啊 http:// 192.168.1.102:22578 本网站服务器位于美国,受美国法律保护 MiniUI js 破解 http://192.168.1.103:8080/ powerbuilder ...

Mobile app security: Always keep the back door locked
The best way to keep mobile apps safe is to secure the services they connect to.

10 Tech Skills That Will Instantly Net You A $100,000+ Salary
... that let's developers run Java applications. Java is highly popular language for writing web apps and custom enterprise apps. No. 8: PowerBuilder ...

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Resources last updated: 12/8/2015 6:39:41 PM