Home > Back-end >  Rookie help check the problem
Rookie help check the problem

Time:10-23

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

CodePudding user response:

reference hai-chao shen 2 floor response:
well, then 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, don't know is what reason


Copy is part of the string, this is you pick up -- an optional ExecutionContext. MaterialID 1-7 of string, and in front of you is to use the full -- an optional ExecutionContext. MaterialID

CodePudding user response:

Contrast is that the front two complete (MaterialID with '+ -- an optional ExecutionContext. MaterialID + "'), found that can match, and then I take the field's way to compare the two are consistent, can't match up, normally after copy also can match?

CodePudding user response:

reference tanqth reply: 3/f
Quote: refer to the second floor hai-chao shen response:
well, then 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, don't know is what reason


Copy is part of the string, this is you pick up -- an optional ExecutionContext. MaterialID 1-7 of string, and in front of you is to use the full -- an optional ExecutionContext. MaterialID


Contrast is that the front two complete (MaterialID with '+ -- an optional ExecutionContext. MaterialID + "'), found that can match, and then I take the field's way to compare the two are consistent, can't match up, normally after copy also can match?

CodePudding user response:

reference 5 floor hai-chao shen reply:
Quote: refer to the third floor tanqth response:
Quote: refer to the second floor hai-chao shen response:
well, then 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, don't know is what reason


Copy is part of the string, this is you pick up -- an optional ExecutionContext. MaterialID 1-7 of string, and in front of you is to use the full -- an optional ExecutionContext. MaterialID


Contrast is that the front two complete (MaterialID with '+ -- an optional ExecutionContext. MaterialID + "'), found that can match, and then I take the field's way to compare the two are consistent, can't match up, normally after copy also can match?


Can be matched, you just change the data content, is not necessarily the right data, is, of course, can not match,

CodePudding user response:

refer to 6th floor tanqth response:
Quote: refer to the 5 floor hai-chao shen response:
Quote: refer to the third floor tanqth response:
Quote: refer to the second floor hai-chao shen response:
well, then 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, don't know is what reason


Copy is part of the string, this is you pick up -- an optional ExecutionContext. MaterialID 1-7 of string, and in front of you is to use the full -- an optional ExecutionContext. MaterialID


Contrast is that the front two complete (MaterialID with '+ -- an optional ExecutionContext. MaterialID + "'), found that can match, and then I take the field's way to compare the two are consistent, can't match up, normally after copy also can match?


Can be matched, you just change the data content, is not necessarily the right data, of course, can not match,


Well, I manually put the two metrialID set to the same, such as AB1234.01 in this way, it is can match
  • Related