开发者

BCB: from BDE to dbexpress, BCD exception

I'm having some problem about TSQLStoredProcedure. Here is the code:

storedproc->ParamByName("A")->AsInteger = adataset->FieldByName("AA")->AsInteger;
storedproc->ExecProc();

param "A" is declared integer in the form (and it's 29 in the program). Also the stored procedure has no errors. I'm sure of it. Database is Oracle 11g. By the way, as storedproc is开发者_JS百科 executed an exception occurred:

... 
EBcdException with message '<0000001:000000010000000:00000063612>' is not a valid BCD value
...

All was working fine with BDE but now, using dbexpress, there is this problem. I searched over the internet for some days and I did not find an answer.

I thank you in advance and beg a pardon for my English.

Francesco

Update

I searched over the web. I found something interesting at:

https://forums.codegear.com/thread.jspa?messageID=43223&tstart=0 http://www.delphigroups.info/2/8/750511.html

I decide to make some test:

SQLQuery->ParamByName("f1")->AsString = Edit1->Text;
SQLQuery->ExecSQL();

It works. Not the same for

SQLQuery->ParamByName("f1")->AsInteger = StrToInt(Edit1->Text);       //ERROR DBX Error: Invalid Field Type.
SQLQuery->ParamByName("f1")->AsFloat = StrToFloat(Edit1->Text);      //ERROR DBX Error: Invalid Field Type.
SQLQuery->ParamByName("f1")->AsBCD = StrToInt(Edit1->Text);          //ERROR ORA-06502: PL/SQL: error: ... ORA-06512: at line 1.
SQLQuery->ParamByName("f1")->AsFMTBCD = StrToBcd(Edit2->Text); //ERROR ORA-06502: PL/SQL: error: ... ORA-06512: at line 1.

or by using TSQLStoredProc. So now I call my pl/sql stored proc by TSQLQuery. I use "AsString" to pass values to parameters. Weird. How does dbexpress map types? Thanks in advance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜