Board index » delphi » Parameterised query with a union returns no data?

Parameterised query with a union returns no data?

Hello.

I am using an ADO query to select some values I require.

I have set the SQL up so I can simply set the paramters and call requery or
open depending if the query is active or not.

This works fine for many other querys I am using. However one which contains
a union and also refernces a view in both parts of the union does not work.

If I run the SQL by setting the SQL.Text property and open the query it
works fine. However if I set the parameters (I have set their data types)
and either open or requery I get nothing returned.

Is there a limitation on unions within parameterised querys or somethiing???

Also I found I could not set a querys prepared property to true if  the SQL
contianed in the query used a view or stored function.

Any ideas would be greatly appreciated.

Thanks in advance

--

Richard

 

Re:Parameterised query with a union returns no data?


Have you considered building your SQL statement in your code instead of
using parameters?

Christophe.

Richard <richard_p...@bigpond.com.au> schreef in berichtnieuws
3de77...@newsgroups.borland.com...

Quote
> Hello.

> I am using an ADO query to select some values I require.

> I have set the SQL up so I can simply set the paramters and call requery
or
> open depending if the query is active or not.

> This works fine for many other querys I am using. However one which
contains
> a union and also refernces a view in both parts of the union does not
work.

> If I run the SQL by setting the SQL.Text property and open the query it
> works fine. However if I set the parameters (I have set their data types)
> and either open or requery I get nothing returned.

> Is there a limitation on unions within parameterised querys or
somethiing???

> Also I found I could not set a querys prepared property to true if  the
SQL
> contianed in the query used a view or stored function.

> Any ideas would be greatly appreciated.

> Thanks in advance

> --

> Richard

Other Threads