INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Tables

INSERT vs INSERT - SQL by ChrisRChamberlain
Posted: 17 Jul 04 (Edited 18 Jul 04)

The INSERT command was the native xBase language predecessor of the INSERT - SQL command and has one major advantage - it allows you to insert a new record anywhere in a table.

Modern processors largely overcome the performance problem associated with such a feature, but even so the use of the command needs careful consideration by the developer.

No longer documented but still available, the syntax of the INSERT command is:-

INSERT [BEFORE] [BLANK]

Description:

INSERT
places a new record into the current table immediately after the current record and displays the new record for editing.

If CARRY is SET ON and BLANK isn't included, data in the previous record is automatically copied into the new record.

Note - if the file is indexed, INSERT works like APPEND.

Clause BEFORE

    Issuing INSERT BEFORE inserts a new record into the current table immediately before the current record. The record is then displayed for editing. Data can only be entered into the new record.

Clause BLANK

    Issuing INSERT BLANK inserts a new record into the current table immediately after the current record. An editing window is not displayed.

    Issuing INSERT BLANK BEFORE inserts a new record into the current table immediately before the current record. An editing window is not displayed.

Note - INSERT is not recommended for use with large tables because an insertion near the front of the table forces the rewriting of nearly every record.

It' s also important to note that the RECNO() order changes after each record insertion.

So if you GO TOP and INSERT BLANK BEFORE, the RECN() of that new record becomes 1, and what was previously 1 now becomes 2, etc.

ChrisRChamberlain

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close