19 #define DBSQLCONSTANTS_H |
19 #define DBSQLCONSTANTS_H |
20 |
20 |
21 #include <cntdef.hrh> |
21 #include <cntdef.hrh> |
22 |
22 |
23 const TInt KInitialValue = -1; |
23 const TInt KInitialValue = -1; |
24 |
24 const TInt KNumOfTables = 16; |
25 // TODO: update this to handle all 10 predictive search tables |
|
26 const TInt KNumOfTables = 14; |
|
27 const TInt KNumColInPrefTable = 6; |
25 const TInt KNumColInPrefTable = 6; |
28 const TInt KNumColInContactTable = 16; |
26 const TInt KNumColInContactTable = 16; |
29 const TInt KNumColInGroupTable = 3; |
27 const TInt KNumColInGroupTable = 3; |
30 const TInt KNumColInCommTable = 5; |
28 const TInt KNumColInCommTable = 5; |
31 const TInt KNumColInPredSearchTable = 7; |
29 const TInt KNumColInPredSearchTable = 7; |
44 _LIT(KSqlContactPredSearchTable5,"predictivesearch5"); |
42 _LIT(KSqlContactPredSearchTable5,"predictivesearch5"); |
45 _LIT(KSqlContactPredSearchTable6,"predictivesearch6"); |
43 _LIT(KSqlContactPredSearchTable6,"predictivesearch6"); |
46 _LIT(KSqlContactPredSearchTable7,"predictivesearch7"); |
44 _LIT(KSqlContactPredSearchTable7,"predictivesearch7"); |
47 _LIT(KSqlContactPredSearchTable8,"predictivesearch8"); |
45 _LIT(KSqlContactPredSearchTable8,"predictivesearch8"); |
48 _LIT(KSqlContactPredSearchTable9,"predictivesearch9"); |
46 _LIT(KSqlContactPredSearchTable9,"predictivesearch9"); |
|
47 _LIT(KSqlContactPredSearchTable10,"predictivesearch10"); |
|
48 _LIT(KSqlContactPredSearchTable11,"predictivesearch11"); |
49 _LIT(KSqlContactPresenceTableName, "presence"); |
49 _LIT(KSqlContactPresenceTableName, "presence"); |
50 |
50 |
51 enum TDatabaseTables |
51 enum TDatabaseTables |
52 { |
52 { |
53 EContactPrefTableName, |
53 EContactPrefTableName, |
61 KContactPredSearchTable4Name, |
61 KContactPredSearchTable4Name, |
62 KContactPredSearchTable5Name, |
62 KContactPredSearchTable5Name, |
63 KContactPredSearchTable6Name, |
63 KContactPredSearchTable6Name, |
64 KContactPredSearchTable7Name, |
64 KContactPredSearchTable7Name, |
65 KContactPredSearchTable8Name, |
65 KContactPredSearchTable8Name, |
66 KContactPredSearchTable9Name |
66 KContactPredSearchTable9Name, |
|
67 KContactPredSearchTable10Name, |
|
68 KContactPredSearchTable11Name |
67 }; |
69 }; |
68 |
70 |
69 // columns for contact table |
71 // columns for contact table |
70 _LIT(KContactId, "contact_id"); |
72 _LIT(KContactId, "contact_id"); |
71 _LIT(KContactTemplateId, "template_id"); |
73 _LIT(KContactTemplateId, "template_id"); |
223 first_name CHAR(16) NULL, last_name CHAR(16) NULL);"); |
225 first_name CHAR(16) NULL, last_name CHAR(16) NULL);"); |
224 _LIT(KPredSearchCreateTable9Stmnt, |
226 _LIT(KPredSearchCreateTable9Stmnt, |
225 "CREATE TABLE predictivesearch9 (contact_id INTEGER PRIMARY KEY,\ |
227 "CREATE TABLE predictivesearch9 (contact_id INTEGER PRIMARY KEY,\ |
226 nbr BIGINT NULL, nbr2 BIGINT NULL, nbr3 BIGINT NULL, nbr4 BIGINT NULL,\ |
228 nbr BIGINT NULL, nbr2 BIGINT NULL, nbr3 BIGINT NULL, nbr4 BIGINT NULL,\ |
227 first_name CHAR(16) NULL, last_name CHAR(16) NULL);"); |
229 first_name CHAR(16) NULL, last_name CHAR(16) NULL);"); |
|
230 _LIT(KPredSearchCreateTable10Stmnt, |
|
231 "CREATE TABLE predictivesearch10 (contact_id INTEGER PRIMARY KEY,\ |
|
232 nbr BIGINT NULL, nbr2 BIGINT NULL, nbr3 BIGINT NULL, nbr4 BIGINT NULL,\ |
|
233 first_name CHAR(16) NULL, last_name CHAR(16) NULL);"); |
|
234 _LIT(KPredSearchCreateTable11Stmnt, |
|
235 "CREATE TABLE predictivesearch11 (contact_id INTEGER PRIMARY KEY,\ |
|
236 nbr BIGINT NULL, nbr2 BIGINT NULL, nbr3 BIGINT NULL, nbr4 BIGINT NULL,\ |
|
237 first_name CHAR(16) NULL, last_name CHAR(16) NULL);"); |
228 |
238 |
229 |
239 |
230 // create table indexes |
240 // create table indexes |
231 _LIT(KPredSearchCreateNbrIndexTable0, "CREATE INDEX index0_nbr on predictivesearch0 (nbr);"); |
241 _LIT(KPredSearchCreateNbrIndexTable0, "CREATE INDEX index0_nbr on predictivesearch0 (nbr);"); |
232 _LIT(KPredSearchCreateNbr2IndexTable0, "CREATE INDEX index0_nbr2 on predictivesearch0 (nbr2);"); |
242 _LIT(KPredSearchCreateNbr2IndexTable0, "CREATE INDEX index0_nbr2 on predictivesearch0 (nbr2);"); |
276 _LIT(KPredSearchCreateNbrIndexTable9, "CREATE INDEX index9_nbr on predictivesearch9 (nbr);"); |
286 _LIT(KPredSearchCreateNbrIndexTable9, "CREATE INDEX index9_nbr on predictivesearch9 (nbr);"); |
277 _LIT(KPredSearchCreateNbr2IndexTable9, "CREATE INDEX index9_nbr2 on predictivesearch9 (nbr2);"); |
287 _LIT(KPredSearchCreateNbr2IndexTable9, "CREATE INDEX index9_nbr2 on predictivesearch9 (nbr2);"); |
278 _LIT(KPredSearchCreateNbr3IndexTable9, "CREATE INDEX index9_nbr3 on predictivesearch9 (nbr3);"); |
288 _LIT(KPredSearchCreateNbr3IndexTable9, "CREATE INDEX index9_nbr3 on predictivesearch9 (nbr3);"); |
279 _LIT(KPredSearchCreateNbr4IndexTable9, "CREATE INDEX index9_nbr4 on predictivesearch9 (nbr4);"); |
289 _LIT(KPredSearchCreateNbr4IndexTable9, "CREATE INDEX index9_nbr4 on predictivesearch9 (nbr4);"); |
280 |
290 |
|
291 _LIT(KPredSearchCreateNbrIndexTable10, "CREATE INDEX index10_nbr on predictivesearch10 (nbr);"); |
|
292 _LIT(KPredSearchCreateNbr2IndexTable10, "CREATE INDEX index10_nbr2 on predictivesearch10 (nbr2);"); |
|
293 _LIT(KPredSearchCreateNbr3IndexTable10, "CREATE INDEX index10_nbr3 on predictivesearch10 (nbr3);"); |
|
294 _LIT(KPredSearchCreateNbr4IndexTable10, "CREATE INDEX index10_nbr4 on predictivesearch10 (nbr4);"); |
|
295 |
|
296 _LIT(KPredSearchCreateNbrIndexTable11, "CREATE INDEX index11_nbr on predictivesearch11 (nbr);"); |
|
297 _LIT(KPredSearchCreateNbr2IndexTable11, "CREATE INDEX index11_nbr2 on predictivesearch11 (nbr2);"); |
|
298 _LIT(KPredSearchCreateNbr3IndexTable11, "CREATE INDEX index11_nbr3 on predictivesearch11 (nbr3);"); |
|
299 _LIT(KPredSearchCreateNbr4IndexTable11, "CREATE INDEX index11_nbr4 on predictivesearch11 (nbr4);"); |
|
300 |
281 // create table indexes for readable names for ordering results alphabetically |
301 // create table indexes for readable names for ordering results alphabetically |
282 _LIT(KPredSearchCreateFNIndexInTable0, |
302 _LIT(KPredSearchCreateFNIndexInTable0, |
283 "CREATE INDEX index_last_name0 on predictivesearch0 (last_name);"); |
303 "CREATE INDEX index_last_name0 on predictivesearch0 (last_name);"); |
284 _LIT(KPredSearchCreateLNIndexInTable0, |
304 _LIT(KPredSearchCreateLNIndexInTable0, |
285 "CREATE INDEX index_first_name0 on predictivesearch0 (first_name);"); |
305 "CREATE INDEX index_first_name0 on predictivesearch0 (first_name);"); |
326 |
346 |
327 _LIT(KPredSearchCreateFNIndexInTable9, |
347 _LIT(KPredSearchCreateFNIndexInTable9, |
328 "CREATE INDEX index_last_name9 on predictivesearch9 (last_name);"); |
348 "CREATE INDEX index_last_name9 on predictivesearch9 (last_name);"); |
329 _LIT(KPredSearchCreateLNIndexInTable9, |
349 _LIT(KPredSearchCreateLNIndexInTable9, |
330 "CREATE INDEX index_first_name9 on predictivesearch9 (first_name);"); |
350 "CREATE INDEX index_first_name9 on predictivesearch9 (first_name);"); |
|
351 |
|
352 _LIT(KPredSearchCreateFNIndexInTable10, |
|
353 "CREATE INDEX index_last_name10 on predictivesearch10 (last_name);"); |
|
354 _LIT(KPredSearchCreateLNIndexInTable10, |
|
355 "CREATE INDEX index_first_name10 on predictivesearch10 (first_name);"); |
|
356 |
|
357 _LIT(KPredSearchCreateFNIndexInTable11, |
|
358 "CREATE INDEX index_last_name11 on predictivesearch11 (last_name);"); |
|
359 _LIT(KPredSearchCreateLNIndexInTable11, |
|
360 "CREATE INDEX index_first_name11 on predictivesearch11 (first_name);"); |
331 |
361 |
332 |
362 |
333 |
363 |
334 _LIT(KPresenceContactId, "contact_id"); |
364 _LIT(KPresenceContactId, "contact_id"); |
335 _LIT(KPresenceAccountUri, "account_uri"); |
365 _LIT(KPresenceAccountUri, "account_uri"); |