Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Store empty string to database
Re: Store empty string to database [message #37585 is a reply to message #37584] Sat, 20 October 2012 22:51 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1792
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Sat, 20 October 2012 18:17

Quote:


Is there some workaround to this? I can easily imagine cases where one needs to differentiate between NULL and "" in databases.


At this moment, no. In the past, we tried String::GetZero() as special value representing empty string in DB... Never got actually used and supported in Sql, so was removed. If we are about to restore something like this, I think it should go along this line (e.g. SqlEmptyString() and IsSqlEmptyString()).

Mirek

Mirek

Ok, for now I will use this:
SqlVal SqlEmptyString(){
	static SqlVal s("''",SqlS::HIGH);
	return s;
}
// which can be used as
sql * Insert(TBL)(SOMECOL, str.IsEmpty()?SqlEmptyString():str)
In the end, it is quite simple and not as ugly as I initially expected Smile

Honza
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: List DSN in ODBC
Next Topic: SQL_MySql reference example only compiles in debug mode
Goto Forum:
  


Current Time: Wed Aug 27 18:40:11 CEST 2025

Total time taken to generate the page: 0.06373 seconds