persistentstorage/sql/SRC/Server/SqlSrvStatement.inl
changeset 46 826b40dcb0a8
parent 41 3256212fc81f
child 49 7521e5afd3df
equal deleted inserted replaced
41:3256212fc81f 46:826b40dcb0a8
    85 	{
    85 	{
    86 	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInvalidObj));
    86 	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInvalidObj));
    87 	__ASSERT_DEBUG(iBufType == HSqlSrvStmtParamBuf::EBufSimpleBind, __SQLPANIC(ESqlPanicInternalError));
    87 	__ASSERT_DEBUG(iBufType == HSqlSrvStmtParamBuf::EBufSimpleBind, __SQLPANIC(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 	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInvalidObj));
   103 	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(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 */