Page 1 of 1

SQL statement doesn't return rows

Posted: Sun 08 Nov 2009 06:30
by cxg417
Edition: 3.0.0.3
//MS SQL
UniQuery1.Close;
UniQuery1.SQL.Clear;
UniQuery1.Conncection:= MSconn;
UniQuery1.SQL.Add('if exists(select * from table1)');
UniQuery1.SQL.Add(' select 1 as iBS');
UniQuery1.SQL.Add('else');
UniQuery1.SQL.Add(' select 0 as iBS');
UniQuery1.Open; //It's OK

//ASE
UniQuery1.Close;
UniQuery1.SQL.Clear;
UniQuery1.Conncection:= ASEconn;
UniQuery1.SQL.Add('if exists(select * from table1)');
UniQuery1.SQL.Add(' select 1 as iBS');
UniQuery1.SQL.Add('else');
UniQuery1.SQL.Add(' select 0 as iBS');
UniQuery1.Open; //error message "SQL statement doesn't return rows"
________
LEXUS LX HISTORY

Posted: Mon 09 Nov 2009 08:13
by Plash
ASE ODBC driver does not detect that this statement returns rows. So you get this error. Its is a bug in the ODBC driver.