General question on Database behaviour/SQL

Ivan Smahin ivan_smahin at valentina-db.com
Tue Nov 7 10:49:02 CST 2006


Hello Florian,

Tuesday, November 7, 2006, 10:40:57 AM, you wrote:

> Hi Ruslan!

> Another question. This syntax produces a cursor I can not write to:

> "SELECT * FROM KUNDENtable,KUNDENKARTENtable WHERE  KD_ID !=0  AND
> CRD_KD_ID=KD_ID "

> Of course and I know. But what if I need to change data from this cursor in
> KUNDENtable only? Actually I do not need any field from KUNDENKARTENtable -
> it is just a search criteria in this case - if KUNDE has a CARD (is linked
> to KUNDENKARTENtable).
> Is there another SQL way to get a read/write cursor?

> If I want to change all resulting records I KUNDENtable and as it is
> read-only - what would be a common approach to change the records?

> Step through the records with a loop and change them with "UPDATE
> KUNDENtable ..."? But then the cursor won't reflect the changes.

> Actually I build a selection with the above SQL and the user steps through
> the address mask and makes changes here and there (in KUNDENtable only)

> And advice?

Do you have the link between KUNDENtable and  KUNDENKARTENtable ?
If so you can use valentina's sql-extension such as "->" operator.

Something like this:
SELECT * FROM KUNDENtable WHERE  KD_ID !=0  AND KD_ID->CRD_KD_ID = KD_ID


-- 
Best regards,
 Ivan                            mailto:ivan_smahin ÎÁ valentina-db.com



More information about the Valentina mailing list