Re: Updating a database once per day - An example

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 17966
interpreted = N
texte = Thanks Ken,As you point out, this situation would be for after a database file has been manually changed. Often an organization will have a legacy database, and their IT department will be able to easily export a tab-delimited database to the Web server on a regular basis (i.e. once per hour, or once per day). After each new export of the database to the Web server, WebCatalog must be issued the [closedatabase] command for each applicable file.[CloseDatabase mydatabase.db] does two things: 1) It writes all changes to disk (in this example, there are no changes so nothing happends) 2) It then flushes the database from RAMNow, what I am trying to accomplish, mydatabase.db (which happens to be copied from the MainFrame to the Web Server at 3:03AM each night with the name mydatabase.db) will be closed at 3:10am, and then re-openned with fresh contents the next time it is needed.Steve steve@pop-art.com>>Here's an example of how I implemented a solution for making sure that >>Webcatalog is using the most recent copy of mydatabase.db: >> >>Rather than issuing an Applescript to tell Webcatalog to close databases at >>a certain time each day, I generated some WEBDNA that will close a specific >>database the first time it is needed after 3:10am. >> >>Here's the code: >> >> >>[SHOWIF [LOOKUP >>DB=flush.db&value=[url][date][/url]&lookinfield=DATE1&returnfield=TIME1¬fou >>nd >>=NOT_FOUND]=NOT_FOUND] >> >>[SHOWIF [time %H]>2] >>[SHOWIF [time %M]>9] >>[CLOSEDATABASE ../mydatabase.db] >>[CLOSEDATABASE FLUSH.DB] >>[APPEND flush.db]DATE1=[URL][date][/URL]&TIME1=[URL][TIME][/URL][/APPEND] >>[/SHOWIF][/SHOWIF][/SHOWIF] >> >>--------------------- >>flush.db: >> >>DATE1 TIME1 >>05/28/1998 14:48:50 >>05/29/1998 07:18:43 >> >>---------------------- >>I welcome all questions and suggestions. > > >Hi Steve, > >I din't understand what you're trying to accomplish here. Your code closes >the mydatabase.db file, but it doesn't change anything in that db,and it >doesn;t replace that file with another file. You never have to close the >db just to make sure WebCat's using the most recent data, because the most >recent data is always in RAM -- unless you're thinking about manually >replacing that file with another more recent one. Is that what you're >trying to accomplish here? Sorry I don't understand ... > >Sincerely, >Ken Grome >808-737-6499 >WebDNA Solutions >mailto:ken@webdna.net >http://www.webdna.net Associated Messages, from the most recent to the oldest:

    
  1. Re: Updating a database once per day - An example ( 1998)
  2. Re: Updating a database once per day - An example (bob 1998)
  3. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  4. Re: Updating a database once per day - An example (Steve Rosenbaum 1998)
  5. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  6. Re: Updating a database once per day - An example (Marty Schmid 1998)
  7. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  8. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  9. Re: Updating a database once per day - An example (Gary Richter 1998)
  10. Re: Updating a database once per day - An example (Peter Ostry 1998)
  11. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  12. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  13. Re: Updating a database once per day - An example (Rob Marquardt 1998)
  14. Re: Updating a database once per day - An example (Peter Ostry 1998)
  15. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  16. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  17. Re: Updating a database once per day - An example (Rob Marquardt 1998)
  18. Re: Updating a database once per day - An example (Rob Marquardt 1998)
  19. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  20. Re: Updating a database once per day - An example (Steve Rosenbaum 1998)
  21. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  22. Updating a database once per day - An example (Steve Rosenbaum 1998)
Thanks Ken,As you point out, this situation would be for after a database file has been manually changed. Often an organization will have a legacy database, and their IT department will be able to easily export a tab-delimited database to the Web server on a regular basis (i.e. once per hour, or once per day). After each new export of the database to the Web server, WebCatalog must be issued the [closedatabase] command for each applicable file.[CloseDatabase mydatabase.db] does two things: 1) It writes all changes to disk (in this example, there are no changes so nothing happends) 2) It then flushes the database from RAMNow, what I am trying to accomplish, mydatabase.db (which happens to be copied from the MainFrame to the Web Server at 3:03AM each night with the name mydatabase.db) will be closed at 3:10am, and then re-openned with fresh contents the next time it is needed.Steve steve@pop-art.com>>Here's an example of how I implemented a solution for making sure that >>Webcatalog is using the most recent copy of mydatabase.db: >> >>Rather than issuing an Applescript to tell Webcatalog to close databases at >>a certain time each day, I generated some WEBDNA that will close a specific >>database the first time it is needed after 3:10am. >> >>Here's the code: >> >> >>[SHOWIF [LOOKUP >>DB=flush.db&value=[url][date][/url]&lookinfield=DATE1&returnfield=TIME1¬fou >>nd >>=NOT_FOUND]=NOT_FOUND] >> >>[SHOWIF [time %H]>2] >>[SHOWIF [time %M]>9] >>[CLOSEDATABASE ../mydatabase.db] >>[CLOSEDATABASE FLUSH.DB] >>[APPEND flush.db]DATE1=[url][date][/URL]&TIME1=[url][time][/URL][/APPEND] >>[/SHOWIF][/SHOWIF][/SHOWIF] >> >>--------------------- >>flush.db: >> >>DATE1 TIME1 >>05/28/1998 14:48:50 >>05/29/1998 07:18:43 >> >>---------------------- >>I welcome all questions and suggestions. > > >Hi Steve, > >I din't understand what you're trying to accomplish here. Your code closes >the mydatabase.db file, but it doesn't change anything in that db,and it >doesn;t replace that file with another file. You never have to close the >db just to make sure WebCat's using the most recent data, because the most >recent data is always in RAM -- unless you're thinking about manually >replacing that file with another more recent one. Is that what you're >trying to accomplish here? Sorry I don't understand ... > >Sincerely, >Ken Grome >808-737-6499 >WebDNA Solutions >mailto:ken@webdna.net >http://www.webdna.net Steve Rosenbaum

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Grep Help (2003) shipping costs (1997) Thanks Grant (1997) & problem (1999) Automated FTP from Shell (2004) psst (1997) Harvesting invalid email addresses from bounced emails??? (2000) Occasional crashes with $remove (1997) authenticating a second user (1997) can pull down menu do a ONCHANGE= without Java script? (2000) EMAILER ERROR (2003) Random sort is not random at all..... (2000) absolute paths for databases? (1997) Using files in an Email broadcast (1999) Read and weep (2003) Follow-Up to: Removing [showif] makes a big difference in speed (1997) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) [writefile] (1997) Emailer setup (1997) Search in 2 or more catalogs (1997)