Home > database >  For help: pb under the embedded SQL statement does not perform
For help: pb under the embedded SQL statement does not perform

Time:09-26

The first time I embed in the pb sounds like the embedded SQL statement but does not perform,

String s_tra_id
Int i_tra_id

The select train_id into: i_tra_id
The from t_train
The where (train_no=5) and (project_id=1);

S_tra_id=string (i_tra_id)
St_3. Text=s_tra_id

St_3 always show 0

Masters help you see, is what problem? Before using embedded SQL statement to declare?

CodePudding user response:

St_3 always show 0, is not necessarily don't run, but the results is empty or 0

The select train_id into: i_tra_id
The from t_train
The where (train_no=5) and (project_id=1);
What are the results in the query analyzer?

CodePudding user response:

In s_tra_id=string (i_tra_id) before write:
If the sqlca. Sqlcode & lt;> 0 then
Messagebox (' SQL statement error, the sqlca sqlerrtext)
Return
End the if


CodePudding user response:

Well train_id from t_train
The where (train_no=5) and (project_id=1)

Take it directly to the database to perform, see whether have value!
  • Related