TurboSQL 'With' Select Issue

Tags: #<Tag:0x00007f2248c0b4c8>

I’m using TurboSQL quite extensively without any issues but trying to use a particular statement Clarion does not seem to be identifying it as a select and tries to just execute the SQL rather than returning the records.

The statement is using a parent child relationship in a single table and I need to return the ID of the top level parent so …

with houparent as
select hohid, hohid_materials from houhead where hohid = 307
union all
select houhead.hohid, houhead.hohid_materials from houhead join houparent on houhead.hohid = houparent.hohid_materials
select hohid from houparent where isnull(hohid_materials,0) = 0

I guess it is the lack of a ‘select’ at the start of the query that is the issue.

Has anyone else used similar and found way to force Clarion to see it as a select statement?

Don’t use Prop:SQL but Prop:SQLRowSet.