Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Newbie needs idea for 18000 data records
Page 1 of 2

PostPosted: Tue Jun 12, 2007 2:55 pm
by wahnsinn
Hi,

I'm creating my first PalmOS application and I'm having the my next huge problem now.

The user should be able to enter a search string and the application shows all records, where the string was found. That's working great. I entered some test-strings in an array and coded the search routine.

Code: Select all
string shopdata[7] = {
   "0000040053981\nGourmet Gold Friskies Pastete mit Thunfisch und Makrele\n0,45",
   "0000040056050\nThomy Delikatess-Senf\n0,89",
   "0000040056494\nGourmet Gold Friskies Pastete mit Rind\n0,45",
   "0000040058054\nHansaplast Classic Meterware\n2,99",
   "00013330\nLebenszeichen Proof of Life\n7,99",
   "999423001\nCoca Cola Spardose\n6,99",
   "999425001\nCoca Cola Metall-Dose mit Schloss\n6,99",
   "999432004\nB?ɬºbchen Shampoo & Shower Sport'n Fun + 25 % mehr Inhalt\n1,69"
};


But my problem now is, that I have to handle about 18000 data records and I don't know how to get them into my application.
My first experiment with entering in my source code worked great with some test data. But as I expected, it doesn't work. My compiler tells me "<b>string segment too large</b>", when I try to enter all my data this way. When I test it with only 800 records, I can compile my application but I only get a white screen on my Palm and it seems to hang up.

Has anybody an idea at can explain it to an absolute PocketC-noob, how to get 18000 data records into that machine?

One last info: My Palm is a <b>Z22</b> - no card reader - only touchpad, pen and HotSync via USB.

*

PostPosted: Tue Jun 12, 2007 7:52 pm
by sangahm
See the Survey example in the Architect application for how to save each item as a record in a database.

PostPosted: Wed Jun 13, 2007 5:44 am
by wahnsinn
Do I create the database records each time, my application starts?

I think I have to explain, that the application should be provided the the companies bagmen. So it's necessary, that all bagmen alway have the newest data.

*

PostPosted: Wed Jun 13, 2007 9:55 am
by Percival
Split the data into smaller parts, like 200 strings (that would mean 18000/200=90 applications). Then append the strings into the same database.

Each application opens the same database and creates 200 records. At the end, a database is created with all the records in it.
The disadvantage of this is that you will have to create 90 identical apps except for the strings, and each of apps need to be executed once.

Can anyone think of a more simple solution?

PostPosted: Wed Jun 13, 2007 12:31 pm
by wahnsinn
But in this case, the bagmen have to install and run 90 applications after each update. :(

PostPosted: Wed Jun 13, 2007 4:57 pm
by Percival
Only the updated database is needed.

PostPosted: Wed Jun 13, 2007 7:52 pm
by sangahm
Where are the 18000 records currently? In Access, excel, or a txt file?

One way is to copy/paste them into as many memo records as possible and then create an application to read those memo records into your database.

Another way is to use a database application like SmartlistToGo, or DB-Pilot, and bring them into that database. Then use your app to read the records.

Also, a more pricey solution is to use Database Converter Plus (http://www.palmgear.com/index.cfm?fuseaction=software.showsoftware&PartnerREF=&siteid=1&prodID=91827) or (http://tinyurl.com/2dacxd) which can convert into your required format.

PostPosted: Thu Jun 14, 2007 1:45 pm
by wahnsinn
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by sangahm</i>
<br />Another way is to use a database application like SmartlistToGo, or DB-Pilot, and bring them into that database. Then use your app to read the records.

Also, a more pricey solution is to use Database Converter Plus (http://www.palmgear.com/index.cfm?fuseaction=software.showsoftware&PartnerREF=&siteid=1&prodID=91827) or (http://tinyurl.com/2dacxd) which can convert into your required format.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">I downloaded a trial of SmartListToGo, I brought all my data in a smartlist, I synchronized the Palm and now I can see the data records in the SmartList Palm application.

But how can I read the data with my application? I tried to find help in the "Survey" tutorial, but it doesn't work.

Code: Select all
struct ProductData {
   string number;
   string text;
   float price;
};

ProductData product;

bool readRecord(int iRecord) {
   // read the current record from the database
   Database db;
   DBRecord rec;
   bool bRet = false;
   
   // open the database
   if(db.open("abodo", false)) {
      if(db.getrec(iRecord, rec, true)) {
         rec.read(&product, typeof(product), 1);
         rec.close();
         bRet = true;
      }
      db.close();
   }
   return bRet;
}


Code: Select all
int i=0;

while(readRecord(i)) {
      
   output.insert(format(i, 0)+"/"+product.number+"/"+product.text+"/"+format(product.price, 2)+"/end");
      
   i++;
}


But the only thin I see is: <b>0///0.00/end</b> - only that single line.

PostPosted: Thu Jun 14, 2007 1:55 pm
by wahnsinn
Sorry for double and triple postings. The server spoofed me with some timeout messages ... [:(!]

PostPosted: Thu Jun 14, 2007 10:07 pm
by sangahm
Not sure if SLTG still has their API for Palm to allow access into their database structure. You might try looking here: http://www.dataviz.com/products/smartlisttogo/sdk/index.html

Note: I have not tried to do this, so I don't know how feasible it is; nor how to call the external APIs from Designer/Architect. J Dewey might be able to provide input here.

PostPosted: Mon Jun 18, 2007 7:53 am
by wahnsinn
So, the smartlists is not in the internal Palm database? That's not good. Does that mean, when I use the smartlists, we need to buy and install it for each bagmen's Palm?

Isn't it possible to use the standard Palm database and to provide the bagmen one single update file to synchronize, when the products list has changed and need to be updated?

PostPosted: Mon Jun 18, 2007 12:02 pm
by FrankG
OrbForms Designer has the orbpdb utility which allows converting between a PC file (text, CSV, ...) and a PDB file. In your case you can create the 18000 record file on your PC, convert to PDB and sync it to the PDA. This can happen as often as the database updates are needed.

Not sure if this utility is available for PocketC licensees (but your code looks like PCA ?) but at the very least you can buy OrbForms Designer for a reasonable amout of money to get the utility if it's not already available. (Actually, download PocketTEA from PalmGear; I think I include it in the distribution!)

HTH,
Frank

PostPosted: Tue Jun 19, 2007 4:51 am
by dewey
OrbPDB if free, and supports PocketC and OrbC type definition strings.
http://www.orbworks.com/other/orbpdb.html

PostPosted: Tue Jun 19, 2007 5:36 am
by wahnsinn
Thanks to you both. That seems to be a good tool. But I still have one little (I hope my last) problem.

When I sync the PDB file, the application on the Palm is deleted and when I sync the application, the database is deleted. For both, I use the same Creator ID and in the OrbForms Designer, I've entered the DB name.

What do I do wrong?


// edit:
I think, I got it! I must not enter the same DB name in the Designer as the PDB uses. It has to be a unique name, where the application is saved. Right?

PostPosted: Tue Jun 19, 2007 7:10 am
by wahnsinn
Ok, everything works now. But very slow with the 18000 records.

I didn't find how to search a string in the database. So, at the moment I'm opening each record and compare, if the searchstring is found. But it takes so very very much time to open and compare each database record.

Does anybody know a faster way to search for strings in the database?