Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run SQLScript of 10000 > lines?

Status
Not open for further replies.

Kristjan

Programmer
Nov 12, 2002
29
CR
The problem is how to run a SQL script > 455 lines.
I have MsSQL Server and Delphi 5 and RX library.
with the SQLScript component i try to run a script about >1000 lines, but the script runs ok all the time from 1 to 455 lines and the rest of the script was ignored...
i also use Query component, and same problem.
the code:
DataModuleACT.SQLScriptExecACTCentral.SQL.Text := vU_InsRH.Text;
DataModuleACT.SQLScriptExecACTCentral.ExecSQL;

or

DataModuleACT.Query1.SQL.Clear;
DataModuleACT.Query1.SQL.Text := vU_InsRH.Text;
DataModuleACT.Query1.ExecSQL;

::> this only execute 455 lines... and no more...
but if i use the next code:
DataModuleACT.Query1.SQL.Clear;
DataModuleACT.Query1.SQL.Text := vU_InsRH.Text;
DataModuleACT.Query1.Active:= False;
DataModuleACT.Query1.Active:= True;

all data is post and ok in DB, but raise a cursor exception!!

ok i can use [try except] for this, but
where are the problem with .ExecSQL?
how to solve the "Error creating the cursor"?
 
I Fix the problem using the code:
try
...
try
DataModuleACT.Query1.SQL.Clear;
DataModuleACT.Query1.SQL.Text := vU_InsRH.Text;
DataModuleACT.Query1.Active:= False;
DataModuleACT.Query1.Active:= True;
except
on ENoResultSet do //No hacer nada!!!! Do Nothing!!!
else raise; //Cualquier otra cosa hacerlo saber...
end;
.....
except ....
...
end;

Note: in the uses need: dbtables, 4 the ENoResultSet.

I have Nested exceptions and need to handle the real excepts...

still don´t know why the .ExecSQL doesn´t work?
 
I post that i solve the problem... i think i solve, but the truth is the code:

try
DataModuleACT.Query1.SQL.Clear;
DataModuleACT.Query1.SQL.Text := vU_InsRH.Text;
DataModuleACT.Query1.Active:= False;
DataModuleACT.Query1.Active:= True;
....

only excecute 909 lines and no more...
!!!!! i need at least pass 5000 lines!!!!!
what happend with Tquery?

tnx 2 all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top