persistentstorage/sql/SRC/Client/SqlScalarFullSelect.cpp
branchRCL_3
changeset 24 cc28652e0254
parent 23 26645d81f48d
equal deleted inserted replaced
23:26645d81f48d 24:cc28652e0254
     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".
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
    16 #include "SqlAssert.h"			//ESqlPanicInvalidObj, ESqlPanicObjExists
    16 #include "SqlPanic.h"			//ESqlPanicInvalidObj, ESqlPanicObjExists
    17 #include "SqlDatabaseImpl.h"	//CSqlDatabaseImpl
    17 #include "SqlDatabaseImpl.h"	//CSqlDatabaseImpl
    18 #include "OstTraceDefinitions.h"
       
    19 #ifdef OST_TRACE_COMPILER_IN_USE
       
    20 #include "SqlScalarFullSelectTraces.h"
       
    21 #endif
       
    22 #include "SqlTraceDef.h"
       
    23 
    18 
    24 /**
    19 /**
    25 Returns a reference to the implementation object of RSqlDatabase - CSqlDatabaseImpl.
    20 Returns a reference to the implementation object of RSqlDatabase - CSqlDatabaseImpl.
    26 
    21 
    27 @panic SqlDb 2 Create() or Open() has not previously been called on this RSqlDatabase object.
    22 @panic SqlDb 2 Create() or Open() has not previously been called on this RSqlDatabase object.
    28 
    23 
    29 @internalComponent
    24 @internalComponent
    30 */
    25 */
    31 inline CSqlDatabaseImpl& TSqlScalarFullSelectQuery::Impl() const
    26 inline CSqlDatabaseImpl& TSqlScalarFullSelectQuery::Impl() const
    32 	{
    27 	{
    33 	__ASSERT_ALWAYS(iDatabaseImpl != NULL, __SQLPANIC(ESqlPanicInvalidObj));
    28 	__SQLASSERT_ALWAYS(iDatabaseImpl != NULL, ESqlPanicInvalidObj);
    34 	return *iDatabaseImpl;	
    29 	return *iDatabaseImpl;	
    35 	}
    30 	}
    36 
    31 
    37 /**
    32 /**
    38 Initializes TSqlScalarFullSelectQuery data members with default values.
    33 Initializes TSqlScalarFullSelectQuery data members with default values.
    49                     the database on which scalar fullselect queries will be executed.
    44                     the database on which scalar fullselect queries will be executed.
    50 */
    45 */
    51 EXPORT_C TSqlScalarFullSelectQuery::TSqlScalarFullSelectQuery(RSqlDatabase& aDatabase) :
    46 EXPORT_C TSqlScalarFullSelectQuery::TSqlScalarFullSelectQuery(RSqlDatabase& aDatabase) :
    52 	iDatabaseImpl(&aDatabase.Impl())
    47 	iDatabaseImpl(&aDatabase.Impl())
    53 	{
    48 	{
    54 	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_TSQLSCALARFULLSELECTQUERY, "0x%X;TSqlScalarFullSelectQuery::TSqlScalarFullSelectQuery;aDatabase=0x%X;iDatabaseImpl=0x%X", (TUint)this, (TUint)&aDatabase, (TUint)iDatabaseImpl));
       
    55 	}
    49 	}
    56 	
    50 	
    57 /**
    51 /**
    58 Initializes/reinitializes TSqlScalarFullSelectQuery object.
    52 Initializes/reinitializes TSqlScalarFullSelectQuery object.
    59 
    53 
    60 @param aDatabase	A reference to the RSqlDatabase object that represents 
    54 @param aDatabase	A reference to the RSqlDatabase object that represents 
    61                     the database on which scalar fullselect queries will be executed.
    55                     the database on which scalar fullselect queries will be executed.
    62 */
    56 */
    63 EXPORT_C void TSqlScalarFullSelectQuery::SetDatabase(RSqlDatabase& aDatabase)
    57 EXPORT_C void TSqlScalarFullSelectQuery::SetDatabase(RSqlDatabase& aDatabase)
    64 	{
    58 	{
       
    59 	SQLUTRACE_PROFILER(this);
    65 	iDatabaseImpl = &aDatabase.Impl();
    60 	iDatabaseImpl = &aDatabase.Impl();
    66     SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SETDATABASE, "0x%X;TSqlScalarFullSelectQuery::SetDatabase;aDatabase=0x%X;iDatabaseImpl=0x%X", (TUint)this, (TUint)&aDatabase, (TUint)iDatabaseImpl));
       
    67 	}
    61 	}
    68 	
    62 	
    69 /**
    63 /**
    70 Executes a SELECT query which is expected to return a single row consisting of
    64 Executes a SELECT query which is expected to return a single row consisting of
    71 a single 32-bit integer value and returns that value.
    65 a single 32-bit integer value and returns that value.
    78         The function may leave with database specific errors categorised as ESqlDbError and
    72         The function may leave with database specific errors categorised as ESqlDbError and
    79   		other system-wide error codes.
    73   		other system-wide error codes.
    80 */
    74 */
    81 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectIntL(const TDesC& aSqlStmt)
    75 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectIntL(const TDesC& aSqlStmt)
    82 	{
    76 	{
    83     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINTL_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectIntL-16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
    77 	SQLUTRACE_PROFILER(this);
       
    78 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
       
    79 
    84 	TInt res;
    80 	TInt res;
    85 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
    81 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
    86 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt, ptr);
    82 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt, ptr);
    87     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINTL_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectIntL-16;res=%d", (TUint)this, res));
       
    88 	return res;
    83 	return res;
    89 	}
    84 	}
    90 	
    85 	
    91 /**
    86 /**
    92 Executes a SELECT query which is expected to return a single row consisting of
    87 Executes a SELECT query which is expected to return a single row consisting of
   100         The function may leave with database specific errors categorised as ESqlDbError and
    95         The function may leave with database specific errors categorised as ESqlDbError and
   101   		other system-wide error codes.
    96   		other system-wide error codes.
   102 */
    97 */
   103 EXPORT_C TInt64 TSqlScalarFullSelectQuery::SelectInt64L(const TDesC& aSqlStmt)
    98 EXPORT_C TInt64 TSqlScalarFullSelectQuery::SelectInt64L(const TDesC& aSqlStmt)
   104 	{
    99 	{
   105     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINT64L_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectInt64L-16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
   100 	SQLUTRACE_PROFILER(this);
       
   101 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
       
   102 
   106 	TInt64 res;
   103 	TInt64 res;
   107 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   104 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   108 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt64, ptr);
   105 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt64, ptr);
   109 	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINT64L_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectInt64L-16;res=%lld", (TUint)this, res));
       
   110 	return res;
   106 	return res;
   111 	}
   107 	}
   112 	
   108 	
   113 /**
   109 /**
   114 Executes a SELECT query which is expected to return a single row consisting of
   110 Executes a SELECT query which is expected to return a single row consisting of
   122         The function may leave with database specific errors categorised as ESqlDbError and
   118         The function may leave with database specific errors categorised as ESqlDbError and
   123   		other system-wide error codes.
   119   		other system-wide error codes.
   124 */
   120 */
   125 EXPORT_C TReal TSqlScalarFullSelectQuery::SelectRealL(const TDesC& aSqlStmt)
   121 EXPORT_C TReal TSqlScalarFullSelectQuery::SelectRealL(const TDesC& aSqlStmt)
   126 	{
   122 	{
   127     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTREALL_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectRealL-16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
   123 	SQLUTRACE_PROFILER(this);
       
   124 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
       
   125 
   128 	TReal res;
   126 	TReal res;
   129 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   127 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   130 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlReal, ptr);
   128 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlReal, ptr);
   131     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTREALL_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectRealL-16", (TUint)this));
       
   132 	return res;
   129 	return res;
   133 	}
   130 	}
   134 	
   131 	
   135 /**
   132 /**
   136 Executes a SELECT query which is expected to return a single row consisting of
   133 Executes a SELECT query which is expected to return a single row consisting of
   150         The function may leave with database specific errors categorised as ESqlDbError and
   147         The function may leave with database specific errors categorised as ESqlDbError and
   151   		other system-wide error codes.
   148   		other system-wide error codes.
   152 */
   149 */
   153 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectTextL(const TDesC& aSqlStmt, TDes& aDest)
   150 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectTextL(const TDesC& aSqlStmt, TDes& aDest)
   154 	{
   151 	{
   155     SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectTextL-16;aSqlStmt=%S;aDest.Ptr()=0x%X;aDest.Size()=%d;aDest.MaxSize()=%d", (TUint)this, __SQLPRNSTR(aSqlStmt), (TUint)aDest.Ptr(), aDest.Size(), aDest.MaxSize()));
   152 	SQLUTRACE_PROFILER(this);
       
   153 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
       
   154 	
   156 	TPtr8 ptr(reinterpret_cast <TUint8*> (const_cast <TUint16*> (aDest.Ptr())), aDest.MaxLength() * sizeof(TUint16));
   155 	TPtr8 ptr(reinterpret_cast <TUint8*> (const_cast <TUint16*> (aDest.Ptr())), aDest.MaxLength() * sizeof(TUint16));
   157 	TInt rc = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlText, ptr);
   156 	TInt err = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlText, ptr);
   158 	aDest.SetLength(ptr.Length() / sizeof(TUint16));
   157 	aDest.SetLength(ptr.Length() / sizeof(TUint16));
   159     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectTextL-16;rc=%d", (TUint)this, rc));
   158 	return err;
   160 	return rc;
       
   161 	}
   159 	}
   162 	
   160 	
   163 /**
   161 /**
   164 Executes a SELECT query which is expected to return a single row consisting of
   162 Executes a SELECT query which is expected to return a single row consisting of
   165 a single binary value and copies that value to the place refered by aDest parameter.
   163 a single binary value and copies that value to the place refered by aDest parameter.
   178         The function may leave with database specific errors categorised as ESqlDbError and
   176         The function may leave with database specific errors categorised as ESqlDbError and
   179   		other system-wide error codes.
   177   		other system-wide error codes.
   180 */
   178 */
   181 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectBinaryL(const TDesC& aSqlStmt, TDes8& aDest)
   179 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectBinaryL(const TDesC& aSqlStmt, TDes8& aDest)
   182 	{
   180 	{
   183     SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectBinaryL-16;aSqlStmt=%S;aDest.Ptr()=0x%X;aDest.Size()=%d;aDest.MaxSize()=%d", (TUint)this, __SQLPRNSTR(aSqlStmt), (TUint)aDest.Ptr(), aDest.Size(), aDest.MaxSize()));
   181 	SQLUTRACE_PROFILER(this);
   184 	TInt rc = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlBinary, aDest);
   182 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
   185     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectBinaryL-16;rc=%d", (TUint)this, rc));
   183 	
   186 	return rc;
   184 	return Impl().ExecScalarFullSelectL(aSqlStmt, ESqlBinary, aDest);
   187 	}
   185 	}
   188 	
   186 	
   189 /**
   187 /**
   190 Executes a SELECT query which is expected to return a single row consisting of
   188 Executes a SELECT query which is expected to return a single row consisting of
   191 a single 32-bit integer value and returns that value.
   189 a single 32-bit integer value and returns that value.
   198         The function may leave with database specific errors categorised as ESqlDbError and
   196         The function may leave with database specific errors categorised as ESqlDbError and
   199   		other system-wide error codes.
   197   		other system-wide error codes.
   200 */
   198 */
   201 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectIntL(const TDesC8& aSqlStmt)
   199 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectIntL(const TDesC8& aSqlStmt)
   202 	{
   200 	{
   203 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   201 	SQLUTRACE_PROFILER(this);	
   204     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINTL_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectIntL-8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
   202 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
       
   203 
   205 	TInt res;
   204 	TInt res;
   206 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   205 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   207 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt, ptr);
   206 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt, ptr);
   208     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINTL_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectIntL-8;res=%d", (TUint)this, res));
       
   209 	return res;
   207 	return res;
   210 	}
   208 	}
   211 	
   209 	
   212 /**
   210 /**
   213 Executes a SELECT query which is expected to return a single row consisting of
   211 Executes a SELECT query which is expected to return a single row consisting of
   221         The function may leave with database specific errors categorised as ESqlDbError and
   219         The function may leave with database specific errors categorised as ESqlDbError and
   222   		other system-wide error codes.
   220   		other system-wide error codes.
   223 */
   221 */
   224 EXPORT_C TInt64 TSqlScalarFullSelectQuery::SelectInt64L(const TDesC8& aSqlStmt)
   222 EXPORT_C TInt64 TSqlScalarFullSelectQuery::SelectInt64L(const TDesC8& aSqlStmt)
   225 	{
   223 	{
   226 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   224 	SQLUTRACE_PROFILER(this);
   227 	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINT64L_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectInt64L-8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
   225 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
       
   226 
   228 	TInt64 res;
   227 	TInt64 res;
   229 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   228 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   230 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt64, ptr);
   229 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt64, ptr);
   231 	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINT64L_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectInt64L-8;res=%lld", (TUint)this, res));
       
   232 	return res;
   230 	return res;
   233 	}
   231 	}
   234 	
   232 	
   235 /**
   233 /**
   236 Executes a SELECT query which is expected to return a single row consisting of
   234 Executes a SELECT query which is expected to return a single row consisting of
   244         The function may leave with database specific errors categorised as ESqlDbError and
   242         The function may leave with database specific errors categorised as ESqlDbError and
   245   		other system-wide error codes.
   243   		other system-wide error codes.
   246 */
   244 */
   247 EXPORT_C TReal TSqlScalarFullSelectQuery::SelectRealL(const TDesC8& aSqlStmt)
   245 EXPORT_C TReal TSqlScalarFullSelectQuery::SelectRealL(const TDesC8& aSqlStmt)
   248 	{
   246 	{
   249 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   247 	SQLUTRACE_PROFILER(this);
   250     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTREALL_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectRealL-8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
   248 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
       
   249 	
   251 	TReal res;
   250 	TReal res;
   252 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   251 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
   253 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlReal, ptr);
   252 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlReal, ptr);
   254     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTREALL_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectRealL-8", (TUint)this));
       
   255 	return res;
   253 	return res;
   256 	}
   254 	}
   257 	
   255 	
   258 /**
   256 /**
   259 Executes a SELECT query which is expected to return a single row consisting of
   257 Executes a SELECT query which is expected to return a single row consisting of
   273         The function may leave with database specific errors categorised as ESqlDbError and
   271         The function may leave with database specific errors categorised as ESqlDbError and
   274   		other system-wide error codes.
   272   		other system-wide error codes.
   275 */
   273 */
   276 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectTextL(const TDesC8& aSqlStmt, TDes& aDest)
   274 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectTextL(const TDesC8& aSqlStmt, TDes& aDest)
   277 	{
   275 	{
   278 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   276 	SQLUTRACE_PROFILER(this);
   279     SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectTextL-8;aSqlStmt=%s;aDest.Ptr()=0x%X;aDest.Size()=%d;aDest.MaxSize()=%d", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf), (TUint)aDest.Ptr(), aDest.Size(), aDest.MaxSize()));
   277 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
       
   278 
   280 	TPtr8 ptr(reinterpret_cast <TUint8*> (const_cast <TUint16*> (aDest.Ptr())), aDest.MaxLength() * sizeof(TUint16));
   279 	TPtr8 ptr(reinterpret_cast <TUint8*> (const_cast <TUint16*> (aDest.Ptr())), aDest.MaxLength() * sizeof(TUint16));
   281 	TInt rc = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlText, ptr);
   280 	TInt err = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlText, ptr);
   282 	aDest.SetLength(ptr.Length() / sizeof(TUint16));
   281 	aDest.SetLength(ptr.Length() / sizeof(TUint16));
   283     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectTextL-8;rc=%d", (TUint)this, rc));
   282 	return err;
   284 	return rc;
       
   285 	}
   283 	}
   286 	
   284 	
   287 /**
   285 /**
   288 Executes a SELECT query which is expected to return a single row consisting of
   286 Executes a SELECT query which is expected to return a single row consisting of
   289 a single binary value and copies that value to the place refered by aDest parameter.
   287 a single binary value and copies that value to the place refered by aDest parameter.
   302         The function may leave with database specific errors categorised as ESqlDbError and
   300         The function may leave with database specific errors categorised as ESqlDbError and
   303   		other system-wide error codes.
   301   		other system-wide error codes.
   304 */
   302 */
   305 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectBinaryL(const TDesC8& aSqlStmt, TDes8& aDest)
   303 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectBinaryL(const TDesC8& aSqlStmt, TDes8& aDest)
   306 	{
   304 	{
   307 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   305 	SQLUTRACE_PROFILER(this);
   308     SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectBinaryL-8;aSqlStmt=%s;aDest.Ptr()=0x%X;aDest.Size()=%d;aDest.MaxSize()=%d", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf), (TUint)aDest.Ptr(), aDest.Size(), aDest.MaxSize()));
   306 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
   309 	TInt rc = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlBinary, aDest);
   307 	
   310     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectBinaryL-8;rc=%d", (TUint)this, rc));
   308 	return Impl().ExecScalarFullSelectL(aSqlStmt, ESqlBinary, aDest);
   311 	return rc;
   309 	}
   312 	}