Hi,<br><br>I have set up a connection to the database using postgreSQL but I have a few questions while running the following queries:
<div> </div>
<div>> (send a-connection map a-statement <strong><u>proc</u></strong>)<br> map : Statement (field ... -> 'a) -> (list-of 'a)<br><br> Executes a SQL query and applies the given function to the contents<br>
of each row, returning a list of results.<br><br>> (send a-connection for-each a-statement <strong><u>proc</u>)</strong><br> for-each : Statement (field ... -> void) -> void<br><br> Executes a SQL query and applies the given function to the contents<br>
of each row, discarding the results.<br><br>> (send a-connection mapfilter a-statement <strong><u>map-proc</u></strong> <strong><u>filter-proc</u></strong>)<br> mapfilter : Statement (field ... -> 'a) (field ... -> boolean) -> (list-of 'a)<br>
<br> Like 'map', but applies the map procedure (given first) to only<br> those rows which satisfy the given predicate (given second).<br><br>> (send a-connection fold a-statement <strong><u>proc</u></strong> init)<br>
fold : Statement ('a field ... -> 'a) 'a -> 'a<br><br>What should be the structure of the proc...? Can you send me one entire example which explains the use of "<strong><u>proc</u></strong>" as well as "map-proc" and "filter-proc" and their structure or the body of these functions....?</div>
<div> </div>
<div>Any help would be much appreciated.</div><br>-- <br>Rohan.B.Golwala<br>