Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Cursors that are created by the INTO clause of a SELECT command are by default not updateable. In order to make them updatable you can:
USE DBF('nameofcursor') AGAIN in 0 ALIAS someothername
then make the changes to that work area.
The updatability that you are referring to in you question has to do with making changes to a view cursor and having those changes reflected back in the underlying (original) tables.
>Well I used CURSORSETPROP("Buffering", 5, "myCursor") and it still won't let me update it.
>
>What I'm trying to do is insert data into dummy fields I built into a previous query. Like this:
>
>SELECT table1.field1, table2.field2, 000000 AS dummy1, 000000 AS dummy2;
>FROM table1, table2;
>WHERE ..More SQL Stuff...
>INTO CURSOR myCursor
>
>In order to calculate the data I need I have to run a second SELECT, I'm working on a union solution but haven't been able to get it right yet, this is my work around.
>
>After I run the second SELECT I just want to update/replace the data in the dummy values in myCursor. I keep getting "Can't update the cursor" with or without the CURSORSETPROP settings.
>
>/Chris
>
>
>>First create the cursor as usual.
>>
>>Then look at the help for CURSORSETPROP. You can pass several parameters, but the first parameter is the property of the cursor you want to set. You will need to set several properties including Tables (the tables you will be updating), UpdatableFieldList (the fields that you want to be able to update), KeyFieldList (which fields are key values so the update can find the right record to update), UpdateType, and WhereType. There may be some other options you want to set, but I think this is the core set. Basically it sets the same properties that you would set visually when you design a View.
>>
>>Mike
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement