[plt-scheme] issue querying a bit

From: Daniel Roy (droy at MIT.EDU)
Date: Thu Oct 2 20:26:11 EDT 2003

i googled the archives and i didn't find any relevant topics, so here is
my question. i'm running on winxp (i know i know), MS SQL 8. i'm running
the code from dr.scheme. the table i'm querying has several columns, some
are strings, longs, and bits. querying any combination of strings and
longs work just fine (with the code provided below). however, if i change
the query command as it is below (ask for a column representing a bit) it
fails with the following error message:

Welcome to DrScheme, version 204.
Language: Pretty Big (includes MrEd and Advanced).
Teachpack: C:\Program Files\plt\teachpack\htdp\draw.ss.
#<sql-hdbc>
SELECT sex
   FROM users
. car: expects argument of type <pair>; given "1\0"
>

here is the code...

(require (lib "schemeql.ss" "schemeql"))

(let ((connection (connect-to-database "database" "user" "pass")))
  (let ((select-struct (query (SEX) "users")))
    (let ((result (schemeql-execute select-struct)))
      (let loop ((cursor (result-cursor result)))
        (if (not (cursor-null? cursor))
            (let ((felm (cursor-car cursor)))
              (printf "~a~n" felm)
              (loop (cursor-cdr cursor)))))))

  (disconnect-from-database connection))



thanks! dan



Posted on the users mailing list.