I have this table and data:
Code: Select all
CREATE TABLE "fin_documento"
( "doc_clave" NUMBER(14,0),
"doc_cli" NUMBER(8,0)
)
INSERT INTO "fin_documento" VALUES (10101, 903)
INSERT INTO "fin_documento" VALUES (2811900101, 903)
I insert the first record, say.. in wichever oracle manager, and then I open the table, everything goes ok.
The problem comes when I insert the second record (doc_clave=2811900101) and I try to open, I get "SQL Error: ORA-01455: converting column overflows integer datatype".
Following that error message I found: "The converted form of the specified expression was too large for the specified datatype. Define a larger datatype or correct the data."
Another site says that I can "get" the value as a float/double or as string and latter convert it to the right integer, but I think this is not the best solution.
On http://www.edhanced.com/ask-mred/?q=node/view/204 found:
"It really should be called OCI-01455. The error happens when, for example, you use an OCI function to read the number 5 billion, but you tell OCI you're expecting a 32-bit integer."
It makes sense, becouse debuggind I reached up to ZDbcOracleResultSet.pas
Code: Select all
function TZOracleResultSet.Next: Boolean;
892: if RowNo = 0 then
893: begin
894: Connection := GetStatement.GetConnection as IZOracleConnection;
895: Status := FPlainDriver.StmtExecute(Connection.GetContextHandle, FStmtHandle,
896: FErrorHandle, 1, 0, nil, nil, OCI_DEFAULT);
897: end
898: else
With Zeos 6.5.1, tried also to define manually the field "cod_clave" as Float or LargeInt, but Zeos complains. With Zeos 6.6.2 it recognizes that field as LargeInt, but still shows error ORA-01455.
I think it is matter of wich kind of field assigns InternalInitFieldDefs when it finds NUMBER(14,0), or calling OCI telling it that whe are especting an integer bigger than 32bits, but don´t have much time now to find out wich one, or if that procedure is the right place to solve this.
I apologize for giving up so early, but, can anybody help me with this situation?
Thanks in advance.