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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy command in dbase iii plus 1

Status
Not open for further replies.

prawira97

Programmer
Jul 16, 2014
2
ID
hy everybody... i'm a newbie on using dbase III plus... i want to ask... while we using copy command... when we have to use for command and while command....? please help me.... this is the syntax....

COPY TO <filename>
[<scope>]
[FOR <condition 1>]
[WHILE <condition 2>]
[FIELDS <field list>]
[[TYPE] DBASE | DBMEMO3 | PARADOX | SDF |
DELIMITED [WITH
<char> | BLANK]] |
[[WITH] PRODUCTION]

and one's more.... does anyone able to explain what the meaning from this syntax...? thanks
 
What are you trying to accomplish? I'll give it a try considering the information you've provided thus far...
Most common use of copy is to duplicate the structure of an existing table and populate it with some or all of it's [existing table] data.

Example 1:
Use myTable
copy to newTable​
creates an exact duplicate of myTable named newTable.

Example 2:
Use myTable
Copy to newTable for lastName='Smith'​
creates newTable with only records where lastname is Smith

Example 3:

Use myTable
Index on lastName to lname.ndx
seek 'Smith'
Copy to newTable WHILE lastName = 'Smith'
creates newTable with only the last name of Smith, Example 3 is very much faster than example 2 as example 2 has to check every record in the table to see if last name equals 'Smith'. Example 3, however, seeks the active index [lname.ndx] for the first occurrence of Smith and copies records until it encounters a record not equal to Smith and then stops the Copy operation.

Hope this helps.



Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
hm... thanks a lot lyndon... your advice very helpful..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top