General
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem setting bind variable with borland cpp and oracle 9.2

Dominique HUGOT
Occasional Visitor

Problem setting bind variable with borland cpp and oracle 9.2

I have Problem in setting bind variable with borland cpp and oracle 9.2

case #1:

TQuery *qy=NewQuery(Application);
qy->SQL->Text=" SELECT use_employee_num ";
qy->SQL->Add("FROM t_user ");
qy->SQL->Add("WHERE use_employee_num=:prmEmpNum ");
qy->ParamByName("prmEmpNum")->AsString=aEmployeeNum;
qy->Open();

the result of this query is the same as this query : Select use_employee_num From t_user where use_employee_num=' '
The bind variable prmEmpNum seems not to be set.


Case #2
TQuery *qy=NewQuery(Application);
qy->SQL->Text=" SELECT use_employee_num ";
qy->SQL->Add("FROM t_user ");
qy->SQL->Add("WHERE use_employee_num='" + aEmployeeNum + "' ");
qy->Open();

the result of this query is the result of : Select use_employee_num From t_user where use_employee_num='aEmployeeNum'
and aEmployeeNum is not an empty string

does anyone know why there is difference in the result between these 2 queries and why the bind variable seems not to be set ?

Thanks in advance