Home   Archive   Permalink

how do you call a stored procedure in a ms sql server or oracle database?

has anybody ever used rebol to call a stored procedure in either a Ms Sql server database or from an oracle database?

posted by:   yuem       4-Jun-2010/23:20:47-7:00

I did in mssql using odbc, it that what you ask?
p: open odbc://mydsn
r: insert p "EXEC mysp('myvalue')"
probe r

posted by:   Endo       6-Jun-2010/10:55:50-7:00

Thanks Enzo, I will try it this way.

posted by:   yuem       7-Jun-2010/22:59:49-7:00

Oops, that example is incomplete!
Here is a working one.
R E B O L []
db-conn: open odbc://myodbcdsn
conn: first db-conn
exec: func [sql] [
     insert conn sql
     result: copy conn
     length? result
dump: does [
     forall result [
         print first result
exec "EXEC mysp('myvalue')"
>> 5 ;number of rows.
dump ;to see the result set
note that db connection port and command port are different ports.

posted by:   Endo       8-Jun-2010/4:19:34-7:00