OBS/Auswertung/SQL Beispiel 2

Aus OBS Wiki
Wechseln zu: Navigation, Suche

Beispiel 2


//-----------------------------------------------------------------------------
// Unit Name: SqlExporter
// Author:    Jr
// Date:      04-Aug-2011
// Purpose:
// History:
//
// Folgende implementiere Funktionen stehen dem SQL-Exporter zur Verfügung
//
// function  GetSqlExportStr(oObj:TxDCScripter):String;
// procedure SetSQlExportStr(oObj:TxDCScripter; cSql:String);
// function  RunSQlExporter(oObj:TxDCScripter; lAuto:Boolean):Boolean;
// function  SaveDataSQlExporter(oDCScripter:TxDCScripter;cFileName:String; nWahl:Integer;lAuto:Boolean):Boolean;
// function  ShowDataSQlExporter(oDCScripter:TxDCScripter):Boolean;
//
//-----------------------------------------------------------------------------

program SQLEXport;

uses dialogs;

var oForm  : TForm;
    lCheck : Boolean;
    oDC    : TDCScripter;

Const CSV    = 2;
      EXCEL  = 3;
      HTML   = 4; //Nur im Grid Möglich

implementation

//-----------------------------------------------------------------------------
//  Procedure: Not available
//  Author:    Jr
//  Date:      04-Aug-2011
//  Arguments: Not available
//  Result:    Not available
//-----------------------------------------------------------------------------

procedure StartProc(oMyDC:TDCScripter; cParameter:String);
var cSQL : String;
begin

    oDC  := oMyDC;
    cSQL := 'SELECT * FROM WARENGR'+
            ' WHERE wg_nr >=  "001" AND wg_nr <= "100"'+
            ' ORDER BY wg_nr';

    SetSqlExportStr(oDC,cSQL);
    ShowDataSQlExporter(oDC);

end;

//-----------------------------------------------------------------------------

end.

Auto import 15:27, 25. Aug. 2011 (CEST)