persistentstorage/sql/SRC/Server/SqlSrvStatement.inl
branchRCL_3
changeset 56 839ea9debada
parent 45 cc28652e0254
equal deleted inserted replaced
50:8dc8494f1e0e 56:839ea9debada
    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 	//If the size is 0, then return KNullDesC8, where an empty string is hold, not a null one ("" instead of NULL)
    90 	return iBuf->Ptr(0);
    91 	return iBuf->Size() == 0 ? KNullDesC8() : iBuf->Ptr(0);
       
    92 	}
    91 	}
    93 
    92 
    94 /**
    93 /**
    95 Returns a 8-bit pointer to the parameter data.
    94 Returns a 8-bit pointer to the parameter data.
    96 
    95 
    99 @panic SqlDb 2 In _DEBUG mode. Invalid HSqlSrvStmtParamBuf object.
    98 @panic SqlDb 2 In _DEBUG mode. Invalid HSqlSrvStmtParamBuf object.
   100 */
    99 */
   101 inline const TPtrC8 HSqlSrvStmtParamBuf::Data() const
   100 inline const TPtrC8 HSqlSrvStmtParamBuf::Data() const
   102 	{
   101 	{
   103 	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
   102 	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
   104 	//If the size is 0, then return KNullDesC8, where an empty string is hold, not a null one ("" instead of NULL)
   103 	return iBuf->Ptr(0);
   105 	return iBuf->Size() == 0 ? KNullDesC8() : iBuf->Ptr(0);
       
   106 	}
   104 	}
   107 
   105 
   108 /**
   106 /**
   109 @return Buffered parameter value type - binary, text8 or text16.
   107 @return Buffered parameter value type - binary, text8 or text16.
   110 */
   108 */