I do not know if this is the right place to post this… So here I go…
I have a splash screen to enter new appointments and it works fine, displays the date as 1/1/2011.
However, when I export data into a csv file, the date is: 2011-01-01 14:36:25.89
I read in the forums I can, within dataproviders, use a GlobalMethodConverter conversion, but I am not really understanding what to do,
the first line reads: fromObjectMethodName VAlue:
the second reads: toObjectMethodName Value:
What do i put in the value fields:
do I somehow show the existing date format in the first, and the required date (01/01/11) in the latter?
Any help will be greatly appreciated
OOPS, forgot to mention… am using Servoy 3.12 , sybase asa v 10.1, running on Centos 5.5
Thanks for the suggestion of creating a global method. I did, naming it dateconversion using your code you provided. below is a screenshot of what I did with it… and this is where I think I am still making a mistake. So can anyone comment?
Additionally, I tried to use sql query with dateformat… here is the code:
SELECT phone_home_client, creationdate, dateformat(creationdate, ‘mm/dd/yy’), appt_time, staff_email
FROM outcomes WHERE specifier1 = ‘Next TASC Appointment’;
OUTPUT TO ‘/home/stevek/Desktop/test2day.csv’
it returns:
‘(218) 111-1111’,‘2011-03-24 22:40:04.353’,‘03/24/11’,‘10:30 am’,‘my_email@com’
What happens is the creation date is converted, but into a seperate field. The csv file I need to provide must be phone, date, etc in that order.
So it looks like I still need to either add a :sed line in the sybase event (can’t figure out how to include a sed command, or when the file is created, make a shell script to purge the system date field.
To complicate matters, the programmer requires the phone is numbers only, no - of (), jsut numbers…
Anyway, any help resolving this will be very appreciated
Here is another quandry… when I put the following in an event within sybase (connected to db of course) it runs successfully and creates the csv file… HOWEVER, when I click to save it… I get this error…
We have purchased a auto phone dialer system to remind clients of appointments, so I have to export a csv file with phone_number, appt_date, appt_time,email of staff (for notification of message delivery).
I really do not want to have a daily chore of manually exporting the data. I’d much rather make a scheduled task. Since I cannot do this through sybase (events)I need another way. I read in the help file of sybase interactive help, a section explains running ‘batch-mode’ via command prompt.
it gives the command dbisql -c “DSN = mydatabase” my_daily_script.sql
however it errors unable to find libdblib10_r.so.
I am running servoy v 3.12 on centos, sybase is v 10.1
I saw a suggestion to use scripting in servoy createfile , writefile, and writeTXT file, but have not read on this to see how that would work.
One glitch isthe vender requires the data to be different than how it is saved in servoy.
phone must be 1112223333, date must be 01/01/01 I think I have found the solution for the date, am looking for a way to strip the () out of the area code part of the phone number, but I really want to make this automated
Looking again through the forums… I saw this post:
Report this post
Reply with quote
csv export speed
Unread postby lesouef » Tue Jun 08, 2010 12:37 pm
I am currently exporting csv file using several ways among the which the fastest seems to be:
var dataset = databaseManager.convertToDataSet(foundset,new Array(‘field1’,‘fiedl2’,…,‘fieldn’);
data = dataset.getAsText(“;”, “\r\n”, null, true);
var $result = plugins.file.writeTXTFile($file,data);
Although it was referring to speed, I am using only one table. I wonder if I could use this by making this a method on the form, and when the staff save the data to the db, I could run this and get the csv file that way?
I’ve tried a lot of ways to export data, but this one is -by far- the most save & fast way, even considering very large datasets.
Basically this can be an iteration of ‘whatever set of data’ you have.
Just grab the text from it, the way you like it and append it to a file each time.
the ‘dataset.getAsText(“;”, “\r\n”, null, true);’ you referenced is nice, but as this is all an ‘in memory’ action you may run into out of memory situations with very large sets of data.