Results 1 to 7 of 7

Thread: set exclusive

  1. #1
    Member
    Join Date
    Sep 2015
    Posts
    80

    set exclusive

    hi,

    I want to delete all records in a table and set exclusive to on

    select artrans
    set exclusive on
    delete from artrans
    pack

    But every time I run the project an error prompt says

    Exclusive use of table is required.

    thanks a lot

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    Hi,

    In VFP you would "USE" with EXCLUSIVE.

    Josip

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,881
    Hi,
    try with:
    select artrans
    use
    use artrans exclusive
    delete from artrans
    pack

  4. #4
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,941
    To add to what other posters indicated: with VFP-type tables, a deleted record still exists in the table, except it is internally flagged as deleted. So everything in your lines of code would have worked without the "pack" statement: that command physically removes the deleted records. This is true in VFP as well. It is required because of the many problems that could happen (such as another user attempting to update a missing record, which they had queried in a Virtual Table; or another user issuing a RECALL command during the middle of a PACK executed by a different user).

    Hank

  5. #5
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hello,

    If you want to delete all records in a table, wouldn't the use of zap be more effective (or just as effective)?

    set exclusive on
    use artrans
    zap

    Cory

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    In v2.0 as stated in the roadmap...

    • Added a new SQL command TRUNCATE TABLE tablename [IF EXISTS]. This is the equivalent of USE tablename followed by ZAP.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Senior Member
    Join Date
    Apr 2012
    Location
    Dubai, United Arab Emirates
    Posts
    485
    As always with Lianja we get the things we need in record time

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us