Reversal of Records in SQL
Posted in 1991
Hello again Folks,
The problem I have described with Informix-SQL is very simple. Let me
summarize:
1. The table is like this, with NO indexes (because none are needed):
dic char(3),
rest char(77)
2. The PERFORM screen looks like this:
dic: [---]
rest:
[-----------------------------------------------------------------------------]
The only attributes on the PERFORM screen are Reverse on the two fields.
3. The ACE report uses this simple select statement (with no order by
because you shouldn't need one and besides I've already tried using
one and it made no difference):
select * from tab_name
The Problem: Run the PERFORM screen and add several records.
Situation 1: If the table is brand new (never before used),
the records can be viewed from the PERFORM screen
in the order in which they were entered (1,2,3).
The ACE report will print them out in the 1,2,3
order.
Situation 2: After running the "DELETE FROM tab_name" statement
and then adding more records to the table, the
records cannot be viewed in the order in which
they were entered. They are *stored* in the .dat
file in the reverse order! I have verfied this by
running a select statement from the Query-Language
option.
Therefore, in situation 2, nothing I have done can fix the problem. I have
tried the following:
1. In ACE: a) ordering by rowid
b) ordering by each of the columns
2. Adding indexes to the table.
Again, THIS PROBLEM DOES NOT OCCUR WITH ANY OTHER APPLICATION WE HAVE!
My conclusion: It's an as-yet undiscovered bug in version 2.10.00A of SQL
and it has something to do with the table.
Have fun figuring it out. Our users are quite upset in that their long
files of records that they spend hours keying in are all reversed!!!
John
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
John Baker
USAISC - Lex Phone: (606) 293-3644 or 293-3743
Lexington - Blue Grass Army Depot DSN: 745-3644 or 745-3743
Lexington, KY 40511-5109 E-mail: jbaker@lexington-emh2.army.mil
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=