Re: SQL in 4gl
Posted in 1998
The best way to do this ( and maybe the only way), is to declare a cursor using your select statement. then open the cursor using a "foreach" statement. Increment your counter within the "foreach" loop. After you have your count, you can then fetch the 4 rows to the user. Nick Leporacci hashish1@mailcity.com wrote in message <6g1gch$7q3$1@nnrp1.dejanews.com>... >I have two sql statements embedded in the 4gl program, 1(sql1) for fetcing >the data and passing four at a time to the user and 2(sql2) for counting the >whole num of rec. In sql1 im joining 4 tables and selecting 5 common felds so >the record that i obtain appears redundant but if u select all feilds its >actually not, so i use 'select unique' to cut off the rows that appears to be >redundant. The problem comes when i use sql2(select count(*)) statement which >actually counts the 'appears to be redundant records' altogether so i get a >different number. I tried using 'count(distinct [field]) ' but no success, >since i have a composite of fields to be unique. Please help.... > >thank you > >-----== Posted via Deja News, The Leader in Internet Discussion ==----- >http://www.dejanews.com/ Now offering spam-free web-based newsreading