[REBOL] SQLite - pointer to function question
From: rebol-list2::seznam::cz at: 29-Feb-2004 20:55
Hello rebol-list,
I've been playing a bit with SQLite.dll ( http://sqlite.org ) and
even I'm not expert in this filed at all, I manage to open db and
execute SQL commands using this DLL. But the problem is that if you
want to use SELECT command you must send pointer to a callback
function which should be evaluated for each result row.
Is there any change to get a pointer to a Rebol function?
Here are are my SQLite routine(s)!
==================================
rebol []
sqlite: load/library %/j/sqlite.dll
sqlite_open: make routine! [
zFilename [string! ]
mode [integer!]
pzErr [string! ]
return: [integer!]
] sqlite "sqlite_open"
sqlite_close: make routine! [db [integer!]] sqlite "sqlite_close"
sqlite_exec: make routine! [
db [integer!] "pointer to open database"
sql [string! ] "SQL to be executed"
callback [integer!] "pointer to Callback function"
cb_arg [integer!] "1st argument to callback function"
errmsg [string! ] "Error msg written here"
return: [integer!]
] sqlite "sqlite_exec"
sqlite_version: make routine! [
return: [string!]
] sqlite "sqlite_libversion"
sqlite_error_string: make routine! [
int [integer!]
return: [string! ]
] sqlite "sqlite_error_string"
err: copy ""
db: sqlite_open "test" 0 err
sqlite_exec db "create table t (f text);" 0 0 err
sqlite_exec db "insert into t values('test');" 0 0 err
--
Best regards,
rebOldes -----------------[ http://oldes.multimedia.cz/ ]