AccessPlatform and UCase / LCase

13 views
Skip to first unread message

jtuchel

unread,
Feb 7, 2012, 9:07:17 AM2/7/12
to glorp...@googlegroups.com
Hi again,

Glorp (at least in the Version shipped with VA Smalltalk) is agnostic of the fact that MS Access doesn't know the SQL functions UPPER and LOWER. It uses UCase and LCase instead.
I was hoping it is easy to fix by adding this to AccessPlatform, since the Platforms are the classes to encapsulate differences between DB systems.

But unfortunately, UPPER and LOWER are instances of FunctionExpression and defined independent of platforms. So I see no easy way to fix this by not tackling something onto GLORP.

So two questions:
* Do newer versions of GLORP handle such platform differences better?  
* Am I missing some easy way to add another definition of UPPER and LOWER for Access without breaking GLORP for other platforms?

Joachim

jtuchel

unread,
Feb 7, 2012, 9:20:45 AM2/7/12
to glorp...@googlegroups.com
Hi,

answering my own question, it is actually much easier than I thought. All I had to do was override AccessPlatform>>#initializeFunctions to read:

initializeFunctions
super initializeFunctions.
"Override UPER and LOWER with UCase and LCase"
(functions at: #asUppercase) function: 'UCase'.
(functions at: #asLowercase) function: 'LCase'.
and reconnect to the DB.

Alan Knight

unread,
Feb 7, 2012, 9:30:26 AM2/7/12
to glorp...@googlegroups.com
The version with VA is very old. The newer versions do have an AccessPlatform, although oddly it doesn't seem to have definitions for those functions.

There is also a mechanism to set up platform-specific functions, via the #initializeFunctions method. OraclePlatform and SQLServerPlatform both do some interesting things there to set up workarounds for things that aren't supported on those platforms.



jtuchel
7 February, 2012 9:07 AM

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/glorp-group/-/ppqpqvUVjH8J.
To post to this group, send email to glorp...@googlegroups.com.
To unsubscribe from this group, send email to glorp-group...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/glorp-group?hl=en.

jtuchel

unread,
Feb 7, 2012, 12:16:19 PM2/7/12
to glorp...@googlegroups.com, kni...@acm.org
Alan,

Am Dienstag, 7. Februar 2012 15:30:26 UTC+1 schrieb AlanKnight:
The version with VA is very old.

I know... I hardly dare to ask questions because of this ;-) I hope one day there'll be a current port. It is at least on their roadmap.

 
The newer versions do have an AccessPlatform, although oddly it doesn't seem to have definitions for those functions.

There is also a mechanism to set up platform-specific functions, via the #initializeFunctions method. OraclePlatform and SQLServerPlatform both do some interesting things there to set up workarounds for things that aren't supported on those platforms.


Yep, I found it just a few minutes after my post. I guess writing down the problem helped me search at the right place ;-)

Again, thanks for your prompt answer!
 

Reply all
Reply to author
Forward
0 new messages