--- In advanced_delphi@yahoogroups.com, "Wayne" <[EMAIL PROTECTED]> wrote: > > Hi All, > > I am writing some code that generates sql statements that I am then > adding to the ibsql component in order to run the sql statement and > update my database. > > My problem is that ibsql component does not seem to like the fact > that there are numerous sql statements and not just one. > > When I write the sql statements to a memo component and then cut and > past it directly to the database and run it there, the code works > perfectly.. > > Any ideas? > > TIA > > Wayne > Wayne, Query Components need to be Closed before the SQL can be changed. You can of course have a separate query for each set of SQL and the only overhead is 4 bytes for a pointer and the SQL itself.
If the only difference in your SQL are the parameters then you can set the parameters only (while the Query is closed) and you can use ParameterByName[Name].asDataType := Value After all parameters are set you can Execute the query and get your results. hth Mick Mick