Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CURSOR?

Status
Not open for further replies.

august

MIS
Aug 24, 2000
150
PH
What really meant by "CURSOR"?
like CURSORSETPROP,CURSORGETPROP and other?

August [sig][/sig]
 
August

A cursor is a temporary table that exists only in memory. It can be manipulated like any other table — it can be browsed and indexed, and you can append and modify records.

It is opened in the lowest available work area, and can be accessed by its alias. Each field in a cursor is defined with a name, type, precision, and scale. These definitions can be obtained from the CREATE CURSOR command or from an array. A cursor is always opened exclusively.

There are limitations to their use. You cannot use a cursor as a controlsource for a grid for instance and they cannot be saved without conversion to a table.

CURSORSETPROP(), as the name implies, is used to set a specific property for a cursor or a table.

CURSORGETPROP(), again as the name implies, returns a specific property for a cursor or table.

You will need to access the VFP help file or other documentation for a full explanation of their function.

Hope this summary helps.

Chris [sig][/sig]
 
In addition to Chris I have some notes:

Cursor is not always in memory. When amount of data in cursor reach some limit, cursor will be buffered on disk in temporary file.

View, remote view and result of SELECT ... INTO CURSOR command are also cursors.

You can open cursor table ALWAYS using command USE (DBF("MyCursor")) again alias MyAlias shared. This works even when cursor is in memory. By such way you can modify result of SELECT-SQL command.

A cursor is always opened exclusively.
Thats not true! You can open it again and again, that shows that it is not used exclusively. Only cursors created by CREATE CURSOR command are used exclusively.

There are limitations to their use. You cannot use a cursor as a controlsource for a grid for instance and they cannot be saved without conversion to a table.
Thats not true too. Both actions are as easy to do as with VFP tables. In addition, cursor created by CREATE CURSOR command can be edited by ALTER TABLE command.


[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Vlad

A cursor is always opened exclusively.

You are correct! I omitted the CREATE CURSOR caveat.

How can you save a cursor without conversion to a table?

Chris


[sig][/sig]
 
How can you save a cursor without conversion to a table?

What you mean as 'conversion'? IMHO simple command 'COPY TO' do all work. Well, if you meant this command as 'conversion', I agree with you.
However, from my POV it is not 'saving', it is data exporting. Any data saved to disk that could be used outside of application and without application running, is just exporting. 'INSIDE' of application, you never need this.
[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Vlad

COPY TO is exactly what I meant as conversion.

In other words, change its state from CURSOR to TABLE because as we both agree, you cannot save a CURSOR directly.

Vlad, these are semantics and as I speak English as a first language, I am probably not expressing myself as well as I should.

The other point concerns using a CURSOR as controlsource.
If you use a grid builder for instance, there is no option to use a CURSOR as controlsource.

What I was trying to explain were some of the limitations of a CURSOR as August may experience them.

Chris

[sig][/sig]
 
Chris, I know English very bad and it is very hard for me to learn it. Anyway, technical terms seems are common, so I know well what is the difference between 'Saving' and 'Exporting'.
Yes, I agree about Grid builder. Never used it, so did not thought it may be a problem. Nice warning! ;)
[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Vlad

Vlad, these are semantics and as I speak English as a first language, I am probably not expressing myself as well as I should.

The point I was trying to make is that instead of using the word &quot;conversion&quot; I should have used technical terminology instead, ie &quot;COPY TO&quot;, etc, hence the self criticism, and your misunderstanding of what I was trying to say.

You have no reason to apologise for your command of the English language - the only word of your language I understand is Vodka!

Chris


[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top