V 8
2
LANG:0 0 
LANG:1 0 
PANEL,34 47 492 317 N "_3DFace" 1
"$1"
"main()
{
  int        i;
  dyn_string types=dpNames(\"*\",\"_IS_TableType\");
  
  for (i=1;i<=dynlen(types);i++) types[i]=dpSubStr(types[i],DPSUB_DP);
  
  setMultiValue(\"DbName\",\"text\",$1,
                \"TableName\",\"text\",\"StandardHistory1\",
                \"TableType\",\"text\",\"StandardHistory\",
                \"TableOldDays\",\"text\",31,
                \"TableFIFOAtHour\",\"text\",0,
//                \"TableType\",\"items\",types);
                \"TableType\",\"items\",makeDynString(\"StandardHistory\"));
  setInputFocus(myModuleName(),myPanelName(),\"TableName\");
}" 0
 E E E E 1 -1 -1 0  20 80
""
DISPLAY_LAYER, 1 1 1 1 1 1 1 1
LAYER, 0 
2
LANG:0 0 
LANG:1 0 
2 0
""
""
20 -100 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  0 E 0 0 0 "s" 0 0 0 0 0 0  20 37 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 14  Tabellenname:
LANG:1 12  Table name:
2 1
""
""
-612.630149388863 69 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  0 E 0 0 0 "s" 0 0 0 0 0 0  20 77 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 13  Tabellentyp:
LANG:1 12  Table type:
22 2
"TableType"
""
120 70 E E E 1 E 1 E N [0,0,0] E N "_Window" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 120 70 280 99
1
2
LANG:0 15 StandardHistory
LANG:1 15 StandardHistory

1

E
E
E
 0 0
2 3
""
""
42 -91 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  0 E 0 0 0 "s" 0 0 0 0 0 0  292 186 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 12  Max. Länge:
LANG:1 13  Max. length:
21 4
"TableMaxLengthDpeName"
""
379 180 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 379 180 439 209
0

E
E
E

N 10 255 1 255 1 1
20 5
"TableSystemNameDpe"
""
379 140 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 379 140 412 169
1
T 
2
LANG:0 1  
LANG:1 1  

0 E E
1
E E
2 6
""
""
-1 -99 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  0 E 0 0 0 "s" 0 0 0 0 0 0  259 145 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 18  Inkl. Systemname:
LANG:1 19  Incl. system name:
6 7
""
""
10 20 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E 0.796610169491526 0 1.28571428571429 2.03389830508474 -5.7142857142858 0 E 10 20 600 90
6 8
""
""
10 20 E E E 1 E 1 E N "_Window" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E 0.796610169491525 0 1.28571428571429 3.03389830508474 -4.7142857142858 0 E 10 20 600 90
14 9
"TableName"
""
120 30 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 120 30 275 59
3 "s" 0 0 0 0 0 -1  E E E
19 10
"TableAlias"
""
120 140 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 120 140 213 196
2
T 
2
LANG:0 8 DPE-Name
LANG:1 8 DPE name

1 E E
T 
2
LANG:0 5 Alias
LANG:1 5 Alias

0 E E
1
E E2 11
""
""
20 -100 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  0 E 0 0 0 "s" 0 0 0 0 0 0  20 150 2
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 13  Speichern in
LANG:1 10  Saving in
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 13  der Tabelle:
LANG:1 11  the table:
6 12
""
""
10 20 E E E 1 E 1 E N "_Window" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E 0.796610169491526 0 2.00000000000001 3.03389830508472 90.9999999999995 0 E 10 20 600 90
6 13
""
""
10 20 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E 0.796610169491526 0 2.00000000000001 2.03389830508474 89.9999999999995 0 E 10 20 600 90
2 14
""
""
20 -90 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  1 E 0 0 0 "s" 0 0 0 0 0 0  20 120 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 35  DPE-Identifikation in der Tabelle 
LANG:1 33  DPE-identification in the table 
2 15
""
""
20 -100 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  1 E 0 0 0 "s" 0 0 0 0 0 0  20 10 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 9  Tabelle 
LANG:1 7  Table 
13 16
""
""
380 280 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 380 280 480 307

T 
2
LANG:0 9 Abbrechen
LANG:1 6 Cancel
"main()
{
  PanelOffReturn(makeDynFloat(-1),makeDynString());
}" 0
 E E E
13 17
""
""
270 280 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 270 280 370 307

T 
2
LANG:0 2 OK
LANG:1 2 OK
"main()
{
  int          TableMaxLengthDpeName,TableAlias,
               DbAlivePeriod,err,TableOldDays,TableFIFOAtHour;
  bool         TableSystemNameDpe,insert=true;
  string       TableName,TableType,
               DbName,DbPath,DbType,DbUser,DbPassword,
               Db=$1,dp;
  dyn_int      lengths;
  dyn_string   fields,types,indices,origins,tables,ds; 
  dbConnection conn;
  dbRecordset  recordset;

  getMultiValue(\"TableName\",\"text\",TableName,
                \"TableType\",\"text\",TableType,
                \"TableMaxLengthDpeName\",\"text\",TableMaxLengthDpeName,
                \"TableOldDays\",\"text\",TableOldDays,
                \"TableFIFOAtHour\",\"text\",TableFIFOAtHour,
                \"TableSystemNameDpe\",\"state\",0,TableSystemNameDpe,
                \"TableAlias\",\"number\",TableAlias);

  TableName=strltrim(strrtrim(TableName));
  if (TableName==\"\")
  {
    // error: table name == \"\"
    ISShowWarning(\"emptytablename\",\"\");
    return;
  }

  // checking invalid characters
  if (!IS_CheckChar(TableName))
  {
    // error: invalid character(s) in table name
    ISShowWarning(\"invalidchar\",\"\");
    return;
  }

  // Creating and setting table datapoint 
  dp=Db+\"_\"+TableName;
  if (dpExists(dp))
  {
    // error: invalid character(s) in table name
    ISShowWarning(\"tableexists\",TableName);
    return;
  }
  
  dpCreate(dp,\"_IS_Table\");

  dpSet(dp+\".TableName:_original.._value\",TableName,
        dp+\".TableType:_original.._value\",TableType,
        dp+\".TableMaxLengthDpeName:_original.._value\",TableMaxLengthDpeName,
        dp+\".TableSystemNameDpe:_original.._value\",TableSystemNameDpe,
        dp+\".TableOldDays:_original.._value\",TableOldDays,
        dp+\".TableFIFOAtHour:_original.._value\",TableFIFOAtHour,
        dp+\".TableAlias:_original.._value\",TableAlias);

  ds[1]=TableName;
  ds[2]=TableType;
  ds[3]=TableMaxLengthDpeName;
  ds[4]=TableSystemNameDpe;
  ds[5]=TableAlias;
  ds[6]=TableOldDays;
  ds[7]=TableFIFOAtHour;

  // Creating table in database if needed (if database != \"\")
  if (Db!=\"\")
  {
    if (!dpExists(Db))
    {
      // error: database dp does not exist
      ISShowWarning(\"dbdpnotexists\",Db);
      dpDelete(dp);
      return;
    }

    dpGet(Db+\".DbName:_original.._value\",DbName,
          Db+\".DbPath:_original.._value\",DbPath,
          Db+\".DbType:_original.._value\",DbType,
          Db+\".DbUser:_original.._value\",DbUser,
          Db+\".DbPassword:_original.._value\",DbPassword,
          Db+\".DbAlivePeriod:_original.._value\",DbAlivePeriod,
          TableType+\".TableFieldName:_original.._value\",fields, 
          TableType+\".TableFieldType:_original.._value\",types, 
          TableType+\".TableFieldLength:_original.._value\",lengths, 
          TableType+\".TableFieldOrigin:_original.._value\",origins, 
          TableType+\".TableFieldIndexType:_original.._value\",indices); 
          
    err=IS_OpenConnection(DbName, 
                          DbPath, 
                          DbType, 
                          DbUser, 
                          DbPassword, 
                          conn);
    if (err)
    {
      // error: opening connection
      ISShowWarning(\"connerr\",err);
      dpDelete(dp);
      return;
    }

// !!! DB-specific
    if (TableType==\"StandardHistory\")
    {
      switch (DbType)
      {
        case \"MS Access\" :
          fields=makeDynString(\"DPE String (\"+TableMaxLengthDpeName+\") NOT NULL\", 
                               \"Zeit Date NOT NULL\", 
                               \"Wert Double\", 
                               \"Status Long\");
          indices=makeDynString(\"DPE\",\"Zeit\");
          break;
        case \"MS Excel\" : break;
          break;
        case \"MS SQL-Server\" :
          fields=makeDynString(\"DPE varchar(\"+TableMaxLengthDpeName+\") NOT NULL\", 
                               \"Zeit datetime NOT NULL\", 
                               \"Wert float\", 
                               \"Status int\");
          indices=makeDynString(\"DPE\",\"Zeit\");
          break;
        case \"Oracle\" :
          fields=makeDynString(\"DPE VARCHAR2 (\"+TableMaxLengthDpeName+\")\", 
                               \"Zeit DATE\", 
                               \"Wert FLOAT\", 
                               \"Status NUMBER(10)\");
          indices=makeDynString(\"DPE\",\"Zeit\");
          break;
      }
    }
    else
    
    {
      // error: invalid table type
      ISShowWarning(\"invalidtabletype\",TableType);
      err=dbCloseConnection(conn);
      if (err)
      {
        // error: closing connection
        adoShowError(conn);
        dpDelete(dp);
      }
      return;
    }

    err=dbOpenRecordset(conn,\"SELECT * FROM \"+TableName, recordset, 1); 
    if (err)  
      err=IS_CreateTable2(conn,TableName,DbType,fields,indices); 
    else
      err=dbCloseRecordset(recordset);

    if (err)
    {
      // error: creating table
      adoShowError(conn);
      err=dbCloseConnection(conn);
      dpDelete(dp);
      return;
    }
    err=dbCloseConnection(conn);
    if (err)
    {
      // error: closing connection
      adoShowError(conn);
      dpDelete(dp);
      return;
    }
    IS_UpdateTableList(DbName,
                       DbPath,
                       DbType,
                       DbUser,
                       DbPassword,
                       TableName,
                       insert, // true==insert, false==delete
                       err);
    dpSetWait(Db+\"_\"+TableName+\".TableFIFOThreadNumber:_original.._value\",-1);
    dpSet(\"_IS_Control_1.TableName:_original.._value\",Db+\"_\"+TableName,
          \"_IS_Control_1.TableFIFO:_original.._value\",true);
    PanelOffReturn(makeDynFloat(1),ds);
  }
  else
    PanelOffReturn(makeDynFloat(-1),makeDynString());
}
" 0
 E E E
2 18
""
""
42.0408163265306 -111 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  1 E 0 0 0 "s" 0 0 0 0 0 0  300 36 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 4  DB:
LANG:1 4  DB:
14 20
"DbName"
""
330 30 E E E 1 E 1 E N "_WindowText" E N "_3DFace" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 330 30 467 59
2 "s" 0 0 0 0 0 -1  E E E
4 23
""
""
10 220 E E E 1 E 1 E N "_3DText" E N [80,80,80] E E
 E EE E 0 0 0 0 1 E  10 220 479.204737732657 220
4 24
""
""
10.7952622673435 221 E E E 1 E 1 E N "_Window" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E  10.7952622673435 221 480 221
14 26
"TableOldDays"
""
177 231 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 177 231 231 260
3 "6d" 6 0 0 0 0 -1  E E E
2 27
""
""
17 26 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  0 E 0 0 0 "s" 0 0 0 0 0 0  17 237.999999999999 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 27  Tabelleneinträge älter als
LANG:1 26  Delete records older then
2 28
""
""
231 26.000000000001 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  0 E 0 0 0 "s" 0 0 0 0 0 0  231 238 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 24 Tage löschen, täglich um
LANG:1 30 days,                 daily at
21 29
"TableFIFOAtHour"
""
379 231 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
 379 231 430 260
0

E
E
E

N 0 23 1 0 1 1
2 30
""
""
435 70 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E EE E 0 0 0 0 1 E U  0 E 0 0 0 "s" 0 0 0 0 0 0  435 238 1
2
LANG:0 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
LANG:1 70 -microsoft windows-arial-medium-r-normal-*-*-120-100-100-*-*-iso8859-1
0
2
LANG:0 3 Uhr
LANG:1 7 o'clock
0
LAYER, 1 
2
LANG:0 0 
LANG:1 0 
0
LAYER, 2 
2
LANG:0 0 
LANG:1 0 
0
LAYER, 3 
2
LANG:0 0 
LANG:1 0 
0
LAYER, 4 
2
LANG:0 0 
LANG:1 0 
0
LAYER, 5 
2
LANG:0 0 
LANG:1 0 
0
LAYER, 6 
2
LANG:0 0 
LANG:1 0 
0
LAYER, 7 
2
LANG:0 0 
LANG:1 0 
0
0