Hi Himanshu,

I always put a Fetch classmethod in all my %Persistent classes. Here's an
example for a class called ACT.ACTVt::

 ClassMethod Fetch(SN As %Numeric, VNUM As %Integer) As ACT.ACTVt
{
    &sql(SELECT ID INTO okey FROM ACT.ACTVt WHERE (SN=:SN) AND (VNUM=:VNUM))
    Quit:SQLCODE $$$NULLOREF ; Lookup failed (not found)
    Quit ##CLASS(ACT.ACTVt).%OpenId(okey) ; Lookup succeeded, return the
object
}

You pass it values for the fields in the primary key (in this case SN And
VNUM). It returns you the object itself (if found) without all that messing
about with OIDs, etc.

Regards

Jay Ayliff
Stalis Ltd

"Himanshu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Thanks a lot guys for the help.
>
> I've decided to go ahead and use the ActiveX/COM method. Have got it to
work
> using DynamicSQL. Will play around with the OpenID method soon. For the
> OpenID method though, where does one get the ID from?
>
> "Peter Cooper" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > <snip>
> > > Unfortunately it's all late-bound so you get no intellisense at
> > >design time.
> >
> > and that's the big advantage of SOAP
> >
> > Peter
>
>



Reply via email to