Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Assigning select statment result to Variable ?

Posted on 2003-12-10
3
Medium Priority
?
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

718 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