Search in DB with many companies

janmib
janmib Member Posts: 8
I need a way to find eg. a customer name - this customer name
may be in one of 150 companies in the database.
And I need a list if the name exists in more than one comp.

Ideas anyone ?

Comments

  • Marije_Brummel
    Marije_Brummel Member, Moderators Design Patterns Posts: 4,262
    If the database runs on a SQL engine I would create a view and base a table on that I think.

    Other possibility is to create a function with a lot of changecompanies in a loop on the companytable and running isempties on the customer table. Be sure to have an index on the Name field.
  • Malajlo
    Malajlo Member Posts: 294
    Huh....
    Define var Customers, var Companies (t:2000000006)
    
    Compynies.findfirst ;
    repeat
      Customers.changecopmany(Comanies.name) ;
      if Customers.get.... then....
    until Companies.next = 0 ;
    
  • kriki
    kriki Member, Moderator Posts: 9,135
    Malajlo wrote:
    Huh....
    Define var Customers, var Companies (t:2000000006)
    
    Compynies.findfirst ;
    repeat
      Customers.changecopmany(Comanies.name) ;
      if Customers.get.... then....
    until Companies.next = 0 ;
    

    If you want to loop on your variable, you should use FINDSET and NOT FINDFIRST!!!!!
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!