Re: ( field + 0 ) to order character ( number ) fields ??
Posted in 1994
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
} It's been kicked around a little about adding 0 to a character field to } get values of a range or to sort correctly numeric CHAR fields. Has } anyone come across ISQL core dumping when trying to add 0.00 ( since the } result is a decimal expression, I thought I would try to add 0.00 ). } } This works: } } SELECT * FROM table WHERE ( field + 0 ) BETWEEN 1 AND 100; } } and this works: } } SELECT ( field + 0 ) FROM table ORDER BY 1; } } and this works: } } SELECT * FROM table WHERE ( field + 0.00 ) BETWEEN 1 AND 100; } } This causes ISQL to core dump: } } SELECT ( field + 0.00 ) FROM TABLE ORDER BY 1; } } Any reasons? :-) } } By the way: } } SCO UNIX 3.2.2 } INFORMIX-4GL Version 4.10.UC3 ( C-Code ) } INFORMIX-4GL Version 4.10.UC3 ( P-Code ) } INFORMIX-SQL Version 4.10.UD2 ( SE ) } I just tried the above on my system and it worked! My configuration: SCO UNIX 3.2v4.2 INFORMIX-4GL Version 4.11.UC4 ( C-Code ) INFORMIX-SQL Version 4.11.UC4 (ISQL) INFORMIX-SE Version 5.01.UD3 (SE) John -- ============================================================================== John R. Morris | email: jrm@hycel.com Director of Data Processing | phone: (314) 961-2000 fax: (314) 961-8508 ==============================================================================