• TDatabase TQuery TDataSource TDBGrid 设定方法


    TDatabase TQuery TDataSource TDBGrid
    object Database1: TDatabase
      AliasName = 'sfis'
      DatabaseName = 'Allcon'
      LoginPrompt = False
      Params.Strings = (
        'SERVER NAME=SFIS.WORLD'
        'USER NAME=sfis1'
        'NET PROTOCOL=TNS'
        'OPEN MODE=READ/WRITE'
        'SCHEMA CACHE SIZE=8'
        'LANGDRIVER=taiwan'
        'SQLQRYMODE=SERVER'
        'SQLPASSTHRU MODE=SHARED AUTOCOMMIT'
        'SCHEMA CACHE TIME=-1'
        'MAX ROWS=-1'
        'BATCH COUNT=200'
        'ENABLE SCHEMA CACHE=FALSE'
        'SCHEMA CACHE DIR='
        'ENABLE BCD=FALSE'
        'ENABLE INTEGERS=FALSE'
        'LIST SYNONYMS=NONE'
        'ROWSET SIZE=20'
        'BLOBS TO CACHE=64'
        'BLOB SIZE=32'
        'OBJECT MODE=TRUE'
        'PASSWORD=sfcbasetable1')
      ReadOnly = True
      SessionName = 'Default'
    end
    object Query1: TQuery
      DatabaseName = 'Allcon'
    end
    object DataSource1: TDataSource
      DataSet = Query1
    end
    object DBGrid1: TDBGrid
      DataSource = DataSource1
    end
    //没有参数查询
    Query1.Close; Query1.SQL.Clear; Query1.SQL.Add(
    'SELECT * FROM SFISM4.R_MATERIAL_EXC_T'); Query1.Open;
    //传参时

    sn:='MATERIAL_SN=:sn';
    Query1.Close;
    Query1.SQL.Clear;
    Query1.SQL.Add('SELECT * FROM SFISM4.R_MATERIAL_EXC_T where '+sn);
    Query1.ParamByName('sn').AsString := Edit_Qry_KPNO.Text;
    Query1.Open;

    //插入 或更新操作时
     query1.Close;
          query1.SQL.Clear;
    query1.SQL.Add('INSERT INTO SFISM4.R_MATERIAL_EXC_T (MATERIAL_SN,VENDER,DATA_CODE,LOC_CODE,EXC_TIME,EXC_CODE,ERROR_REASON,BAR_RATE,REASON_COME,CLEAR_FLAG,CLEAR_CODE,CLOSE_FLAG,CLEAR_TIME,QUA_DC,EIGHT_D_CODE,EIGHT_D_ADD,VC_CONTACT,SQE_CONTACT) ' +
                           'VALUES ( :MATERIAL_SN,:VENDER,:DATA_CODE,:LOC_CODE,:EXC_TIME,:EXC_CODE,:ERROR_REASON,:BAR_RATE,:REASON_COME,:CLEAR_FLAG,:CLEAR_CODE,:CLOSE_FLAG,:CLEAR_TIME,:QUA_DC,:EIGHT_D_CODE,:EIGHT_D_ADD,:VC_CONTACT,:SQE_CONTACT)');
            query1.ParamByName('MATERIAL_SN').AsString:=Edit_KP.Text;
           //...此处省去其他参数赋值
            query1.ExecSQL;

    query1.SQL.Add('UPDATE SFISM4.R_MATERIAL_EXC_T SET MATERIAL_SN=:MATERIAL_SN,VC_CONTACT=:VC_CONTACT,SQE_CONTACT=:SQE_CONTACT'+' '+
    'where MATERIAL_SN=:MATERIAL_SN ')

     
          date11:= formatdatetime('YYYYMMDD',DT_ex_Begin.date);        //?date�??Θ?�''/''��才﹃�
          date22:= formatdatetime('YYYYMMDD',DT_ex_End.date);
          time11:= Time1.text; //格式为 13:30 
          time22:= time2.text;
          ssql:='SELECT * FROM SFISM4.R_MATERIAL_EXC_T where EXC_TIME  between to_date('''+Date11+''' || '''+ time11+''',''YYYYMMDDhh24:miss'') and to_date('''+Date22+''' || '''+ time22+''',''YYYYMMDDhh24:miss'') ';
  • 相关阅读:
    HDU6393(LCA + RMQ + 树状数组) n边图,两点最短距离 , 修改边权
    POJ 2763 (LCA +RMQ+树状数组 || 树链部分) 查询两点距离+修改边权
    HDU6396 (贪心+fread 挂)
    使用hadoop自带的例子作测试 笔记三
    hadoop的布暑方式 笔记二
    1 Hadoop原理介绍 笔记一
    ssh+flex
    openssh升级过程
    redhat5yum源配置
    struts2实现权限拦截
  • 原文地址:https://www.cnblogs.com/rogge7/p/5744179.html
Copyright © 2020-2023  润新知