Solved

Assigning select statment result to Variable ?

Posted on 2003-12-10
3
204 Views
Last Modified: 2010-04-05
hi
can I assign  Select Statement result to spesific variable ?
for example I have Avariable M:word or Integer  and Iwant to assign this Variable the value of next statment :-
query1.SQL.add('select employee_id from emp where name=Ali');
If it is not Possible How Can I do it ?
 

0
Comment
Question by:sraab2004
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 20 total points
ID: 9912451
...
query1.SQL.add('select employee_id from emp where name=Ali');
query1.open;
IntegerVar := query1.FieldByName('employee_id').AsInteger;
query1.Close;
....

meikl ;-)
0
 

Expert Comment

by:songhd
ID: 9917733
I give u the example to solve it.

procedure TForm1.Button1Click(Sender: TObject);
var
Num:integer;//the variable to save your select result about employee_id)
begin
Query1.Close;
Query1.Clear;
Query1.SQL.Add('select employee_id from emp where name=Ali');
Query1.Open;
Num:=Query1.FieldByName('employee_id').AsInteger;
end;
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9918359
looks similar, songhd :-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now