Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using SQl In My Delphi Code

Posted on 2003-11-04
6
Medium Priority
?
293 Views
Last Modified: 2010-05-18
How Can I  assign Sql Functions Or out Put To a ver. in My code For Delphi 7
0
Comment
Question by:zayn
[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
6 Comments
 
LVL 2

Expert Comment

by:Moroni24
ID: 9682288
Can you explain you question a bit further?
0
 
LVL 6

Accepted Solution

by:
swift99 earned 252 total points
ID: 9683307
I think he means embedded SQL as in COBOL and some C compilers.

EXEC SQL
    SELECT *
    into rec.a, rec.b, rec.c
    from mytable
    where condition=true
END EXEC

There is a Pascal precompiler with Firebird for doing embedded SQL.  It is extremely uncommon in the Delphi world, and Java has followed a similar model to the one that Delphi created, so embedded SQL is not necessarily going to be around very long outside of the mainframe world.
0
 

Author Comment

by:zayn
ID: 9690167
How Can I  assign Sql Functions Or out Put To a  VARIABLE  in My code For Delphi 7
0
 
LVL 2

Assisted Solution

by:Moroni24
Moroni24 earned 248 total points
ID: 9690211
If you're using a TQuery, you can do something like

var
  qry : TQuery;
  x : string;
begin
  try
    qry := TQuery.Create(nil);
    qry.DatabaseName := yourdbname;
    with qry.SQL do begin
      Add(' call myprocedure ');
    end
   qry.ExecSQL
   while not qry.eof do begin
      x :=  qry.FieldByName('name').AsString
    end;
  finally
    FreeAndNil(qry);
  end;
end;
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

722 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