equal
deleted
inserted
replaced
1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
13 // Description: |
13 // Description: |
14 // |
14 // |
15 |
15 |
16 #include <sqldb.h> //RSqlColumnReadStream, RSqlParamWriteStream |
16 #include <sqldb.h> //RSqlColumnReadStream, RSqlParamWriteStream |
17 #include "SqlStatementImpl.h" //CSqlStatementImpl |
17 #include "SqlStatementImpl.h" //CSqlStatementImpl |
18 #include "OstTraceDefinitions.h" |
|
19 #ifdef OST_TRACE_COMPILER_IN_USE |
|
20 #include "SqlStreamTraces.h" |
|
21 #endif |
|
22 #include "SqlTraceDef.h" |
|
23 |
18 |
24 //////////////////////////////////////////////////////////////////////////////////////////////////// |
19 //////////////////////////////////////////////////////////////////////////////////////////////////// |
25 ///////////////////// RSqlColumnReadStream //////////////////////////////////// |
20 ///////////////////// RSqlColumnReadStream //////////////////////////////////// |
26 //////////////////////////////////////////////////////////////////////////////////////////////////// |
21 //////////////////////////////////////////////////////////////////////////////////////////////////// |
27 |
22 |
41 |
36 |
42 @capability None |
37 @capability None |
43 */ |
38 */ |
44 EXPORT_C TInt RSqlColumnReadStream::ColumnText(RSqlStatement& aStmt, TInt aColumnIndex) |
39 EXPORT_C TInt RSqlColumnReadStream::ColumnText(RSqlStatement& aStmt, TInt aColumnIndex) |
45 { |
40 { |
46 SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNTEXT_ENTRY, "Entry;0x%X;RSqlColumnReadStream::ColumnText;aStmt=0x%X;aColumnIndex=%d", (TUint)this, (TUint)&aStmt, aColumnIndex)); |
41 SQLUTRACE_PROFILER(this); |
|
42 SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aColumnIndex)); |
|
43 |
47 TRAPD(err, Attach(aStmt.Impl().ColumnSourceL(aColumnIndex))); |
44 TRAPD(err, Attach(aStmt.Impl().ColumnSourceL(aColumnIndex))); |
48 SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNTEXT_EXIT, "Exit;0x%X;RSqlColumnReadStream::ColumnText;err=%d", (TUint)this, err)); |
|
49 return err; |
45 return err; |
50 } |
46 } |
51 |
47 |
52 /** |
48 /** |
53 Gives access to column data as a read-only stream of bytes. |
49 Gives access to column data as a read-only stream of bytes. |
65 |
61 |
66 @capability None |
62 @capability None |
67 */ |
63 */ |
68 EXPORT_C TInt RSqlColumnReadStream::ColumnBinary(RSqlStatement& aStmt, TInt aColumnIndex) |
64 EXPORT_C TInt RSqlColumnReadStream::ColumnBinary(RSqlStatement& aStmt, TInt aColumnIndex) |
69 { |
65 { |
70 SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNBINARY_ENTRY, "Entry;0x%X;RSqlColumnReadStream::ColumnBinary;aStmt=0x%X;aColumnIndex=%d", (TUint)this, (TUint)&aStmt, aColumnIndex)); |
66 SQLUTRACE_PROFILER(this); |
|
67 SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aColumnIndex)); |
|
68 |
71 TRAPD(err, Attach(aStmt.Impl().ColumnSourceL(aColumnIndex))); |
69 TRAPD(err, Attach(aStmt.Impl().ColumnSourceL(aColumnIndex))); |
72 SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNBINARY_EXIT, "Exit;0x%X;RSqlColumnReadStream::ColumnBinary;err=%d", (TUint)this, err)); |
|
73 return err; |
70 return err; |
74 } |
71 } |
75 |
72 |
76 /** |
73 /** |
77 Gives access to column data as a read-only stream of characters, |
74 Gives access to column data as a read-only stream of characters, |
88 |
85 |
89 @capability None |
86 @capability None |
90 */ |
87 */ |
91 EXPORT_C void RSqlColumnReadStream::ColumnTextL(RSqlStatement& aStmt, TInt aColumnIndex) |
88 EXPORT_C void RSqlColumnReadStream::ColumnTextL(RSqlStatement& aStmt, TInt aColumnIndex) |
92 { |
89 { |
93 SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNTEXTL_ENTRY, "Entry;0x%X;RSqlColumnReadStream::ColumnTextL;aStmt=0x%X;aColumnIndex=%d", (TUint)this, (TUint)&aStmt, aColumnIndex)); |
90 SQLUTRACE_PROFILER(this); |
|
91 SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aColumnIndex)); |
|
92 |
94 Attach(aStmt.Impl().ColumnSourceL(aColumnIndex)); |
93 Attach(aStmt.Impl().ColumnSourceL(aColumnIndex)); |
95 SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNTEXTL_EXIT, "Exit;0x%X;RSqlColumnReadStream::ColumnTextL", (TUint)this)); |
|
96 } |
94 } |
97 |
95 |
98 /** |
96 /** |
99 Gives access to column data as a read-only stream of bytes. |
97 Gives access to column data as a read-only stream of bytes. |
100 |
98 |
110 |
108 |
111 @capability None |
109 @capability None |
112 */ |
110 */ |
113 EXPORT_C void RSqlColumnReadStream::ColumnBinaryL(RSqlStatement& aStmt, TInt aColumnIndex) |
111 EXPORT_C void RSqlColumnReadStream::ColumnBinaryL(RSqlStatement& aStmt, TInt aColumnIndex) |
114 { |
112 { |
115 SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNBINARYL_ENTRY, "Entry;0x%X;RSqlColumnReadStream::ColumnBinaryL;aStmt=0x%X;aColumnIndex=%d", (TUint)this, (TUint)&aStmt, aColumnIndex)); |
113 SQLUTRACE_PROFILER(this); |
|
114 SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aColumnIndex)); |
|
115 |
116 Attach(aStmt.Impl().ColumnSourceL(aColumnIndex)); |
116 Attach(aStmt.Impl().ColumnSourceL(aColumnIndex)); |
117 SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNBINARYL_EXIT, "Exit;0x%X;RSqlColumnReadStream::ColumnBinaryL", (TUint)this)); |
|
118 } |
117 } |
119 |
118 |
120 //////////////////////////////////////////////////////////////////////////////////////////////////// |
119 //////////////////////////////////////////////////////////////////////////////////////////////////// |
121 ///////////////////// RSqlParamWriteStream //////////////////////////////////// |
120 ///////////////////// RSqlParamWriteStream //////////////////////////////////// |
122 //////////////////////////////////////////////////////////////////////////////////////////////////// |
121 //////////////////////////////////////////////////////////////////////////////////////////////////// |
140 |
139 |
141 @capability None |
140 @capability None |
142 */ |
141 */ |
143 EXPORT_C TInt RSqlParamWriteStream::BindText(RSqlStatement& aStmt, TInt aParameterIndex) |
142 EXPORT_C TInt RSqlParamWriteStream::BindText(RSqlStatement& aStmt, TInt aParameterIndex) |
144 { |
143 { |
145 SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDTEXT_ENTRY, "Entry;0x%X;RSqlParamWriteStream::BindText;aStmt=0x%X;aParameterIndex=%d", (TUint)this, (TUint)&aStmt, aParameterIndex)); |
144 SQLUTRACE_PROFILER(this); |
|
145 SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aParameterIndex)); |
|
146 |
146 TRAPD(err, Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtTxtParamSink16, aParameterIndex))); |
147 TRAPD(err, Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtTxtParamSink16, aParameterIndex))); |
147 SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDTEXT_EXIT, "Exit;0x%X;RSqlParamWriteStream::BindText;err=%d", (TUint)this, err)); |
|
148 return err; |
148 return err; |
149 } |
149 } |
150 |
150 |
151 /** |
151 /** |
152 Gives access to parameter data as a stream of bytes. |
152 Gives access to parameter data as a stream of bytes. |
167 |
167 |
168 @capability None |
168 @capability None |
169 */ |
169 */ |
170 EXPORT_C TInt RSqlParamWriteStream::BindBinary(RSqlStatement& aStmt, TInt aParameterIndex) |
170 EXPORT_C TInt RSqlParamWriteStream::BindBinary(RSqlStatement& aStmt, TInt aParameterIndex) |
171 { |
171 { |
172 SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDBINARY_ENTRY, "Entry;0x%X;RSqlParamWriteStream::BindBinary;aStmt=0x%X;aParameterIndex=%d", (TUint)this, (TUint)&aStmt, aParameterIndex)); |
172 SQLUTRACE_PROFILER(this); |
|
173 SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aParameterIndex)); |
|
174 |
173 TRAPD(err, Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtBinParamSink, aParameterIndex))); |
175 TRAPD(err, Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtBinParamSink, aParameterIndex))); |
174 SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDBINARY_EXIT, "Exit;0x%X;RSqlParamWriteStream::BindBinary;err=%d", (TUint)this, err)); |
|
175 return err; |
176 return err; |
176 } |
177 } |
177 |
178 |
178 /** |
179 /** |
179 Gives access to parameter data as a stream of characters. |
180 Gives access to parameter data as a stream of characters. |
193 |
194 |
194 @capability None |
195 @capability None |
195 */ |
196 */ |
196 EXPORT_C void RSqlParamWriteStream::BindTextL(RSqlStatement& aStmt, TInt aParameterIndex) |
197 EXPORT_C void RSqlParamWriteStream::BindTextL(RSqlStatement& aStmt, TInt aParameterIndex) |
197 { |
198 { |
198 SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDTEXTL_ENTRY, "Entry;0x%X;RSqlParamWriteStream::BindTextL;aStmt=0x%X;aParameterIndex=%d", (TUint)this, (TUint)&aStmt, aParameterIndex)); |
199 SQLUTRACE_PROFILER(this); |
|
200 SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aParameterIndex)); |
|
201 |
199 Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtTxtParamSink16, aParameterIndex)); |
202 Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtTxtParamSink16, aParameterIndex)); |
200 SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDTEXTL_EXIT, "Exit;0x%X;RSqlParamWriteStream::BindTextL", (TUint)this)); |
|
201 } |
203 } |
202 |
204 |
203 /** |
205 /** |
204 Gives access to parameter data as a stream of bytes. |
206 Gives access to parameter data as a stream of bytes. |
205 |
207 |
218 |
220 |
219 @capability None |
221 @capability None |
220 */ |
222 */ |
221 EXPORT_C void RSqlParamWriteStream::BindBinaryL(RSqlStatement& aStmt, TInt aParameterIndex) |
223 EXPORT_C void RSqlParamWriteStream::BindBinaryL(RSqlStatement& aStmt, TInt aParameterIndex) |
222 { |
224 { |
223 SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDBINARYL_ENTRY, "Entry;0x%X;RSqlParamWriteStream::BindBinaryL;aStmt=0x%X;aParameterIndex=%d", (TUint)this, (TUint)&aStmt, aParameterIndex)); |
225 SQLUTRACE_PROFILER(this); |
|
226 SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aParameterIndex)); |
|
227 |
224 Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtBinParamSink, aParameterIndex)); |
228 Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtBinParamSink, aParameterIndex)); |
225 SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDBINARYL_EXIT, "Exit;0x%X;RSqlParamWriteStream::BindBinaryL", (TUint)this)); |
229 } |
226 } |
230 |
227 |
|