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

Newbie needs idea for 18000 data records

Discuss PocketC for Palm OS (including Desktop Edition)

Postby wahnsinn on Tue Jun 12, 2007 2:55 pm

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.

*
wahnsinn
 
Posts: 12
Joined: Tue Jun 05, 2007 2:19 pm

Postby sangahm on Tue Jun 12, 2007 7:52 pm

See the Survey example in the Architect application for how to save each item as a record in a database.
sangahm
 
Posts: 118
Joined: Mon Jul 04, 2005 3:43 pm
Location: USA

Postby wahnsinn on Wed Jun 13, 2007 5:44 am

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.

*
wahnsinn
 
Posts: 12
Joined: Tue Jun 05, 2007 2:19 pm

Postby Percival on Wed Jun 13, 2007 9:55 am

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?
Percival
 
Posts: 45
Joined: Sat Jul 19, 2003 10:31 am
Location: Netherlands

Postby wahnsinn on Wed Jun 13, 2007 12:31 pm

But in this case, the bagmen have to install and run 90 applications after each update. :(
wahnsinn
 
Posts: 12
Joined: Tue Jun 05, 2007 2:19 pm

Postby Percival on Wed Jun 13, 2007 4:57 pm

Only the updated database is needed.
Percival
 
Posts: 45
Joined: Sat Jul 19, 2003 10:31 am
Location: Netherlands

Postby sangahm on Wed Jun 13, 2007 7:52 pm

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.
sangahm
 
Posts: 118
Joined: Mon Jul 04, 2005 3:43 pm
Location: USA

Postby wahnsinn on Thu Jun 14, 2007 1:45 pm

<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.
wahnsinn
 
Posts: 12
Joined: Tue Jun 05, 2007 2:19 pm

Postby wahnsinn on Thu Jun 14, 2007 1:55 pm

Sorry for double and triple postings. The server spoofed me with some timeout messages ... [:(!]
wahnsinn
 
Posts: 12
Joined: Tue Jun 05, 2007 2:19 pm

Postby sangahm on Thu Jun 14, 2007 10:07 pm

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.
sangahm
 
Posts: 118
Joined: Mon Jul 04, 2005 3:43 pm
Location: USA

Postby wahnsinn on Mon Jun 18, 2007 7:53 am

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?
wahnsinn
 
Posts: 12
Joined: Tue Jun 05, 2007 2:19 pm

Postby FrankG on Mon Jun 18, 2007 12:02 pm

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
FrankG
 
Posts: 210
Joined: Thu Jan 23, 2003 7:58 pm

Postby dewey on Tue Jun 19, 2007 4:51 am

OrbPDB if free, and supports PocketC and OrbC type definition strings.
http://www.orbworks.com/other/orbpdb.html
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby wahnsinn on Tue Jun 19, 2007 5:36 am

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?
wahnsinn
 
Posts: 12
Joined: Tue Jun 05, 2007 2:19 pm

Postby wahnsinn on Tue Jun 19, 2007 7:10 am

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?
wahnsinn
 
Posts: 12
Joined: Tue Jun 05, 2007 2:19 pm

Next

Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 2 guests

cron