Russ.W

Need help with converting SQL statement to IQueryDef

Discussion created by Russ.W on Apr 29, 2011
greetings all,

I have a big SQL statement and am wondering if its possible to get it all into one IQueryDef.

Select Field1, Field2 from (
Select ST_NAME as Field1, low_cross_street
from STREETS_LL
where st_nm_base like 'M%'
and low_cross_street like 'G%'
and low_cross_street not like '%&%'
union
select low_cross_street as Field1, st_name as Field2
from STREETS_LL
where st_nm_base like 'G%'
and low_cross_street like 'M%'
and low cross street not like '%&%'
union
select ST_NAME as Field, high_cross_street as Field2
from STREETS_LL
where st_nm_base like 'M%'
and high_cross_street like 'G%'
and high_cross_street not like '%&%'
union
select high_cross_street as Field1, ST_NAME as Field2
from STREETS_LL
where st_nm_base like 'G%'
and high_cross_street like 'M%'
and high_cross_street not like '%&%'
) where rownum <= 100
order by Field1, Field2


I understand the basics of IQueryDef i.e.
SQL statement:  Select <fields> from <table> where <clause>

   IQueryDef.SubFields = <fields>;
   IQueryDef.Tables = <table>;
   IQueryDef.Whereclause = <clause>;

but is it possible to put my SQL query into IQueryDef form and if so how?


Thanks in advance to everyone :)

Outcomes