str1:='insert into tmptest select * from user_m where loginid= ''||muser||'' and password='||pwd;
oracle的字符中 '' 表示  '

解决方案 »

  1.   

    sorry 应该是这样的:
    str1:='insert into tmptest select * from user_m where loginid= '''||muser||''' and password='||pwd;
      

  2.   

    还不对 :(
    str1:='insert into tmptest select * from user_m where loginid= '''||muser||''' and password='''||pwd||'''';
      

  3.   

    都不行的,按这种方式加入单引号后,select 语句中根本取不到值了,只能生成一个空表
      

  4.   

    为什么不用占位符???!!!
    str1:='insert into tmptest select * from user_m where loginid= :muser and password=:pwd';
    execute immeidate str1 using muser,pwd
      

  5.   

    占位字符能在ddl类命令中使用吗?
      

  6.   

    str1:='insert into tmptest select * from user_m where loginid= :muser and password=:pwd';
    execute immeidate str1 using muser,pwd
      

  7.   

    你那是dml操作,下例就不行str1:='create global temporary table tmptest on commit preserve rows as select * from user_m where loginid= :muser and password=:pwd';