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

Thread: Scanning a database table without a doSelect.

  1. #1
    Senior Member sigtb02's Avatar
    Join Date
    Feb 2002
    Location
    Québec city
    Posts
    104

    Default Scanning a database table without a doSelect.

    Im am trying to scan the contacts table and simply print the contact.name. This is my script. But the getSize function does not seem to work ? Any suggestions.

    var contactList = new SCFile("contacts");
    var i = 1;
    var LastRecord = contactList.getSize();
    print ("Contact name :\n" + contactList.contact_name);
    print ("Record number :\n" + i + " of " + LastRecord);
    for (var i=0; LastRecord > i; i++)
    {
    print ("Contact name :\n" + contactList.contact_name);
    print ("Record number :\n" + i + " of " + LastRecord);
    }
    return i;
    Is what you're doing now creating the results you really want?

    Maybe it's time to do something different!
    .

  2. #2
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    I don't understand why you use getSize? This returns the size of an array.

    Your code should look like this instead

    Code:
    var contactsFile = new SCFile("contacts");
    var rc = contactsFile.doSelect("true");
     
    while (RC == RC_SUCCESS)
    {
    print ("Contact name :\n" + contactsFile.contact_name);
    rc = contactsFile.getNext();
    }
    If you just want the last then use getLast() and drop the while loop.
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

  3. #3
    Senior Member sigtb02's Avatar
    Join Date
    Feb 2002
    Location
    Québec city
    Posts
    104

    Default Wow you're quick.

    Here are the results, I get the following error in french.

    Le panneau de traitement eval.expressions de RAD us.link a rencontré une erreur à la ligne 3 (us.link,eval.expressions)
    Impossible d'évaluer l'expression (us.link,eval.expressions)
    Impossible d'évaluer l'expression (us.link,eval.expressions)
    Script <UNKNOWN> ligne 4 : ERROR ReferenceError: RC is not defined au car 1

    Impossible to evaluate expression at line 4 RC is not defined. Is this not suppose to be a system variable ?
    Is what you're doing now creating the results you really want?

    Maybe it's time to do something different!
    .

  4. #4
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    No rc is not a system variable. It has to be defined.

    Sorry I wrote above quickly. Javascript is case sensitive. Thats why you get the error. I the while statement change RC to rc.
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

  5. #5
    Senior Member sigtb02's Avatar
    Join Date
    Feb 2002
    Location
    Québec city
    Posts
    104

    Default I think i got it.

    I get it, its case sensitivve right ?
    Is what you're doing now creating the results you really want?

    Maybe it's time to do something different!
    .

  6. #6
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    Yes.
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

  7. #7
    Senior Member sigtb02's Avatar
    Join Date
    Feb 2002
    Location
    Québec city
    Posts
    104

    Default Reinitialize on screen field value and global variables.

    I am trying to reinitialize dgsig.temp.intervention.prevu and
    dgsig.temp.inter.retour.arriere fields inside of $L.file

    and reinitialize global variable $lo_temps_prevu and $lo_temps_retour.

    This is my script. That does not work.

    var avant = system.vars.$L_file;
    var prevu = system.vars.$lo_temps_prevu="";
    var retour = system.vars.$lo_temps_retour="";
    var avant.dgsig_temp_intervention_prevu="";
    var avant.dgsig_temp_inter_retour_arriere="";

    Any suggestions ?
    Is what you're doing now creating the results you really want?

    Maybe it's time to do something different!
    .

+ 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