In February, Jean Czerlinski posted some difficulties with using ODBC
connections from
S-Plus. I too have had crippling difficulty doing this. If any one else
has had experiences of using ODBC to a SQL server I'd be glad to hear
from them. I'm using S-Plus 2000 on Windows 2000, trying to connect to a
Microsoft SQL Server 2000.
My experience is
1) Importing simple queries into S-plus via ODBC queries to a SQL
server works fine
1a) ...except when columns are Unicode variables (nchar and
nvarchar)
2) Exporting ODBC to the SQL server through the GUI or command
line does not work at all. A table is created but contains no data.
3) Legal SQL queries that do not return any data (eg passing
"insert into SIMRESULTS (CV_ID) VALUES (199)" as the ODBCString) succeed
on the database side, but cause the calling S-plus function to terminate
control flow since no records are returned and it apparently but wrongly
thinks they should be. You can sometimes work around this by making the
first (not the last!) command of your SQL batch return data ("select *
from dummy_result; insert blah") but then you run into the problem that
create views etc have to be the first command in a sql batch. The
undocumented try() function of S-Plus 2000 may provide a way to work
around this.
4) Once you manage to insert records, they often, but not
invariably appear duplicated in the SQL table.
-------------------------------------
Dr Jonathan Swinton
Proteom Ltd
Babraham Hall
Babraham
Cambridge CB2 4AT
tel: 01223 496180
fax: 01223 496181
jswinton@proteom.com
www.proteom.com
-----------------------------------
|