This was not sent to the cafe since I used the wrong from address.

---------- Forwarded message ----------
From: Asten, W.G.G. van (Wilfried, Student M-CSC)
<[email protected]>
Date: Thu, Oct 18, 2012 at 12:27 PM
Subject: Re: [Haskell-cafe] hdbc parametrized select
To: [email protected]
Cc: [email protected]


To my knowledge you can combine execute and the fetch functions like this:

find conn id =
  do
    stmt <- prepare conn "SELECT * FROM table WHERE id = ? LIMIT 1"
    excute stmt [id]
    row <- fetchRow stmt

On Thu, Oct 18, 2012 at 10:51 AM,  <[email protected]> wrote:
> does hdbc have parametrized selects ?
> There is execute
> execute :: Statement -> [SqlValue] -> IO Integer
> and some other functions which get list of parameters but return IO Integer or
> IO ()
> and there is other couple of functions
> fetchRow :: Statement -> IO (Maybe [SqlValue])
> which return values of select but do not get parameters
>
> How can i execute parametrized select with hdbc ?
>
> _______________________________________________
> Haskell-Cafe mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to