Solved

SQL's

Posted on 1997-05-06
2
171 Views
Last Modified: 2010-04-06
How can I give params to my SQL? How do I update SQL's?
Ex. I have a qeury like this:
Select c.naam,c.voornaam,cs.groep,cs.status,cs.count
from cursist7 c,cursus7 cs //Cursus7 And cursist7 must be 2 //variabeles.
where c.volgnr = cs.volgnr and c.naam = :=naam

How can I update a Qeury like this. Please help me, it's urgent.
0
Comment
Question by:DDTom23
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
javiertb earned 100 total points
ID: 1335941
To pass params to your Query :

Query1.Close;
Query1.Clear;  //Clear the Query text
Query1.Add('Select * from Table1 where Stringfield1 = :Param1');
Query1.ParamByName('Param1').AsString:='Name';
// You could also use Query1.Params[0].AsString:='Name');
Query1.Execute;

if now you want to add another clause just use Query1.Add(...)
or Query1[1] as it's a TString.


0
 
LVL 2

Expert Comment

by:javiertb
ID: 1335942
I'd really appreciate if you could evaluate my answer. It's a looong time since I last posted it.
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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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 …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

697 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