SQL statement doesn't return rows

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cxg417
Posts: 41
Joined: Thu 26 Mar 2009 08:07

SQL statement doesn't return rows

Post by cxg417 » Sun 08 Nov 2009 06:30

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
Last edited by cxg417 on Tue 15 Feb 2011 14:59, edited 1 time in total.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 09 Nov 2009 08:13

ASE ODBC driver does not detect that this statement returns rows. So you get this error. Its is a bug in the ODBC driver.

Post Reply