🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
4 messages
4 total messages Started by Isaac Sat, 14 Jun 2008 13:21
what is the best way to prevent divide by zero in procedures (beside if of course)
#219
Author: Isaac
Date: Sat, 14 Jun 2008 13:21
9 lines
1158 bytes
Hello,
It may sound stupid question but I have a very long stored procedure 
full of calculations so I had to test variables for null and 0 every 
time I need to make calculations I do so with many IFs

I wonder if there another way prevent divide  by zero error and keep my 
code clear and smaller

Thanks
Re: what is the best way to prevent divide by zero in procedures (besideif of course)
#221
Author: Bill Todd [TeamB]
Date: Sat, 14 Jun 2008 13:59
9 lines
1157 bytes
Isaac wrote:

> I wonder if there another way prevent divide  by zero error and keep
> my code clear and smaller

No.

-- 
Bill Todd (TeamB)
Re: what is the best way to prevent divide by zero in procedures (besideif of course)
#222
Author: Isaac
Date: Sat, 14 Jun 2008 14:29
5 lines
1042 bytes
Bill Todd [TeamB] wrote:
> No.
>
>   
ok thanks
Re: what is the best way to prevent divide by zero in procedures (besideif of course)
#237
Author: Martijn Tonies
Date: Mon, 16 Jun 2008 06:59
19 lines
1510 bytes
> > I wonder if there another way prevent divide  by zero error and keep
> > my code clear and smaller
>
> No.

Well, he could try catching the exceptions?


-- 
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads