Board index » delphi » Differences in results when executing SQL sentences from SQL Server and Delphi

Differences in results when executing SQL sentences from SQL Server and Delphi

Hi,

I am trying to execute an SQL sentence in a TQuery with the ExecSql
procedure. I am building the sql text with values copied from excel.
The table has a decimal field (Decimal 7,4), and I am trying to send a wrong
value which must generate an exception (Arithmetic overflow).
The problem is : When the sentence is executed from Delphi, there is not
exception, and the record is inserted with a null value in that field.
As it is wrong, I copy the sentence direct onto the SQL Analyzer and try to
execute it, in this case the exception takes place.

Why Delphi does not generate the exception and permits the insert,
"replacing" with null those values.

TIA

Carlos Guevara

 

Re:Differences in results when executing SQL sentences from SQL Server and Delphi


regional settings and "," instead of "." ?

"Maria Mayerly Sierra" <Mayer...@grupomillennium.com> wrote in message
news:3e9d8c8e@newsgroups.borland.com...

Quote
> Hi,

> I am trying to execute an SQL sentence in a TQuery with the ExecSql
> procedure. I am building the sql text with values copied from excel.
> The table has a decimal field (Decimal 7,4), and I am trying to send a
wrong
> value which must generate an exception (Arithmetic overflow).
> The problem is : When the sentence is executed from Delphi, there is not
> exception, and the record is inserted with a null value in that field.
> As it is wrong, I copy the sentence direct onto the SQL Analyzer and try
to
> execute it, in this case the exception takes place.

> Why Delphi does not generate the exception and permits the insert,
> "replacing" with null those values.

> TIA

> Carlos Guevara

Other Threads