overwrite temp table

jmac13

Member
what do you mean overwrite? How would you do it with a normal table? You’d find the record you want and assign new values
 

Rupa

New Member
when i change the value with a new value it isnt overwriting the previous value..suppose

color red
but when i change it to blue it displays
color red
color blue.........
instead of just
color blue
 

TomBascom

Curmudgeon
As jmac13 mentioned posting your code would make it so that we can comment much more meaningfully. Use "code tags" aka the "#" button, on the "go advanced" posting option to make it readable. Like so:

Code:
/* sample.p
 *
 */

message "Use CODE tags!  They make your sample code postings so much more enjoyable!"

None the less... your "output" seems to suggest that you are not changing anything. You seem to be creating a new record and now you have two -- "red" and "blue".
 

Reynold

Member
Yes Senior developers are telling correct .... you should provide the sample code so that someone can understand what exactly you are looking for ... I can try to help you with below example:
Code:
def var i as int no-undo.
def temp-table tt-color
    field t-range as CHAR COLUMN-LABEL "Color Name".

empty TEMP-TABLE tt-color.
i = 1.
do i = 1 to 2:
create tt-color.
update tt-color.t-range WITH FRAME X.
end.

FOR EACH tt-color:
    DISPLAY tt-color.
    PAUSE.
END.

for each tt-color:
    if tt-color.t-range = "red" then
        assign tt-color.t-range = "blue".
    display tt-color.
end.

First time when it ask for Color Name.. enter "red" and 2nd time enter "green". Then you can see it will disply your record first and then overwrite red with blue.
 
Top