Solved

Using SQl In My Delphi Code

Posted on 2003-11-04
6
289 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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 …

751 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