[Haskell-cafe] Re: Oracle + Haskell advice?

Bayley, Alistair Alistair_Bayley at ldn.invesco.com
Fri Aug 19 07:13:41 EDT 2005


> From: Brian Strand [mailto:bstrand at switchmanagement.com] 
> 
> So far Takusen is working great (once I figured out the 
> proper incantations 
> for getting "select * from dual" working, things went much 
> faster...).  We 
> don't currently use LOBs, and very rarely call stored 
> procedures, so there's a 
> happy match between Takusen's missing features and our unused 
> features ;)  One 
> thing we do use extensively is bind parameters; do you have 
> any hints on 
> getting doQueryBind working, or pointers on what's left to do 
> there?  And is 
> the version in CVS on sf.net a good place to start?

Hmm... I assume that you're using the experimental version from CVS, as
you've mentioned doQueryBind, which is not in the Main branch. What problems
are you having with bind parameters?

Have you seen the tests in Database.Test.Enumerator? Specifically, the
selectBindInt and selectBindDate functions demonstrate simple usage of bind
parameters.

There are a couple of implementation notes which might affect you:

 - I think you have to specify the type of the bind parameter list (i.e.
help the type-checker)

 - user modules (like Database.Test.Enumerator) probably need to specify
these pragmas:
     {-# OPTIONS -fglasgow-exts #-}
     {-# OPTIONS -fallow-overlapping-instances #-}

 - bind parameters are specified with ?'s, and we convert those to the
Oracle :x syntax. I think you should be able to use the :x syntax too
though; I believe it will be passed through unmolested.

Reviewing at the bind variable code has highlighted a glaring design flaw:
you can only pass homogenous lists of bind values! We originally had a
design where you passed a list of bind actions (a monadic action which
returned ()). I think that in my zeal to reduce programmer effort I have
reduced this to a list of values (to which we apply the bind action in the
library). Maybe that's what's biting you... I'd better get onto that
sharpish.

Alistair.

-----------------------------------------
*****************************************************************
Confidentiality Note: The information contained in this   message, and any
attachments, may contain confidential   and/or privileged material. It is
intended solely for the   person(s) or entity to which it is addressed. Any
review,   retransmission, dissemination, or taking of any action in
reliance upon this information by persons or entities other   than the
intended recipient(s) is prohibited. If you received  this in error, please
contact the sender and delete the   material from any computer.
*****************************************************************



More information about the Haskell-Cafe mailing list