Re: I4gl query
Posted in 1998
Riaz Change the statement: LET sel_stmt = " SELECT COUNT(*) INTO no_of_rec FROM tt_extract", " WHERE tt_accno = '", l_tt_accno, to: LET sel_stmt = " SELECT COUNT(*) FROM tt_extract", " WHERE tt_accno = '", l_tt_accno, HTH Sujit ______________________________ Reply Separator _________________________________ Subject: I4gl query Author: RIAZJKAPADIA@inf.com at internet Date: 12/09/1998 4:26 AM I am writing this program in i4gl version 7.20D. As you can see in the program below that my query returns only one value that is no or rows. For that I have to declare it as cursor and then open the cursor to get the number. Is there any other way by which I can get the no of counts without having to declare it as a cursor and then opening it. I tried "EXECUTE count_rec INTO no_of_rec" but it is giving me an error saying syntax not recognisable DEFINE l_tt_accno integer --------------- ---------- LET sel_stmt = " SELECT COUNT(*) INTO no_of_rec FROM tt_extract", " WHERE tt_accno = '", l_tt_accno, ---------- ----------- PREPARE count_rec FROM sel_stmt DECLARE cursor_count CURSOR FOR count_rec OPEN cursor_count FETCH cursor_count INTO no_of_rec thanks Riaz