error writing char field

gpdati

Member
I have a simple table called MON_SCARICO :
sequenziale number(10)
tipo_record char(1)
hotel varchar2(5)

wher I use a TOracleQuery component for insert a record, if I specified the value of the char field directly on the sql text, there is no problem (1).
But if I use a variable for thar field, both otString or otChar I got the same error : ORA-1401 Inserted value too large for column (2).
Note that i use oracle db from 10 years and I know how to work.
The same query with the same parameters with the standard TQuery component work fine.

Is there any bug or something else ?
thanks in advance

1) THIS WORK
.....
Sql.Add( 'Insert into MON_SCARICO' );
Sql.Add( ' (Sequenziale,' );
Sql.Add( ' Tipo_Record,' );
Sql.Add( ' Hotel)' );
Sql.Add( 'values' );
Sql.Add( ' (:Sequenziale,' );
Sql.Add( ' ''M'',' );
Sql.Add( ' :Hotel)' );
.....

2) THIS DO NOT WORK
.....
Sql.Add( 'Insert into MON_SCARICO' );
Sql.Add( ' (Sequenziale,' );
Sql.Add( ' Tipo_Record,' );
Sql.Add( ' Hotel)' );
Sql.Add( 'values' );
Sql.Add( ' (:Sequenziale,' );
Sql.Add( ' :Tipo_Record,' );
Sql.Add( ' :Hotel)' );

DeleteVariables;
DeclareVariable( 'sequenziale', otFloat );
DeclareVariable( 'Tipo_Record', otString ); // OR otChar
DeclareVariable( 'Hotel', otString );

SetVariable( 'Sequenziale', Sequenziale );
SetVariable( 'Tipo_Record', 'M' );
SetVariable( 'Hotel', Hotel );

Execute;
 
Sorry but the problem is not the char field.
Some informations :
the application is logged on Oracle 8.1.7 with an Oracle Client Release 9.0.1.4.0.
The table (mon_scarico) is not on the 8.1.7 DB : there is a synonym from here to the real table on an Oracle 7.3.3 (on another machine).
So we have client 9, main db 8 but with a synonym to a 7 release.
The query works with oracle client and with the standard Delphi TQuery component; with TOracleQuery if I set UseOCI7 to true on the preferences of the Sessione works fine too. So the problem seems to be solved.

Bye
 
Last edited:
Back
Top