Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Assigning select statment result to Variable ?

Posted on 2003-12-10
3
Medium Priority
?
214 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 80 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

824 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