iamdnb
22nd July 2004, 13:30
Can anybody let me know how can I refer the array field from the table i.e. any field with more than one depth in the SELECT query. I need to refer to the tigrt040.code field which has a depth of 20. I need to refer to the 2nd element of the field in the WHERE clause to filter some records. The select statement does not allow to use the fields with index values.
Pls advise how can i accomplish this functionality.
Davendra
richard
22nd July 2004, 15:48
Example:
select tibom010.*
from tibom010
where tibom010._index2 >= {:1, :2, :3, :4}
order by tibom010._index2
as set with 1 rows
wherebind (1, sitm.stack(1, level))
wherebind (2, mitm.stack(1, level))
wherebind (3, pono.stack(level))
wherebind (4, seqn.stack(level))
selectdo
endselect
Regards
mark_h
23rd July 2004, 02:39
If I understand your question you are wanting to do a select where tigrt040.code(2) = somevalue. I think You would have to do something like this:
select tigrt040.*
where tigrt040._index1 = {....}
selectdo
if tigrt040.code(2) <> somevalue then
continue
endif
... do other stuff here....
endselect
You can search this forum for "depth" to find some posts by others on this subject.
Mark
iamdnb
23rd July 2004, 13:30
Thanks Mark. Yes, you got it right. This is exactly what I want to do. If I write query
select tigrt040.*
where tigrt040.code(2) = "some value"
selectdo
...
endselect
the compiler gives error specifying '(' not allowed.
I have created a display session to select the records from it, but i need to filter out records in which tigrt040.code(x) = some value. I am using skip.io() in main.table.io section to skip the records which does not match the condition. But using this functionality the output is very slow and takes time to display records that match the criteria. Instead, I would like to use the query.extension specifying my criteria to filter the records in the query itself...
I hope there must be some solution other than provided by you which can make my session work faster.
Davendra
richard
23rd July 2004, 13:59
I used that:
query.extension = " tisss030.wtac(1,1;4) = ""SOA2"" "
And it works !
Regards
Richard