Solved

SQL's

Posted on 1997-05-06
2
158 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
Comment Utility
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
Comment Utility
I'd really appreciate if you could evaluate my answer. It's a looong time since I last posted it.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now