Why am I getting this error when creating an SQL query in MATLAB?

后端 未结 1 332
余生分开走
余生分开走 2021-01-21 14:21

I\'m trying to export some data from MATLAB to a database. I use a PostgreSQL database via ODBC as follows. First, I create the connection:

dbConn = database(\'P         


        
相关标签:
1条回答
  • 2021-01-21 15:11

    Have you tried using single quotes?

    >> q = sprintf('insert into test(name) values(''%s'')', 'xxx')
    
    q =
    
    insert into test(name) values('xxx')
    
    0 讨论(0)
提交回复
热议问题