delphinewbie
Programmer
CUSTOMER // TABLE NAME
CustID CustName
A001 Andy
A002 John
A003 Smith
A004 Lee
The data list above is store in the MSSQL database.. In my delphi program, i want to
extract/get the data for CustName where the custID is equal to A003.. So what SQL statement
should i write ?
I know it's something like the following:
function TdmSVSSession.IsIngotNo2Exists(IngotNo:String; LotNo: String): Boolean;
begin
With qry do
begin
Close;
SQL.Clear;
SQL.Add('SELECT CustName FROM CUSTOMER');
SQL.Add('WHERE CustID= A003');
Open;
result := not IsEmpty;
end;
end;
But my problem is that SQL statment is only return the value either TRUE or FALSE.. All i want
is the data from the database .. Like in this case, the return value that i want is "Smith"
instead of "TRUE" ... can any one there help me with that problem ..
I think it's easy for ya guys.. but for me it's hard .. cos i'm just the newbie for programming.
All the help is appreciated in advance .. thanks..
CustID CustName
A001 Andy
A002 John
A003 Smith
A004 Lee
The data list above is store in the MSSQL database.. In my delphi program, i want to
extract/get the data for CustName where the custID is equal to A003.. So what SQL statement
should i write ?
I know it's something like the following:
function TdmSVSSession.IsIngotNo2Exists(IngotNo:String; LotNo: String): Boolean;
begin
With qry do
begin
Close;
SQL.Clear;
SQL.Add('SELECT CustName FROM CUSTOMER');
SQL.Add('WHERE CustID= A003');
Open;
result := not IsEmpty;
end;
end;
But my problem is that SQL statment is only return the value either TRUE or FALSE.. All i want
is the data from the database .. Like in this case, the return value that i want is "Smith"
instead of "TRUE" ... can any one there help me with that problem ..
I think it's easy for ya guys.. but for me it's hard .. cos i'm just the newbie for programming.
All the help is appreciated in advance .. thanks..