Re: Academic SQL question
- From: "Tony Rogerson" <tonyrogerson@xxxxxxxxxx>
- Date: Thu, 14 Jan 2010 07:20:40 -0000
When an SQL statement executes, an error status code is automatically
generated. This code represents success, failure, warning, or no data
found. This error status code is stored in a built-in variable called
SQLSTATE.
Class and Subclass Codes
So you think the "compiler" EXECUTES the statement? What did you learn in that masters in computer science? Or, like I now suspect and have suspected for a number of years that you bought the qualification.
Compilers do not execute code.
Now, I'll ask you again - you seem to think the Compiler is responsible for picking up the error - that means the error is picked up PRE-EXECUTION; now - show me in the standard that documents this behavior where the "COMPILER" gives the errors.
PARSE --- COMPILE --- EXECUTE
The above is how every vendor database product works.
The EXEUCTION-ENGINE would throw the error which is way too late and allows the code to be put into production and sit their happily working until the data pattern that breaks the statement breaks the application and costs you thousands to 10's of thousands of Euro's in resource to fix and track down (an intermittent bug) and lost revenue.
Yet again you are talking rubbish - only this time you've got somebody who understands the stuff so won't be distracted or thobbed off with incorrect garbage.
--ROGGIE--
"--CELKO--" <jcelko212@xxxxxxxxxxxxx> wrote in message news:a0cb0ff0-d8cc-421c-8397-4d85673563a7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Point me to the standard that defines that the "Compiler" should pick up this cardinality problem. <<
When an SQL statement executes, an error status code is automatically
generated. This code represents success, failure, warning, or no data
found. This error status code is stored in a built-in variable called
SQLSTATE.
Class and Subclass Codes
The SQLSTATE status code is a five-character string that can contain
only digits and uppercase letters.
The first two characters of the SQLSTATE status code indicate a class.
The last three characters of the SQLSTATE code indicate a subclass.
Things can be violations or warnings. Violations stop things. Warnings
can be raised only under certain conditions or permanently raised
because of the DDL (this case). A warning may or may not stop things.
SQLSTATE Class Codes
=========================
00 = Success
01 = Success with warning
02 = No data found
03+ = Error or warning
In particular,
21000 = a cardinality violation. you can execute a GET DIAGNOSTICS
statement to obtain additional error information.
but the warnings that can be raised are:
01I09 = Cardinality of the projection list and of the INTO list are
not equal
01I06 = Vendor extension to ANSI-compliant syntax
.
- References:
- Academic SQL question
- From: SetonSoftware
- Re: Academic SQL question
- From: Gert-Jan Strik
- Re: Academic SQL question
- From: SetonSoftware
- Re: Academic SQL question
- From: --CELKO--
- Re: Academic SQL question
- From: J M De Moor
- Re: Academic SQL question
- From: --CELKO--
- Re: Academic SQL question
- From: Tony Rogerson
- Re: Academic SQL question
- From: --CELKO--
- Academic SQL question
- Prev by Date: Re: comparing dates that have difference formats
- Next by Date: Re: Academic SQL question
- Previous by thread: Re: Academic SQL question
- Next by thread: Re: Academic SQL question
- Index(es):
Relevant Pages
|