Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array not showing updated record
Message
 
To
19/06/2002 13:07:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00670174
Message ID:
00670231
Views:
25
Thank you for answering. I'm sorry Cetin, I did mean
Insert into lv_veh(v_no) value (alltrim(.txtv_no.value))
However, I tried you example, and the array returned a 0 for v_id. v_id is an integer value that is primary key in my table. I know the record was wrote because a nextid.prg file assigns unique integer number everytime I insert into my table for v_id. I went through that code in during insert by using the debugger. The reason why I used alltrim was because
.txtv_no.value had spaces like this 'H    '
and
lv_veh.v_id had spaces like this 'H '
Since I was using == to compare, I though I should keep both sides same.
I put the following statment after select into array to see what values was in the view
					select lv_veh.v_id FROM lv_veh WHERE ALLTRIM(lv_veh.v_no) == ALLTRIM(m.vno) into array a__gen2
					mx = lv_veh.v_id
					mz = lv_veh.v_no
					mp = lv_veh.v_vin
mx return 0 && which is incorrect should be 152
mz return H && which is correct
mp return H && which is correct

Is there another way I can get the v_id value?

Thanks
Nick Patel



>>If I insert a value into a view, then try to find the value from the view by selecting to an array, the value doesn't appear. The array returns back empty. I know the insert was successful because when I go and look at the table, the data is there. I'm I doing something wrong here?
>>
>>
>>cursorsetprop('sendupdates', .T.,'lv_veh')	
>>Insert into lv_veh(v_no) value (alltrim(.txtv_no))
>>tableupdate(.t., .t., 'lv_veh')
>>vno = alltrim(.txtV_no.value)
>>select lv_veh.v_id FROM lv_veh WHERE ALLTRIM(lv_veh.v_no) == ALLTRIM(vno)   into array a__gen2
>
>>
>>Thanks
>>Nick Patel
>
>Nick,
>There is .txtv_no and .txtv_no.value in code. Very rarely I saw you could have a property and object with same name but not even sure how to replicate.
>
>Would this work right ?
>
>
>Insert into lv_veh(v_no) values (.txtv_no.value)
>tableupdate(.t., .t., 'lv_veh')
>vno = .txtV_no.value
>select lv_veh.v_id ;
>  FROM lv_veh ;
>  WHERE lv_veh.v_no == m.vno ;
>  into array a__gen2
>if _Tally > 0
> wait window 'Worked '+trans(a_gen2)
>endif
>PS: You don't need alltrim unless it's for left trimming.
>Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform