sql:='update job set job_id='+edit6.Text+'where job_id='+edit1.Text+'or job_name='+quotedstr(edit7.Text)+' where job_name='+quotedstr(edit2.text); 
 只能修改id,不能修改name 语句哪里错了

解决方案 »

  1.   

    问题是上面的语句,就没有修改name的语句啊~~
      

  2.   

    'or job_name='+quotedstr(edit7.Text)+' where job_name='+quotedstr(edit2.text); 
    这是修改name的吧
      

  3.   

    set job_name='+quotedstr(edit7.Text);
      

  4.   

    這是判斷條件  怎么能事修改name的呢
      

  5.   

    update job 
    set job_id='',job_name=''
    where 条件
      

  6.   


    sql:='update job set job_id='+edit6.Text+ ',''' + job_name='+quotedstr(edit2.text)  + ''' where job_id='+edit1.Text+'or job_name='+quotedstr(edit7.Text)
      

  7.   

    [SQL code]sql:='update job set job_id='+edit6.Text+ ',''' job_name='+quotedstr(edit2.text)  + ' where job_id='+edit1.Text+'or job_name=' + quotedstr(edit7.Text)[/Quote]
      

  8.   

    sql:='update job set job_id='+edit6.Text+'where job_id='+edit1.Text+'or job_name='+quotedstr(edit7.Text)+' where job_name='+quotedstr(edit2.text);
    为啥会有2个where
      

  9.   

    job_id='+edit6.Text+'                  sql应该是:id = 数字; 不用引号。
    job_name='+quotedstr(edit7.Text)+'     sql应该是:name = “字符串”; 要带引号吧?!
    试下面的看看:
    sql:='update job set job_id='+edit6.Text+',job_name='+quotedstr(edit2.text) where job_id='+edit1.Text+'or job_name='''+quotedstr(edit7.Text)+''''; 
      

  10.   

    写错了
    sql:='update job set job_id='+edit6.Text+',job_name='+quotedstr(edit2.text)'where job_id='+edit1.Text+'or job_name='''+quotedstr(edit7.Text)+'''';
      

  11.   

    貌似前面那个quotedstr(edit2.text)也要加上引号才行...不然会当作字段sql:='update job set job_id='+edit6.Text+',job_name='''+quotedstr(edit2.text)''' where job_id='+edit1.Text+' or job_name='''+quotedstr(edit7.Text)+'''';
      

  12.   

    这个肯定不能执行,字符串值用到sql 里面要用单上号勾了来如果你的语句不改,那么在前面加上:edit1.text:=''''+edit1.text+'''';
    edit2.text:=''''+edit2.text+'''';
    edit6.text:=''''+edit6.text+'''';
    edit7.text:=''''+edit7.text+'''';然后再试试。
      

  13.   


    edit1.text:=''''+edit1.text+''''; 
    edit2.text:=''''+edit2.text+''''; 
    edit6.text:=''''+edit6.text+''''; 
    edit7.text:=''''+edit7.text+'''';