Selvakannan

in embedded sql you need to declare and use a cursor

&sql(declare c1 cursor for
select ID into :SID from BLUELOG.MonthActivity where (Month=:strMonth
and Insurance=:strInsurance and LevelId=:LID))

&sql(open c1)
&sql(fetch c1)
while SQLCODE=0
{
  write !,SID
   &sql(fetch c1)
}
&sql(close c1)



Peter

On Fri, 21 May 2004 17:00:47 +0530, "Selvakannan. S"
<[EMAIL PROTECTED]> wrote:

>Hi,
>
>In my database for BLUELOG.MonthActivity class there is only one record and
>the following query returns  me the  first record id where ever the
>condition i pass.Even if my condition not matchs then also it returns the
>first record id.
>
> set SID=0
> &sql(select ID into :SID from BLUELOG.MonthActivity where (Month=:strMonth
>and Insurance=:strInsurance and LevelId=:LID))
>
>Note: SID returns 1 Even if i change strInsurance or strMonth.
>
>is it Cache SQL bug?
>
>Pls correct me if i am worng.
>
>
>With Regards
>Selvakannan.S
>
>
>


Reply via email to