Problem with SQL (fwd)
Posted in 1991
John Baker writes: > Hi, > We are having a strange problem with INFORMIX-SQL version 2.10.00A. > We have a simple application that serves as a user interface for creating > 80-column card images on tape. In other words, users key in their data > on a PERFORM screen one line at a time. The screen (and underlying tables > of course) consists of two fields, one 3 characters long and the other 77 > characters long. > Everything works as it should, *except* that the records are not being > stored in the .dat files in the order in which they were entered! John - In a relational database, ie. a database which is in conformance with the relational model, the order in which rows are stored is not known - in other words, you must not depend on any order in rows retrieved unless you specify that order with an ORDER BY clause in your select statement. Using a relational database is *very* *different* from using isam files - and for *good* reason. The reason is Data Independence - the ability for the application program to continue to function unimpaired if the underlying details of data storage change. If you want to retrieve rows from an Informix database in a particular order, you must include a column reflecting that order (you could populate it automatically, even in perform) and ORDER BY that column in your SELECT statement. ------------ DHL WORLDWIDE EXPRESS ------------------------------------------- Greg Bryan gbryan@ssf-sys.dhl.com DHL Systems Data Administrator uunet!ssf-sys.dhl.com!gbryan San Francisco -------------------------------------------------------------------------------