Jump to content
tobenschain

corrupt primary key?

Recommended Posts

Using FireDAC i created a Fire Bird table. I use Next command to go through the entire file of 6,000 records.

The keys essentially go like this:
'B040'
'B060'
'B070'
'Xƒ0000'
'Xƒ0010'
'Xƒ0020'
'X‡62170'
'X‡62180'
'X‡62190'
'Xˆ001'
'Xˆ002'
'Xˆ003'

For some reason the Next command pulls up 'Xƒ0000' for a second time after 'X‡62190'.

Are extended ASCII codes allowed?

Share this post


Link to post

Using Charset NONE is a regrettable habit ! I still have some database with this default encoding and migration to best encoding is not so easy, no easy tool for this !

Try to use WIN1252 as fdconnexion charset  

Share this post


Link to post

you can specify "CHARSET and COLLATE":

  1. in you "connection string" for all usage  (CHARSET/COLLATE )
  2. or in "select, insert, update" on fields  (CHARSET/COLLATE)
  3. on in your index creation or in "order by" (CHARSET/COLLATE)

ex.: select  myfield COLLATE <<your collation>> from table  where myfieldx COLLATE <<your collation>> = 'ABC'  order by myfieldY COLLATE <<your collation>> etc...  you see?

 

Quote

on Firebird documentation

Collation Sequence

Each character set has a default collation sequence (COLLATE) that specifies the collation order. Usually, it provides nothing more than ordering based on the numeric code of the characters and a basic mapping of upper- and lower-case characters. If some behaviour is needed for strings that is not provided by the default collation sequence and a suitable alternative collation is supported for that character set, a COLLATE collation clause can be specified in the column definition.

A COLLATE collation clause can be applied in other contexts besides the column definition. For greater-than/less-than comparison operations, it can be added in the WHERE clause of a SELECT statement. If output needs to be sorted in a special alphabetic sequence, or case-insensitively, and the appropriate collation exists, then a COLLATE clause can be included with the ORDER BY clause when rows are being sorted on a character field and with the GROUP BY clause in case of grouping operations.

 

Edited by programmerdelphi2k

Share this post


Link to post

I was thinking this way, even if I don't know it could solve your problem

image.thumb.png.9a84b1873d243153fa89c4545f5eab36.png

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×