比如:通过系统web页面自动生成了sql语句,insert into temp(select '1,2,3',to_date(sysdate,'yyyy--mm-dd hh24:mi:ss') from dual),将这条SQL保存到另外一张表的SQL字段(列)中。

说白了,现在就是遇到这些单引号的问题,无法将SQL语句保存到数据库的表中。

 

答案:

INSERT INTO t(col)
SELECT 'insert into temp SELECT ''1,2,3'',to_char(sysdate,''yyyy-mm-dd hh24:mi:ss'') from dual' FROM dual;

 

相关文章:

  • 2021-10-26
  • 2021-10-02
  • 2021-10-16
  • 2021-10-16
  • 2021-10-16
猜你喜欢
  • 2021-12-09
  • 2022-12-23
  • 2022-01-12
  • 2021-12-09
  • 2021-07-20
  • 2021-11-29
  • 2021-11-29
相关资源
相似解决方案