Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What happens with SELECT
Message
From
20/07/2006 17:50:30
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01138114
Message ID:
01138248
Views:
12
Terry -
My example was an extreme simplification for illustration purposes only. In practice my selects are a bit more complicated, as in
select lnk.a as a_node, lnk.b as b_node, lnk.st_name, ;
	nd1.x as a_x, nd1.y as a_y, ;
	nd2.x as b_x, nd2.y as b_y, ;
	abs(nd1.x - nd2.x) as dx, ;
	abs(nd1.y - nd2.y) as dy, ;
	'  ' as stddir, '  ' as rtdir, ;
	iif(a>b,b*100000+a,a*100000+b) as lhnode,  '  ' as lhdir, 0000 as lhcount, ;
	a*100000+b as ab_node, 0000 as abd_count, ;
	.f. as _start, .f. as _end, 000 as seq, ;
	0000 as datakey, '  ' as datadir, ;
	000000000000 as nData1, 000000000000 as nData2, ;
	'                    ' as cData1, '                    ' as cData2 ;
	from (lcLinkfile) as lnk, ;
	(lcNodefile) as nd1, ;
	(lcNodefile) as nd2 ;
	where nd1.n = lnk.a and nd2.n = lnk.b ;
	order by lhnode ;
	into cursor crsSequencedLinks readwrite nofilter
The actual issue I was chasing is the creation of a cursor where the data can be edited and then giving the user a chance to save the edits back to the original file, or optionally saving them into a new file with a different name.

:)


>Hey Don,
>
>In your example you select from some file.
>
>Why is there an issue justing using 'somefile.dbf' as it is. Why are you copying it to a cursor - that's what I should have asked!:-)
>
>Why are you?
>
>>Hi Terry -
>>
>>I must be missing something here. How do you use SEEK to create a cursor?
>>
>>
>>>My Two cents - if you use seek - a little more code, granted - you wll not hog resourse or pump the temp files folder.
>>>
>>>Your app will behave better - look crisper - and in these lean times - it's all about efficiency.
>>>
>>>As often as you can (I know select is convienent), use functions that do not cache data your app has a hard cache point to.
>>>
>>>>I am trying to gain a better understanding of what happens with SELECT INTO CURSOR. If I issue a command such as
>>>>select * from somefile into cursor crsTemp
>>>>
>>>>
>>>>It appears that the original file (somefile) is opened by the OS although it is not technically USED. Is this correct? If yes, then what do we have to do to close the file so that it is available to other programs or so that it can be overwritten? I have tried to
>>>>
>>>>use in crsTemp
>>>>copy to somefile
>>>>
>>>>but I still get an error that says the file is open. Can someone shed some light on this?
>>>>
>>>>Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform