U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ SQL » Possible SqlOption Problem [Solved]
Re: Possible SqlOption Problem [message #22839 is a reply to message #22814] Fri, 21 August 2009 14:27 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
marroyo wrote on Tue, 18 August 2009 14:25

PostgreSQL doesn't accept 0, 1 as boolean values.

Extract from PostgreSQL manual:

Valid literal values for the "true" state are:

TRUE
't'
'true'
'y'
'yes'
'1'

For the "false" state, the following values can be used:

FALSE
'f'
'false'
'n'
'no'
'0'

For now, I've to define a Convert for Option.

Thank you, Mirek.


Hm, now looking at THIS, maybe the correct solution would be to convert Postgre bool (in to "0" or "1" (now it is getting converted to numeric value). In that case, SqlOption would still be working and Insert would accept "0" "1" values just fine. What do you think?

Something like:

void PostgreSQLConnection::GetColumn(int i, Ref f) const
{
.....
		case BOOL_V:
			f.SetValue(*s == 't' ? true : false);
			break;


to

void PostgreSQLConnection::GetColumn(int i, Ref f) const
{
.....
		case BOOL_V:
			f.SetValue(*s == 't' ? "1" : "0");
			break;


[Updated on: Fri, 21 August 2009 14:27]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MSSQL binary data
Next Topic: [sql] Select embeded in join
Goto Forum:
  


Current Time: Tue Jul 21 20:05:30 GMT+2 2026

Total time taken to generate the page: 0.00530 seconds