Re: Academic SQL question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

.



Relevant Pages

  • Re: Academic SQL question
    ... When an SQL statement executes, an error status code is automatically ... This code represents success, failure, warning, or no data ... The SQLSTATE status code is a five-character string that can contain ... A warning may or may not stop things. ...
    (microsoft.public.sqlserver.programming)
  • Oracle sql completed with warnings...
    ... I found this in the logs of my application server: ... org.hibernate.util.JDBCExceptionReporter SQL Warning: 17110, SQLState: null ...
    (comp.databases.oracle.server)
  • Fax Server Role fails to create shared fax printer
    ... I added the fax server roles to a SBS 2008 server. ... IWorker.Fax.Common.TaskConfigureFaxServer, RootTaskId = ... IWorker.Fax.FaxConfiguration.TaskFaxConfigurationComposite, Success: False, ... Warning: False, Continue: True, Message: The Fax service could not be ...
    (microsoft.public.windows.server.sbs)
  • Re: Is IoStatus.Status reliable?
    ... > I take it you were thinking of informational type messages not warning? ... The status is what the lower driver provided (I'm assuming drivers ... NT_SUCCSS returns true for either SUCCESS or WARNING class messages, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: ANNOUNCE: Text::CSV_XS 0.32
    ... file but without success. ... The problem is national characters. ... But no error, no warning. ...
    (comp.lang.perl.modules)