Icon View Incident Report

Serious Serious
Reported By: Uli Becker
Reported On: 7/20/2009
For: Version 2.02 Build 15
# 3045 Parameters Not Being Recognized When Used in a UNION/INTERSECT/EXCEPT SELECT Statement

I use the following query and prepare it after the database connects. The first querys fine, but the result set doesn't change any more when the query is executed with different parameters.

This is the code I am using:

with dm.SearchQuery do
ParamByName('FSearch').asString := '%' + edSearch.Text + '%';
ParamByName('FSearchText').asString := edSearch.Text + '*';
ParamByName('FBenutzerID').asInteger := CurrentBenutzer.ID;

Some notes:

1. Removing the union clause: the two single queries work fine.
2. Removing the prepare: query works like expected
3. Same with adding unprepare after dm.SearchQuery.close

with SearchQuery do
    sql.add('select distinct FoldersID, Created, Caption as Mappe, Titel as Buch, BooksID,');
    sql.add('Protected from Scans s join Folders f on s.foldersID = f.foldersID');
    sql.add('join Books b on b.BooksID = f.BooksID');
    sql.add('where (BenutzerID = :FBenutzerID) and (ocr contains :FSearchText) ');
    sql.add('select FoldersID, Created, Caption as Mappe, Titel as Buch, BooksID,Protected');
    sql.add('from Folders f join Books b on b.BooksID = f.BooksID');
    sql.add('where (BenutzerID = :FBenutzerID) and ');
    sql.add('(Caption like :FSearch or Search like :FSearch) ');
    sql.add('order by created desc');

Resolution Resolution
Fixed Problem on 7/25/2009 in version 2.03 build 1

Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial