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  |
|
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 
Honza
|
|
|
Goto Forum:
Current Time: Wed Aug 27 18:40:11 CEST 2025
Total time taken to generate the page: 0.06373 seconds
|