#1  
Old 31st March 2004, 12:33 PM
Nathan Sutcliffe
 
Posts: n/a
Default Weird error when autoinc field has value of -1

If you set an autoinc field to -1, you can get some weird errors when you
run queries on the table. The error I'm getting is "Query execution failed:
Overflow while converting variant of type (LongWord) into type (Integer) [no
error code]". Should it even be possible to set an autoinc field to -1? It
happened when I imported some screwy data. I'm posting tables in binaries
for the following query:

SELECT *
FROM Customer
LEFT OUTER JOIN CustPhone ON ( Customer.CustomerID = CustPhone.CustomerID )
ORDER BY Customer.LastName DESC

--
Nathan Sutcliffe
nsutcliffe at speedlinesolutions period com


  #2  
Old 31st March 2004, 08:12 PM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Weird error when autoinc field has value of -1

> If you set an autoinc field to -1, you can get some weird errors when

That's a bug, issue #744.

Btw, Autoinc is really a DWord type internally, so -1 is really $FFFFFFFF.
Its just the VCL that has no fieldtype that can display unsigned integers,
so values larger than maxint look negative.


--

Eivind Bakkestuen [NDD]
Please, no email unless requested.
Search Borland and third-party newsgroups here: www.tamaracka.com


  #3  
Old 1st April 2004, 04:06 AM
Terry
 
Posts: n/a
Default Re: Weird error when autoinc field has value of -1

> If you set an autoinc field to -1, you can get some weird errors when
>
> That's a bug, issue #744.


Is the bug the issue that the field can be set to -1, or is the bug the
issue that the SQL query fails ?


Terry.


  #4  
Old 1st April 2004, 02:54 PM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Weird error when autoinc field has value of -1

>> If you set an autoinc field to -1, you can get some weird errors when
>>
>> That's a bug, issue #744.

>
> Is the bug the issue that the field can be set to -1, or is the bug
> the issue that the SQL query fails ?


The SQL query. "Autoinc is really a DWord type internally, so -1 is really
$FFFFFFFF"

field.AsInteger will show -1. Cast to DWord for the true internal value.

--

Eivind Bakkestuen [NDD]
Please, no email unless requested.
Search Borland and third-party newsgroups here: www.tamaracka.com


  #5  
Old 1st April 2004, 02:59 PM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Weird error when autoinc field has value of -1

> If you set an autoinc field to -1, you can get some weird errors when
> you run queries on the table. The error I'm getting is "Query
> execution failed: Overflow while converting variant of type
> (LongWord) into type (Integer) [no error code]". Should it even be
> possible to set an autoinc field to -1? It happened when I imported
> some screwy data. I'm posting tables in binaries for the following
> query:


One caution about the fix: it will not work on Delphi 5! D5 doesnt support
LongWord in variants at all.

--

Eivind Bakkestuen [NDD]
Please, no email unless requested.
Search Borland and third-party newsgroups here: www.tamaracka.com




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
weird issue with 3.64 B2 Hannes Danzl[NDD] nexusdb.public.support.portal 5 26th June 2010 03:11 AM
Error: Error: NexusDB: <unnamed TnxQuery instance>: Query execution failed Warren nexusdb.public.support.adoprovider 1 8th April 2010 03:55 PM
Is autoinc a supported type in ADO.net? David Guest nexusdb.public.support.adoprovider 1 3rd November 2009 05:49 AM
Syntax Error in date literal [no error code] Malcolm Cheyne nexusdb.public.support.sql 3 12th November 2003 11:18 PM
Negative values in autoinc fields Robert nexusdb.public.support.sql 2 17th October 2003 12:31 AM


All times are GMT +11. The time now is 11:41 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.