Solved

Using SQl In My Delphi Code

Posted on 2003-11-04
6
291 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 63 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 62 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

617 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