Solved

Assigning select statment result to Variable ?

Posted on 2003-12-10
3
209 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 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

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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