Home » U++ Library support » U++ SQL » PostgreSQL fieldname case bug
PostgreSQL fieldname case bug [message #9689] |
Fri, 25 May 2007 00:16 |
zsolt
Messages: 697 Registered: December 2005 Location: Budapest, Hungary
|
Contributor |
|
|
The problem is that postgresql returns field names in lower case.
In the original version of PostgreSQL classes, there was a ToUpper() on field names, allowing using expressions like sql[FIELD_NAME].
In current version, ToUpper() disappeared, so I'm unable to get fields by name from a result set.
Put back the original version please.
in bool PostgreSQLConnection::Execute() currently it is:
f.name = PQfname(result, i);
but should be
f.name = ToUpper(PQfname(result, i));
|
|
|
|
Re: PostgreSQL fieldname case bug [message #9694 is a reply to message #9689] |
Fri, 25 May 2007 09:24 |
|
I'm sorry. I was experimenting with PostgreSql plugin and forgot to revert this change. It will be fixed.
PS:
As you can see in postgre plugin code I added GetInsertedId but I pass null in sequence variable:
Format("select currval('%s')", sequence);
As I discovered this is the only way to get the squence value. Unfortunatelly this way requires sequence name.
This leads me to 2 conclusions:
1. GetInsertedId() must be change to GetInsertedId(const char *sequence = NULL)
2. postgres sch interface should generate squences ids automaticaly if column's type is SERIAL (to be able to write SQL.GetInsertedID(T_ID_SEQ)) Now I would be force to do something like this:
TABLE(T)
INT (id) PRIMARY_KEY
SEQUENCE(id)
END_TABLE
instead of just
TABLE(T)
SERIAL (id) PRIMARY_KEY
END_TABLE
[Updated on: Fri, 25 May 2007 09:28] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 29 02:42:45 CEST 2024
Total time taken to generate the page: 0.02789 seconds
|