tags:

views:

87

answers:

4

Hi folks,

is it good practise to use 'goto' statements in Sql queries?

+2  A: 

Depends on the SQL - some of the dialects don't provide a useful mechanism for flow control other than GOTO.

GOTO is generally bad form.

Nate
A: 

My guess would be no. My general rule with goto statements in any modern language is, if your using them, something is wrong with your design.

Meiscooldude
+2  A: 

No.

As with other languages, there's almost always a better option to use than a Goto.

If you tell us which SQL Package you're using and what you're trying to accomplish, we might be able to give you an idea as to exactly which might fit.

Justin Niessner
It's a stored procedure written by someone.
SoftwareGeek
@BhejaFry - But is it T-SQL, PL-SQL, MySQL, etc.?
Justin Niessner
it's T-SQL, won't pl-sql support goto?
SoftwareGeek
+1  A: 

No. It is very bad form.