persistentstorage/sql/SRC/Server/SqlSrvStatement.inl
branchRCL_3
changeset 21 28839de615b4
parent 9 667e88a979d7
child 23 26645d81f48d
equal deleted inserted replaced
18:3da531bb4329 21:28839de615b4
    85 	{
    85 	{
    86 	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
    86 	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
    87 	__SQLASSERT(iBufType == HSqlSrvStmtParamBuf::EBufSimpleBind, ESqlPanicInternalError);
    87 	__SQLASSERT(iBufType == HSqlSrvStmtParamBuf::EBufSimpleBind, ESqlPanicInternalError);
    88 	iBuf->ResizeL(aData.Length());
    88 	iBuf->ResizeL(aData.Length());
    89 	iBuf->Write(0, aData);
    89 	iBuf->Write(0, aData);
    90 	return iBuf->Ptr(0);
    90 	//If the size is 0, then return KNullDesC8, where an empty string is hold, not a null one ("" instead of NULL)
       
    91 	return iBuf->Size() == 0 ? KNullDesC8() : iBuf->Ptr(0);
    91 	}
    92 	}
    92 
    93 
    93 /**
    94 /**
    94 Returns a 8-bit pointer to the parameter data.
    95 Returns a 8-bit pointer to the parameter data.
    95 
    96 
    98 @panic SqlDb 2 In _DEBUG mode. Invalid HSqlSrvStmtParamBuf object.
    99 @panic SqlDb 2 In _DEBUG mode. Invalid HSqlSrvStmtParamBuf object.
    99 */
   100 */
   100 inline const TPtrC8 HSqlSrvStmtParamBuf::Data() const
   101 inline const TPtrC8 HSqlSrvStmtParamBuf::Data() const
   101 	{
   102 	{
   102 	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
   103 	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
   103 	return iBuf->Ptr(0);
   104 	//If the size is 0, then return KNullDesC8, where an empty string is hold, not a null one ("" instead of NULL)
       
   105 	return iBuf->Size() == 0 ? KNullDesC8() : iBuf->Ptr(0);
   104 	}
   106 	}
   105 
   107 
   106 /**
   108 /**
   107 @return Buffered parameter value type - binary, text8 or text16.
   109 @return Buffered parameter value type - binary, text8 or text16.
   108 */
   110 */