[Loadstone] Interesting database tool

Grzegorz Zlotowicz grzezlo at wp.pl
Sun May 24 14:44:52 BST 2009

I just tested a clipboard method described in a previous my msg, and it 
didn't work well on a huge file...
I prepared a 30 megabytes file containing over 300 000 points, after pasting 
it into console it seemed that whole process hungs, but after about 15 
minutes everything started to go...
Half an hour later it seemed, that a db was imported entirely, but it come 
out later, that it contained only about 190000 points, so nearly 35 percent 
was lost.
There seem to be two methods:
1. using a low-level winapi to send keys into a child process, using dbshell 
program, but in this case i think that utf8 characters must be converted to 
ascii before...
This method requires also a way to controlling when a console input buffer 
is not over-run..
2. Writing or modyfying a dbshell executable - interesting is, that 
dbshell.exe has only 13 kilobytes long, very small executable as for win32 
It seems to be a simple wrapper using calls to included dll libraries, many 
of which are added to a program...
Discovering a way of calling these dlls would allow to send strings directly 
to them, without console, which definetely would make whole process faster 
and more reliable...
I wrote to the author of dbshell asking about method of sending sql commands 
from a file, but I rather don't hope to get answer...

Greetings, Greg.
----- Original Message ----- 
From: <monty at loadstone-gps.com>
To: <loadstone at loadstone-gps.com>
Sent: Sunday, May 24, 2009 3:05 PM
Subject: Re: [Loadstone] Interesting database tool

> Hi Grzegorz,
> Wow, this looks interesting and I'll have a look when I have a chance.
> We'll see if we can come up with something to make this work!
> Thanks for finding this and sharing it too!
> Monty
> On Sun, 24 May 2009, Grzegorz Zlotowicz wrote:
>> Hi all,
>> yesterday i found an interesting PC tool, working in console of windows, 
>> called dbshell, which allows to edit and view a Symbian database...
>> This tool would be rather interesting for developers, because it requires 
>> some basic knowledge of sql syntax to deal with a database, and in fact 
>> only one practical way of using it I can imagine is creating a binary 
>> Symbian databases for Loadstone on a pC...
>> This tool is available on a website:
>> http://garawaa.googlepages.com/
>> I tried to use some more or less simple methods to automate a process of 
>> inserting data into a database using this tool, but standard methods of 
>> redirecting stdin from file didn't work, both using cmd commandline 
>> ("dbshell test.db <test.sql") and using a program which creates child 
>> process and makes pipe of stdin from a file...
>> Possibility of automation this process would be great, especially for 
>> creating about 200 databases with hundreds of thousands of points, which 
>> i'm now creating in text form using written by me converter of Polish 
>> opensource map...
>> But it implies time-consuming import of data manually by each user on his 
>> or her phone...
>> One semi-automatic way of doing this import is:
>> 1. Copy a created on phone empty ls database to dbshell folder, let's 
>> say, that this db is named test.db.
>> 2. Execute dbshell test.db
>> 3. Having an loadstone points text file convert it into a sql statements 
>> like:
>> insert into point values ('name',500000000,200000000,0,0,0,3,123)
>> and so on (i did this using written in 15 minutes simple conversion tool, 
>> no error checking of course...).
>> Remark: quotes don't work, replace them with '.
>> 4. Open this file with notepad, and mark all and copy to clipboard.
>> 5. Goto dbshell window, press alt+space, select "edit" from the menu, 
>> then "paste"...
>> 6. Go to an other window...
>> 7. Wait for a process to complete from time to time checking a console 
>> window if there still are moving commands...
>> I found out, that even in this way a process is relatively fast, 
>> importing about 30 thousands of points took no more than 20 minutes...
>> but there is also one serious limitation - no utf8 characters are 
>> transmitted correctly into console using clipboard, so only way is to 
>> convert a file into plain ascii before import.
>> Next limitation is maximum windows clipboard size, but maybe somebody 
>> points out an other than pipe redirection method of writing into console 
>> program running as child process... It would allow to automate whole 
>> thing...
>> Greetings, Greg.
> _______________________________________________
> Loadstone mailing list
> Loadstone at loadstone-gps.com
> http://www.loadstone-gps.com/mailman/listinfo/loadstone

More information about the Loadstone mailing list