This rookie first contact Delphi, because of work need to update the original script, found the following change is invalid, so I don't know what's the problem? Thank you very much!!!!! Background: 1. Before a task from the table 1 ID1 2. Through the ID1 ID1 to match table 2, get the corresponding ID2 (3) is obtained by matching ID2 ID2 to table 3, then the corresponding before a task Name 4. In the same way to get the task Name 5. Determine the currently executing the Name and last Name is the same, if, you can execute a program for
The begin PrevID1:=SQLSelect (' ID1 FROM table1 '+ 'WHERE ID1 & lt; '+ -- an optional ExecutionContext. ID1 + 'AND X="' + -- an optional ExecutionContext. X + "' ORDER BY ID1 DESC ', 1);//get a task before ID1
If (PrevID1 & lt;> Nil) and (PrevID1 RowCount & gt; 0) then The begin PrevID2:=SQLSelect (' ID2 FROM table2 '+ 'WHERE ID1=' PrevID1 "', 1);//get a task before ID2
PrevName2:=SQLSelect (' Name2 FROM table3 '+ 'WHERE ID2=PrevID2', 1);//get a task Name before
Execution_ID2:=SQLSelect (' ID2 FROM table2 '+ 'WHERE ID1=-- an optional ExecutionContext. ID1', 1);//get the current task ID2
Execution_Name:=SQLSelect (' Name FROM table3 '+ 'WHERE ID2=Execution. ID2', 1);//get the current task Name
If (PrevName=Execution_Name) then//determine whether two tasks Name consistent The begin XXXXX//continue to the next step end; end; end;
CodePudding user response:
SQLSelect should be your own write a function in the system, as to how he should use, that must according to you this function is to determine how to write,
CodePudding user response:
Well, that ask a different question, behind the SQL where clause to add before I MaterialID="' + -- an optional ExecutionContext. MaterialID + ' ' 'proved to be able to query into things, to match, I'd like to change to field behind to such copy (MaterialID, 1, 7)="' + copy (MaterialID. -- an optional ExecutionContext., 1, 7) + ' ' 'the result is not line, I don't know what reason be