Trouble in use of dbExpress


2004-08-12 03:21:36 AM
delphi199
I've a code using dbExpress that presents an error when inserting registers.
The worse one of everything is that this situation only happens in some
machines and until now I did not get success to solve this problem!
Only for an explanation: I want to make a program that imports the
informations within text files to a determined Data Base.
That import can be made in SQL Server and Oracle.
The my configuration of TSQLConnection is the following:
ORACLE:
-------
ConnectionName = OracleConnection
DriverName = Oracle (Core Lab)
GetDriverFunc = getSQLDriverORA
LibraryName = dbexpoda.dll
VendorLib = oci.dll
DriverName=Oracle
RowsetSize=20
BlobSize=-1
ErrorResourceFile=
LocaleCode=0000
Oracle TransIsolation=ReadCommited
OS Authentication=False
Multiple Transaction=True
Trim Char=False
EnableBCD=False
SQL Server:
-----------
ConnectionName = MS SQLConnection
DriverName = SQLServer
GetDriverFunc = getSQLDriverSQLServer
LibraryName = dbexpsda.dll
VendorLib = sqloledb.dll
DriverName=MS SQL
BlobSize=-1
ErrorResourceFile=
LocaleCode=0000
MS SQL TransIsolation=ReadCommited
OS Authentication=False
EnableBCD=False
T've a TClientDataSet associated to a TDataSetProvider that is linked to a
TSQLQuery.
My code is basically the following:
01 - I set the SQL to the TSQLQuery;
02 - I open the TClientDataSet;
03 - I execute a StartTransaction in the TSQLConnection;
04 - LOOP for each line of the file that will be imported;
05 - ->I seek within the TClientDataSet the actual line of file.
If this line exists, I execute a Update.
If this line don't exists, I execute a Insert;
06 - ->I set all the fields in the actual line of file;
07 - ->I set a Post in the TClientDataSet;
08 - End of LOOP to each line of file that will be imported;
09 - I execute a ApplyUpdates(0) in the TClientDataSet;
10 - If the ApplyUpdates(0) has functioned, I execute a Commit in the
TSQLConnection.
It follows a part of the LOG (using TSQLMonitor):
Connect: user "teste", server "teste"
SELECT
IDSITFUNC, DESCRICAO, TIPOSIT, FLGINTERNO, CODCAGED, CODMOVFGTS, FLGUSO
FROM
SITFUNC
ORDER BY
IDSITFUNC
Begin: user "teste", server "teste"
update SITFUNC set
DESCRICAO = :1,
CODMOVFGTS = :2
where
IDSITFUNC = :3 and
DESCRICAO = :4 and
TIPOSIT = :5 and
FLGINTERNO is null and
CODCAGED is null and
CODMOVFGTS is null and
FLGUSO = :6
:1 (String[5],IN) = 'ATIVO'
:2 (String[2],IN) = 'O1'
:3 (Float,IN) = 1
:4 (String[5],IN) = 'ATIVO'
:5 (String[1],IN) = 'A'
:6 (String[1],IN) = 'R'
insert into SITFUNC
( IDSITFUNC , DESCRICAO , TIPOSIT , FLGINTERNO , CODCAGED ,
CODMOVFGTS , FLGUSO )
values
(?, :1, :2, :3, :4, :5, :6)
:1 (Float,IN) = 7
:2 (String[28],IN) = 'APOSENT.P/ ACIDENTE TRABALHO'
:3 (String[1],IN) = 'F'
:4 (String,IN) = <NULL>
:5 (String[2],IN) = '73'
:6 (String[2],IN) = 'U3'
:7 (String[1],IN) = 'R'
Error: ORA-01036: illegal variable name/number
Rollback: user "teste", server "teste"
What I am doing wrong??? I could verify that a UPDATE do but a INSERT don't
(just in some machines).
Thanks in advance to who will be able to help me,
Raniere