Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 5 of 5

Thread: Delete all Data from specified Table

  1. #1

    Default Delete all Data from specified Table

    Hey,

    I've a new Problem with JavaScript, RAD and SM!!!

    I need to delete all Data from a Table via JS. Because that Table will be filled with new/same Datasets.

    At the Moment i'm doning this that way:

    Code:
    
    
    var
    incidentFile =newSCFile("svcCatalog");
    var
    rc =incidentFile.doSelect("true");
    print (
    RCtoString(rc));
    while
    (rc==RC_SUCCESS){
    rc
    =incidentFile.doDelete();
    print (
    RCtoString(rc));
    rc
    =incidentFile.getNext();
    }
    The Problem is, that this Fragment is very slow >20 sec for 150 Rows.

    Does anyone know how this cloud be done faster. May as the dbdict Button Reset?

    Thanks for your Ideas and Help!

  2. #2
    Senior Member glg's Avatar
    Join Date
    Aug 2004
    Location
    Chicago, IL, USA
    Posts
    715

    Default

    If you want to delete all records, reset is going to be much faster then going through all records and deleting them one by one.

  3. #3

    Default

    Hey glg,

    I mentioned that, but I don't know how to implemnt that in JS!

  4. #4
    Senior Member glg's Avatar
    Join Date
    Aug 2004
    Location
    Chicago, IL, USA
    Posts
    715

    Default

    you can't, but why would you? Why does this need to be done in JS? If it has to be in JS, the way you're doing it is the fastest.

  5. #5
    Senior Member
    Join Date
    Apr 2006
    Location
    Poland
    Posts
    680

    Default

    Try to wrap the code mentioned here:
    http://www.sc-resources.net/showthread.php?p=3229
    with JavaScript using system.functions.rtecall(.....)

    or using callrad and invoking us.delete

    the second way seems to me to be better. Callrad has been discussed on this forum.

    regards
    Artur

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

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