getting the same record multiple times in a cursor

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Feb 18 08:20:06 CST 2007


On 18/2/07 4:13 PM, "jda" <jda at his.com> wrote:

>>>  I'd like to create a cursor in which the same table record can be
>>>  represented more than once. That is, if the user asks for the same
>>>  record twice in a single query, I'd like two records returned in the
>>>  cursor.
>>> 
>>>  Is that possible?
>> 
>> I think no.
>> 
>> EACH record must be multiplied N times?
>> What sense in this ?
>> 
> 
> Hi Ruslan,
> 
> I'm coordinating information interchange with another application.
> The other app sends me a list of records it wants returned. My app
> fetches them and sends them back. Later the other app may send me the
> list again, for updating, and there needs to be a one-to-one
> correspondence between the records. The problem is that users may ask
> for the same record twice (don't ask why!) and so I must supply it
> twice, in the order they ask for it.

This is a list of RecIDs?
And order is important ...

> I don't think there is an easy way to do this with SQL. The only
> solution I can think of is to do a myCursor.AddRecord but not do an
> UpdateRecord. Messy.

First that come to mind:

    WHERE RecID in (5, 76,84, 76)

But this will not save you order. And 76 will be only once.

May be you need produce tmp (and RAM) table?
But you need do later updates ...
So updates should go into original table.

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list