Why won't this update statement work?
Ruslan Zasukhin
sunshine at public.kherson.ua
Sat Mar 13 22:48:45 CST 2004
On 3/13/04 10:29 PM, "Kristafer Vale" <kristafer at comcast.net> wrote:
> Hmm, I guess I'm just used to things like coldfusion and what not where you
> can query the database for a number of records and then loop through those
> records changing one value as you go and automatically updating the database
> as it goes. I confess to not completely understanding cursors and their
> uses.
> I assumed that they were just Valentina's way of selecting records now
> I see it actually copies the data in question and allows you to perform some
> operations on that copy of the data, but then how does it put the data back
> to the original table? I'm confused, and I've re-read the docs many times,
> could you explain cursors a bit more to me? Offline is fine,
I am sure cursors are NOT just in Valentina.
You can meet them in many DB related products/frameworks
(MFC, ADO, OLE DB, ..)
Think about cursor in the next way:
1) you can have MANY cursors on the same table(s)
2) Cursor is result of SELECT query.
3) Cursor create tmp table of result.
although sometimes Valentina do optimization and do not create tmp table.
4) Cursor actually very similar to Table.
5) you can navigate record of cursor.
Next/Prev, First/Last
6) Cursor have own RECORD BUFFER, so each cursor have own CURRENT RECORD.
7) IF cursor is not ReadOnly you can MODIFY its records.
usually this is when you do SELECT on single table.
8) so let you have cursor which you can modify.
You can
-- fill fields of cursor and say AddRecord()
this will add record to cursor
AND to table that cursor was SELECTed for.
how Valentina do this? Cursor know its table.
cursor know how ITS records related to Table records.
-- in the same way you can UPDATE DELETE records of cursor
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list