Help with SQLsave

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with SQLsave

Ramesh YAPALPARVI
Hi all,



I'm using RODBC library to connect to a database.

I'm trying to read a table from a database and after manipulating it would like to write to the same database but with a different table



P<-data.frame(sqlQuery(myconn,'select  *  from Demographics'))
sqlSave(myconn,p,tablename="trial",rownames=FALSE)




I'm gettng this error







Version:1.0 StartHTML:0000000107 EndHTML:0000001014 StartFragment:0000000127 EndFragment:0000000996
Error in sqlSave(myconn, p, tablename = "trial", rownames = FALSE) :
  [RODBC] Failed exec in Update
22018 0 [Microsoft][ODBC Driver 11 for SQL Server]Invalid character value for cast specification


Thanks,

Ramesh
______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Help with SQLsave

SHUXIANG 'ALBERT' LI
"P" is not "p"


try

sqlSave(myconn,P,tablename="trial",rownames=FALSE)


Have a wonderful day!

- Albert
________________________________
From: R-help <[hidden email]> on behalf of Ramesh YAPALPARVI <[hidden email]>
Sent: Wednesday, January 24, 2018 4:00:39 PM
To: [hidden email]
Subject: [R] Help with SQLsave

Hi all,



I'm using RODBC library to connect to a database.

I'm trying to read a table from a database and after manipulating it would like to write to the same database but with a different table



P<-data.frame(sqlQuery(myconn,'select  *  from Demographics'))
sqlSave(myconn,p,tablename="trial",rownames=FALSE)




I'm gettng this error







Version:1.0 StartHTML:0000000107 EndHTML:0000001014 StartFragment:0000000127 EndFragment:0000000996
Error in sqlSave(myconn, p, tablename = "trial", rownames = FALSE) :
  [RODBC] Failed exec in Update
22018 0 [Microsoft][ODBC Driver 11 for SQL Server]Invalid character value for cast specification


Thanks,

Ramesh
______________________________________________
[hidden email] 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]]

______________________________________________
[hidden email] 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.