persistentstorage/sql/SRC/Server/SqlSrvStatement.inl
changeset 40 b8bdbc8f59c7
parent 31 ba1c4f4a893f
child 49 7521e5afd3df
--- a/persistentstorage/sql/SRC/Server/SqlSrvStatement.inl	Thu Jul 08 12:09:58 2010 +0100
+++ b/persistentstorage/sql/SRC/Server/SqlSrvStatement.inl	Thu Aug 12 11:53:23 2010 +0100
@@ -87,7 +87,8 @@
 	__ASSERT_DEBUG(iBufType == HSqlSrvStmtParamBuf::EBufSimpleBind, __SQLPANIC(ESqlPanicInternalError));
 	iBuf->ResizeL(aData.Length());
 	iBuf->Write(0, aData);
-	return iBuf->Ptr(0);
+	//If the size is 0, then return KNullDesC8, where an empty string is hold, not a null one ("" instead of NULL)
+	return iBuf->Size() == 0 ? KNullDesC8() : iBuf->Ptr(0);
 	}
 
 /**
@@ -100,7 +101,8 @@
 inline const TPtrC8 HSqlSrvStmtParamBuf::Data() const
 	{
 	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInvalidObj));
-	return iBuf->Ptr(0);
+	//If the size is 0, then return KNullDesC8, where an empty string is hold, not a null one ("" instead of NULL)
+	return iBuf->Size() == 0 ? KNullDesC8() : iBuf->Ptr(0);
 	}
 
 /**