dbSendquery giving format error


dbSendquery giving format error



I need to create a table and insert some values into it uisng r


library(sqldf)
Company_Master <- dbConnect(SQLite(), dbname="Company Master.sqlite" )
dbSendQuery(conn = Company_Master,
"CREATE TABLE Company Master(
Comp_name varchar
Address varchar)
")



Till here no error is given.But after this when i want to insert some value into the table


dbSendQuery(conn = Company_Master, "INSERT INTO COMPANY MASTER
VALUES('INFOSYS','abcLALA')")



I get error like


Error in result_create(conn@ptr, statement) : near "Master": syntax error



I found the format on https://www.r-bloggers.com/r-and-sqlite-part-1/ and don't seem to get any other format except if using dbCEATETABLE. What is wrong in this format? Please help









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

how to run turtle graphics in Colaboratory

Export result set on Dbeaver to CSV