Automated import method

Questions, tips and tricks and techniques for scripting in Servoy

Automated import method

Postby CarmenScoma » Thu Feb 17, 2011 5:59 pm

I want to create a method to automatically run an import script from a separate database into servoy on a regular time interval (every few minutes or every hour).
I have a web form that goes directing into a Non-Servoy database for employee education. That database is used by more than just my company so I can't recreate it in Servoy. The data can be exported as tab delimited, comma delimited, csv, etc. and it can be automated to export on time intervals. I want to be able to then import that data directly into Servoy or the sql back end on a regular interval but I cannot find a function to save import settings and run as a method without user interaction. Any suggestions?

Thanks

Carmen Scoma
CarmenScoma
 
Posts: 19
Joined: Thu May 25, 2006 7:27 pm

Re: Automated import method

Postby lvostinar » Wed Mar 02, 2011 3:48 pm

CarmenScoma wrote:I want to create a method to automatically run an import script from a separate database into servoy on a regular time interval (every few minutes or every hour).
I have a web form that goes directing into a Non-Servoy database for employee education. That database is used by more than just my company so I can't recreate it in Servoy. The data can be exported as tab delimited, comma delimited, csv, etc. and it can be automated to export on time intervals. I want to be able to then import that data directly into Servoy or the sql back end on a regular interval but I cannot find a function to save import settings and run as a method without user interaction. Any suggestions?

Thanks

Carmen Scoma


You can use a batch processor to open the csv file and save it to the database. We have a text import/export plugin, but that does not include an import function (only export one). Or do you already have the code that reads the file and saves it in the dabatase ?
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: Automated import method

Postby ngervasi » Wed Mar 02, 2011 4:32 pm

If you could connect to it via Servoy you could just use a scheduler to query the db using sql and create the new records in your servoy tables. A lot easier and error free compared to export/import.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy


Return to Methods

Who is online

Users browsing this forum: No registered users and 10 guests

cron