|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Version : %version: 8 % << Don't touch! Updated by Synergy at check-out. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef C_CPSSQL_H |
|
21 #define C_CPSSQL_H |
|
22 |
|
23 //Insert Data |
|
24 //Update Data |
|
25 |
|
26 |
|
27 _LIT( KSQLUpdate, "UPDATE CP_MAIN_TABLE SET " ); |
|
28 _LIT( KSQLUpdateData, "Data = :Data " ); |
|
29 _LIT( KSQLUpdateAction, "Action = :Action " ); |
|
30 _LIT( KSQLUpdateExpirationDate, "Expiration_date = :Expiration_date " ); |
|
31 _LIT( KSQLUpdateFlag, "Flag = :Flag " ); |
|
32 _LIT( KSQLUpdateWhere, "WHERE Id = :Id " ); |
|
33 _LIT( KComma, ", " ); |
|
34 |
|
35 _LIT( KSQLUpdateRegistry, "UPDATE CP_PUBLISHER_TABLE SET " ); |
|
36 |
|
37 _LIT( KSQLInsert, |
|
38 "INSERT INTO CP_MAIN_TABLE (Publisher,Content_type,Content_id,Expiration_date,Access_List,Data,Action) VALUES ( \ |
|
39 :Publisher,\ |
|
40 :Content_type,\ |
|
41 :Content_id,\ |
|
42 :Expiration_date,\ |
|
43 :Access_List,\ |
|
44 :Data,\ |
|
45 :Action )" ); |
|
46 |
|
47 _LIT( KSQLInsertToRegistry, |
|
48 "INSERT INTO CP_PUBLISHER_TABLE (Publisher,Content_type,Content_id,Flag,Access_List,Data,Action) VALUES ( \ |
|
49 :Publisher,\ |
|
50 :Content_type,\ |
|
51 :Content_id,\ |
|
52 :Flag,\ |
|
53 :Access_List,\ |
|
54 :Data,\ |
|
55 :Action )" ); |
|
56 |
|
57 //Delete Data |
|
58 _LIT( KSQLDelete, "DELETE FROM CP_MAIN_TABLE" ); |
|
59 _LIT( KSQLDeleteFromRegistry, "DELETE FROM CP_PUBLISHER_TABLE" ); |
|
60 |
|
61 //Get Data |
|
62 _LIT( KSQLGetLastInsertId, "SELECT last_insert_rowid() "); |
|
63 |
|
64 _LIT( KSQLGetList, |
|
65 "SELECT Id,Publisher,Content_type,Content_id,Expiration_date,Access_List,Data,Action FROM CP_MAIN_TABLE"); |
|
66 _LIT( KSQLGetIds, |
|
67 "SELECT Id,Publisher,Content_type,Content_id,Access_List FROM CP_MAIN_TABLE"); |
|
68 _LIT( KSQLGetIdsRegistry, |
|
69 "SELECT Id,Publisher,Content_type,Content_id,Access_List,Flag FROM CP_PUBLISHER_TABLE" ); |
|
70 _LIT( KSQLGetAction, |
|
71 "SELECT Action FROM CP_MAIN_TABLE WHERE "); |
|
72 |
|
73 _LIT( KSQLGetListFromRegistry, |
|
74 "SELECT Id,Publisher,Content_type,Content_id,Access_List,Flag,Data,Action FROM CP_PUBLISHER_TABLE"); |
|
75 _LIT( KSQLGetIdsFromRegistry, |
|
76 "SELECT Id,Publisher,Content_type,Content_id FROM CP_PUBLISHER_TABLE"); |
|
77 _LIT( KSQLGetActionFromRegistry, |
|
78 "SELECT Id,Action FROM CP_PUBLISHER_TABLE WHERE "); |
|
79 |
|
80 _LIT( KSQLGetFlag ,"Flag <> 0"); |
|
81 _LIT( KSQLGetPublisher ,"Publisher = :Publisher"); |
|
82 _LIT( KSQLGetContentType ,"Content_type = :Content_type"); |
|
83 _LIT( KSQLGetContentId ,"Content_id = :Content_id"); |
|
84 _LIT( KSQLGetId ,"Id = :Id"); |
|
85 _LIT( KAnd," AND "); |
|
86 |
|
87 _LIT( KSQLFetchId, |
|
88 "SELECT Id FROM CP_MAIN_TABLE WHERE Publisher =:Publisher AND Content_type=:Content_type AND Content_id =:Content_id"); |
|
89 _LIT( KSQLFetchIds, |
|
90 "SELECT Publisher,Content_type,Content_id,Access_List FROM CP_MAIN_TABLE WHERE Id =:Id"); |
|
91 |
|
92 _LIT( KSQLFetchIdFromRegistry, |
|
93 "SELECT Id FROM CP_PUBLISHER_TABLE WHERE Publisher =:Publisher AND Content_type=:Content_type AND Content_id =:Content_id" ); |
|
94 _LIT( KSQLFetchIdsFromRegistry, |
|
95 "SELECT Publisher,Content_type,Content_id,Access_List FROM CP_PUBLISHER_TABLE WHERE Id =:Id" ); |
|
96 |
|
97 _LIT( KSQLPublisher, ":Publisher" ); |
|
98 _LIT( KSQLContent_type, ":Content_type" ); |
|
99 _LIT( KSQLContent_id, ":Content_id" ); |
|
100 _LIT( KSQLExpiration_date, ":Expiration_date" ); |
|
101 _LIT( KSQLFlag, ":Flag" ); |
|
102 _LIT( KSQLData, ":Data" ); |
|
103 _LIT( KSQLAction, ":Action" ); |
|
104 _LIT( KSQLAccessList, ":Access_List" ); |
|
105 _LIT( KSQLId, ":Id" ); |
|
106 |
|
107 _LIT( KSQLOrderRecent, " ORDER BY Id DESC" ); |
|
108 _LIT( KSQLOrderPublisher, " ORDER BY Publisher" ); |
|
109 _LIT( KSQLOrderContent, " ORDER BY Content_type" ); |
|
110 _LIT( KSQLOrderContentId, " ORDER BY Content_id" ); |
|
111 |
|
112 _LIT( KColumnId, "Id" ); |
|
113 _LIT( KColumnPublisher, "Publisher" ); |
|
114 _LIT( KColumnContent_type, "Content_type" ); |
|
115 _LIT( KColumnContent_id, "Content_id" ); |
|
116 _LIT( KColumnAccessList, "Access_List" ); |
|
117 _LIT( KColumnExpiration_date, "Expiration_date" ); |
|
118 _LIT( KColumnFlag, "Flag" ); |
|
119 _LIT( KColumnData, "Data" ); |
|
120 _LIT( KColumnAction, "Action" ); |
|
121 |
|
122 _LIT( KWhere, " WHERE "); |
|
123 |
|
124 _LIT8( KList, "List" ); |
|
125 |
|
126 #endif //C_CPSSQL_H |