[V4RB 1] Creating Table from Cursor

Carsten Friehe rblists at online.de
Mon Sep 4 19:35:02 CDT 2006


Hi Ruslan!

>I still think you try todo some wrong.
>
>
>------------
>* Can you AGAIN describe your task ?
>* why you think you cannot issue new SQL query ?

Ok, I will try to describe it deeper.

I have a mail and newsreader with the following constellation:
One table with the header-data (message-ID, Date, Group, Thread info etc.)
this is a smaller table
One table with the message-data (Body, Attachments etc.) this is a bigger
table (more data)

Now I have a list in one window with a selection of the messages of one
group. This list is using Einhugurs DataGrid and only displays and select
some records of a small cursor (a join of both tables). This cursor only
selects the data, the subject, the sender and some flags from one group and
maybe only the unread messages.
The second window will show the message-data of a selected row in the other
window. This window also uses a cursor (a join of both tables) for all
selected  messages of one group because you also could use it without the
other list window. This cursor is bigger than the other because it selects
the whole data of the two tables.

If the user bouble clicks a row in the list window it will be shown in the
other window. This is an easy task because thetwo cursors correspond to
each other because the where and order by clause are the same.
If the user navigates in the message-data window to jump to the next
message in the thread or to the previous message the selected row in the
list-window changes too.

This works without any problem. Now here are the problems.

There is a search function in the application which searches the messages
for a text or something else. This search will do a select in the two
tables and returns eg. the message-ID or something else what I will need to
show the record in the list-window or the message-data window. But I will
only get one record that has no corespondence to the other two cursors. The
cursors for the list-window and the data-window should not be changed. They
should only show the found row.
What I thought of today is, that I can select the sorted fields which are
used in the above cursors and do a binary search in one of the above
cursors with this data.

Before I had no problem in doing these searches because the user could not
change the sort order and I had a special field in every record of the
header-data-table which was used for the sort order and so it was the
current record of the resulting cursors. But now the user can change the
sort order to what he likes as eg. sorted by message threads.

I hope that the problem is clearer now.

Best Regards,
Carsten


More information about the Valentina mailing list