[R] RODBC Multiple Results
Law, Jason
J@@on@L@w @end|ng |rom port|@ndoregon@gov
Mon Mar 30 21:05:39 CEST 2020
Harold,
I have dealt with this problem over the years and after much experimenting, I can say that I *think* what you want is impossible. For RODBC, you need a stored proc that uses SET NOCOUNT ON and that only returns a single result set. You may want to try experimenting with the odbc package (https://github.com/r-dbi/odbc), although there it appears that it isn’t possible there yet, there is a pull request which adds this functionality for sqlServer. You may want to try hitting up the author of the pull request.
Regards,
Jason
From: R-help <r-help-bounces using r-project.org> On Behalf Of Bert Gunter
Sent: Wednesday, March 25, 2020 12:39 PM
To: Doran, Harold <HDoran using air.org>
Cc: r-help using r-project.org
Subject: Re: [R] RODBC Multiple Results
⛔
The City's email systems have identified this email as potentially suspicious. Please click responsibly and be cautious if asked to provide sensitive information.
You might wish to post this on r-sig-db if you do not get a
satisfactory reply here.
Also, have you checked the databases task view on :
https://cran.r-project.org/ ?
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Wed, Mar 25, 2020 at 9:54 AM Doran, Harold wrote:
>
> I'm calling a stored procedure that returns multiple tables and my current framework uses RODBC and sqlQuery() to communicate between R and the databases we connect to. A new stored procedure returns multiple tables and I found this on SO indicating that RODBC "may not" be able to retrieve multiple tables.
>
> https://stackoverflow.com/questions/41494419/how-to-read-multiple-result-sets-returned-from-a-sql-server-stored-procedure-in
>
> I'd very much like to continue within the structure of code I have using RODBC, so am asking if RODBC in fact *cannot* retrieve multiple tables as noted in the SO responses or if anyone has insight on how it might be feasible within the context of RODBC using sqlQuery()?
>
> Thanks
> Harold
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org<mailto:R-help using r-project.org> mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help using r-project.org<mailto:R-help using r-project.org> mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help
mailing list