Page 1 of 1

ERROR:ORA-12899

Posted: Fri 05 Mar 2010 14:14
by wushan1215
i USED UNIDAC unidac3.00.0.6 IN DELPHI2010,BUT GET EROR ORA-12899:
delphi sql:oq2.Close ;
oq2.SQL.Text :='insert into T_CollectJobState (Lsh,Collrq,CollTime,CollectBox,RealRecNum,CollRecNum,headNum,roadNum,unsucNum,NonRec,TestNum,State,jsjh,czyh,pt)';
oq2.SQL.Add('Values(:lsh,:collrq,:colltime,:CollectBOx,:RealRecNum,0,0,0,0,0,0,0,:jsjh,:czyh,1)');
oq2.ParamByName('lsh').AsString :='123456';
oq2.ParamByName('collrq').AsString :='20100301';
oq2.ParamByName('colltime').AsString :='120000';
oq2.ParamByName('CollectBox').AsString :='00001000';
oq2.ParamByName('RealRecNum').Asinteger :=1000;
oq2.ParamByName('jsjh').AsString :='99' ;
oq2.ParamByName('czyh').AsString :='001' ;
oq2.Prepared:=true;
oq2.ExecSQL ;
ORA-12899: value too large for column “T_COLLECTJOBSTATE"."COLLTIME" (actual: 8, maximum: 6)

Ps:1)database Oracle Database 11g Enterprise Edition 11.1.0.6.0
2)colltime varchar2(6)
3)UniConnection1: TUniConnection
ProviderName = 'Oracle'
SpecificOptions.Strings = (
'Oracle.Direct=True'
'Oracle.Charset=ZHS16GBK'
'Oracle.UseUnicode=True')
Options.DisconnectedMode = True
Username = '****'
Password = '******'
Server = ******:*****:****'
LoginPrompt = False

Re: ERROR:ORA-12899

Posted: Fri 05 Mar 2010 14:16
by wushan1215
wushan1215 wrote:UNIDAC unidac3.00.0.6 IN DELPHI2010,BUT GET EROR ORA-12899:
delphi sql:oq2.Close ;
oq2.SQL.Text :='insert into T_CollectJobState (Lsh,Collrq,CollTime,CollectBox,RealRecNum,CollRecNum,headNum,roadNum,unsucNum,NonRec,TestNum,State,jsjh,czyh,pt)';
oq2.SQL.Add('Values(:lsh,:collrq,:colltime,:CollectBOx,:RealRecNum,0,0,0,0,0,0,0,:jsjh,:czyh,1)');
oq2.ParamByName('lsh').AsString :='123456';
oq2.ParamByName('collrq').AsString :='20100301';
oq2.ParamByName('colltime').AsString :='120000';
oq2.ParamByName('CollectBox').AsString :='00001000';
oq2.ParamByName('RealRecNum').Asinteger :=1000;
oq2.ParamByName('jsjh').AsString :='99' ;
oq2.ParamByName('czyh').AsString :='001' ;
oq2.Prepared:=true;
oq2.ExecSQL ;
ORA-12899: value too large for column “T_COLLECTJOBSTATE"."COLLTIME" (actual: 8, maximum: 6)

Ps:1)database Oracle Database 11g Enterprise Edition 11.1.0.6.0
2)colltime varchar2(6)
3)UniConnection1: TUniConnection
ProviderName = 'Oracle'
SpecificOptions.Strings = (
'Oracle.Direct=True'
'Oracle.Charset=ZHS16GBK'
'Oracle.UseUnicode=True')
Options.DisconnectedMode = True
Username = '****'
Password = '******'
Server = ******:*****:****'
LoginPrompt = False
please help me,thanks.

Posted: Sat 06 Mar 2010 06:38
by tobias_cd
Hi,
2 thoughts I have:
a) if you use Unicode generally in your DB, shouldn't your columns also have double the size, i.e. varchar2(12) instead of varchar2(6) etc.? This may not be an issue with this "colltime" column in this case, but maybe a general idea.
b) have you tried to use "simple" parameter names like ":a, :b, :c" etc. instead of the actual column names?
Regards,
Tobias

Posted: Sat 06 Mar 2010 08:47
by wushan1215
thanks,New build of UniDAC version 3.00.0.7 is available for download now.
This version includes:
Ability to use Access system database added

Added DetectFieldsOnPrepare parameter for NexusDB ODBC driver

Added ability to send call stack information to the dbMonitor component

Fixed bug with refreshing record when using master/detail relationship

Fixed bug with LocalUpdate in the CachedUpdates mode

Fixed bug with displaying nvarchar2 fields when UseUnicode is true

Fixed bug with getting IndexFieldNames list in design time

Fixed several bugs with getting information about SQLite database using the TUniMetadata component

Fixed bug with processing TableInfo for SQLite

Fixed bug with DBMonitor for C++ Builder 6
Devart development team

Posted: Mon 08 Mar 2010 08:44
by wushan1215
test UniDAC version 3.00.0.7,error: ora-12899
.........

Posted: Mon 08 Mar 2010 08:45
by wushan1215
create table T_COLLECTJOBSTATE
(
LSH NVARCHAR2(15) not null,
COLLRQ NVARCHAR2(8) not null,
COLLTIME NVARCHAR2(6) not null,
COLLECTBOX NVARCHAR2(8) not null,
REALRECNUM NUMBER(8) default 0,
COLLRECNUM NUMBER(8) default 0,
HEADNUM NUMBER(5) default 0,
ROADNUM NUMBER(5) default 0,
UNSUCNUM NUMBER(5) default 0,
NONREC NUMBER(5) default 0,
JSJH NVARCHAR2(2) not null,
CZYH NVARCHAR2(10) not null,
STATE NUMBER(1) default 0,
TESTNUM NUMBER(5) default 0,
PT NUMBER(1) default 0
)

Posted: Mon 08 Mar 2010 08:54
by wushan1215
nvarchar,varchar2,char,all datatype ,same error

Posted: Tue 09 Mar 2010 05:27
by wushan1215
oq2.Close ;
oq2.SQL.Text :='insert into T_CollectJobState (Lsh,Collrq,CollTime,CollectBox,RealRecNum,CollRecNum,headNum,roadNum,unsucNum,NonRec,TestNum,State,jsjh,czyh,pt)';
oq2.SQL.Add('Values(:lsh,:collrq,:colltime,:CollectBOx,:RealRecNum,0,0,0,0,0,0,0,:jsjh,:czyh,1)');
oq2.ParamByName('lsh').AsInteger :=strtoint('123456');
oq2.ParamByName('collrq').Asinteger :=strtoint('20100301');
oq2.ParamByName('colltime').Asinteger :=strtoint('120000');
oq2.ParamByName('CollectBox').Asinteger:=strtoint('00001000');
oq2.ParamByName('RealRecNum').Asinteger :=1000;
oq2.ParamByName('jsjh').Asinteger :=strtoint('99') ;
oq2.ParamByName('czyh').Asinteger :=strtoint('001') ;
oq2.Prepared:=true;
oq2.ExecSQL ;
NOT USED ASSTRING ,WORK FINE,I THINK: THIS ERROR IN "VARCHAR2"

Posted: Wed 10 Mar 2010 13:25
by wushan1215
http://www.devart.com/forums/viewtopic. ... 061a790399:

oq2.Close ;
oq2.SQL.Text :='insert into T_CollectJobState (Lsh,Collrq,CollTime,CollectBox,RealRecNum,CollRecNum,headNum,roadNum,unsucNum,NonRec,TestNum,State,jsjh,czyh,pt)';
oq2.SQL.Add('Values(:lsh,:collrq,:colltime,:CollectBOx,:RealRecNum,0,0,0,0,0,0,0,:jsjh,:czyh,1)');
oq2.Params.ParamValues['lsh']:=widestring('123456');
oq2.Params.ParamValues['collrq'] :=widestring('20100301');
oq2.Params.ParamValues['colltime']:=widestring('120000');
oq2.Params.ParamValues['CollectBox'] :=widestring('00001000');
oq2.Params.ParamValues['RealRecNum'] :=integer(1000);
oq2.Params.ParamValues['jsjh'] :=widestring('99');
oq2.Params.ParamValues['czyh'] :=widestring('001') ;
oq2.Prepared:=true;
oq2.ExecSQL ;


USE ODAC 6.90.0.55,ERROR ORA-01401,......
HELP,THANKS

Posted: Thu 11 Mar 2010 14:21
by Challenger
We have reproduced this problem. And now we are investigating it. As soon as we get any results we will let you know.

Posted: Fri 12 Mar 2010 13:37
by Challenger
We have fixed this problem. This fix will be included in the next build of UniDAC.