SQL.Add('select id from '+ table +' where name =:name');我sql语句的table表是个变量这个该怎么写,老是提示我语法错误

解决方案 »

  1.   

    select id from trim(table) where name =:name
      

  2.   

    我的意思是说,table就是一个变量,查询的表名是根据table变量传入的值来确定的!
      

  3.   

    我的意思是说,table就是一个变量,查询的表名是根据table变量传入的值来确定的!
      

  4.   

    table是什么类型的变量的啊!
      

  5.   

    SQL.Add('select id from '''+ table +''' where name =name');
      

  6.   

    如果将table做为 string 变量的话应该不会有什么问题,不行的话就用showMessage(Sql.text)看看到底出了什么问题。
      

  7.   

    SQL.Add('select id from  :tablename where name = :name');