v_sqltemp2       := 'SELECT BLDNO, FLOORS from building_att where mapping_no= '111''';PS:在字符串中,“''”表示一个“ '”,就像C语言的“\”在字符串中要表示为“\\”,VB中的“"”在字符串中要表示为“""”!!:)

解决方案 »

  1.   

    应为:
    v_sqltemp2 := 'SELECT BLDNO,FLOORS from building_att where mapping_no = '||'111'||chr(39);
    或:
    v_sqltemp2           varchar2(1000);
    v_sqltemp2='111'||chr(39);
    v_sqltemp2 := 'SELECT BLDNO, FLOORS from building_att where mapping_no = '||v_sqltemp2;
      

  2.   

    v_sqltemp2 := 'SELECT BLDNO,FLOORS from building_att where mapping_no = ''111''';