Changeset 8191 in project for release/3/mysql/trunk/mysql-eggdoc.scm
- Timestamp:
- 02/06/08 07:22:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
release/3/mysql/trunk/mysql-eggdoc.scm
r7944 r8191 31 31 (use mysql) 32 32 33 (let [(db (mysql-connect host: "mysql.example.com" user: "example" 34 passwd: "secret"))] 33 (let ((db (mysql-connect host: "mysql.example.com" user: "example" passwd: "secret"))) 35 34 (mysql-query db "SHOW DATABASES") 36 (do [(row (mysql-fetch-row db) (mysql-fetch-row db))]37 [(not row)]38 ( display (conc "Row " idx ": " (row "Database") "\n")))39 (mysql-close db) )35 (do ((row (mysql-fetch-row db) (mysql-fetch-row db))) 36 ((not row)) 37 (print "Row " idx ": " (row "Database")) ) 38 (mysql-close db) ) 40 39 END 41 40 ) … … 44 43 (use mysql) 45 44 46 (let [(db (mysql-connect host: "mysql.example.com" user: "example" 47 passwd: "secret"))] 48 (mysql-query-foreach db "SHOW DATABASES" 49 (lambda (row idx) 50 (display (conc "Row " idx ": " (row "Database") "\n")))) 51 (mysql-close db)) 45 (let ((db (mysql-connect host: "mysql.example.com" user: "example" passwd: "secret"))) 46 (mysql-query-for-each 47 db "SHOW DATABASES" (lambda (row idx) (print "Row " idx ": " (row "Database")))) 48 (mysql-close db) ) 52 49 END 53 50 ) … … 200 197 "most recent call to " (tt "mysql-query") ". If the " 201 198 "last query failed, or if there are no more rows left " 202 "in the result set, returns " ( tt"#f") "; otherwise "199 "in the result set, returns " (code "#f") "; otherwise " 203 200 "returns a row object.") 204 201 (a (@ (" name='rowobj'"))) … … 207 204 "takes a single argument. If the argument is a number, " 208 205 "the function returns the value of the field for which " 209 "that number is the index, or " ( tt"#f") " if the "206 "that number is the index, or " (code "#f") " if the " 210 207 "index is out of range. Otherwise, the argument must " 211 208 "be a symbol or string, in which case the function returns " 212 209 "the value of the field for which that string (or symbol " 213 210 "converted into a string) is the field/column name. If " 214 "no such field exists, returns " ( tt"#f") ".") )211 "no such field exists, returns " (code "#f") ".") ) 215 212 216 213 (procedure "(mysql-field-count CONN)" … … 233 230 (p 234 231 "Returns the number of rows in the current result set. " 235 "If no result set exists, returns " ( tt"#f") ".") )232 "If no result set exists, returns " (code "#f") ".") ) 236 233 237 234 (procedure "(mysql-num-fields CONN)" 238 235 (p 239 236 "Returns the number of fields in the current result set. " 240 "If no result set exists, returns " ( tt"#f") ".") )237 "If no result set exists, returns " (code "#f") ".") ) 241 238 242 239 (procedure "(mysql-affected-rows CONN)" … … 833 830 "All MySQL result data (except NULL) are returned as Scheme strings.") 834 831 (p 835 "The NULL value is represented by " (tt "#f") ".") 836 (p "Booleans are expressed " 837 "as the Scheme strings " (tt "\"1\"") " and " (tt "\"0\"") ".") 838 (p "All remaining " 839 "types, including numeric types, blobs, and strings are returned as Scheme " 840 "strings.") 832 "The NULL value is represented by " (code "#f") ".") 833 (p 834 "Booleans are expressed as the Scheme strings " (code "\"1\"") " and " 835 (code "\"0\"") ".") 836 (p 837 "All remaining types, including numeric types, blobs, and strings are " 838 "returned as Scheme strings.") 841 839 ) ; section "Data Type Conversion" 842 840
Note: See TracChangeset
for help on using the changeset viewer.